16 #ifndef dealii_trilinos_block_sparse_matrix_h 17 #define dealii_trilinos_block_sparse_matrix_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_TRILINOS 24 # include <deal.II/base/template_constraints.h> 26 # include <deal.II/lac/block_matrix_base.h> 27 # include <deal.II/lac/exceptions.h> 28 # include <deal.II/lac/full_matrix.h> 29 # include <deal.II/lac/trilinos_parallel_block_vector.h> 30 # include <deal.II/lac/trilinos_sparse_matrix.h> 34 DEAL_II_NAMESPACE_OPEN
38 template <
typename number>
88 using pointer = BaseClass::pointer;
89 using const_pointer = BaseClass::const_pointer;
90 using reference = BaseClass::reference;
91 using const_reference = BaseClass::const_reference;
92 using size_type = BaseClass::size_type;
154 template <
typename BlockSparsityPatternType>
156 reinit(
const std::vector<Epetra_Map> & input_maps,
157 const BlockSparsityPatternType &block_sparsity_pattern,
158 const bool exchange_data =
false);
165 template <
typename BlockSparsityPatternType>
167 reinit(
const std::vector<IndexSet> & input_maps,
168 const BlockSparsityPatternType &block_sparsity_pattern,
169 const MPI_Comm & communicator = MPI_COMM_WORLD,
170 const bool exchange_data =
false);
177 template <
typename BlockSparsityPatternType>
179 reinit(
const BlockSparsityPatternType &block_sparsity_pattern);
191 reinit(
const std::vector<Epetra_Map> & input_maps,
192 const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
193 const double drop_tolerance = 1e-13);
203 reinit(const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
204 const double drop_tolerance = 1e-13);
252 std::vector<Epetra_Map>
265 std::vector<Epetra_Map>
273 std::vector<IndexSet>
281 std::vector<IndexSet>
290 template <
typename VectorType1,
typename VectorType2>
292 vmult(VectorType1 &dst,
const VectorType2 &src)
const;
299 template <
typename VectorType1,
typename VectorType2>
301 Tvmult(VectorType1 &dst,
const VectorType2 &src)
const;
375 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
376 <<
',' << arg4 <<
"] have differing row numbers.");
386 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
387 <<
',' << arg4 <<
"] have differing column numbers.");
394 template <
typename VectorType1,
typename VectorType2>
396 vmult(VectorType1 & dst,
397 const VectorType2 &src,
399 const std::integral_constant<bool, true>,
400 const std::integral_constant<bool, true>)
const;
406 template <
typename VectorType1,
typename VectorType2>
408 vmult(VectorType1 & dst,
409 const VectorType2 &src,
411 const std::integral_constant<bool, false>,
412 const std::integral_constant<bool, true>)
const;
418 template <
typename VectorType1,
typename VectorType2>
420 vmult(VectorType1 & dst,
421 const VectorType2 &src,
423 const std::integral_constant<bool, true>,
424 const std::integral_constant<bool, false>)
const;
431 template <
typename VectorType1,
typename VectorType2>
433 vmult(VectorType1 & dst,
434 const VectorType2 &src,
436 const std::integral_constant<bool, false>,
437 const std::integral_constant<bool, false>)
const;
455 this->
block(r, c) = d;
465 bool compressed =
true;
468 if (
block(row, col).is_compressed() ==
false)
479 template <
typename VectorType1,
typename VectorType2>
492 template <
typename VectorType1,
typename VectorType2>
505 template <
typename VectorType1,
typename VectorType2>
508 const VectorType2 &src,
510 std::integral_constant<bool, true>,
511 std::integral_constant<bool, true>)
const 521 template <
typename VectorType1,
typename VectorType2>
524 const VectorType2 &src,
526 std::integral_constant<bool, false>,
527 std::integral_constant<bool, true>)
const 537 template <
typename VectorType1,
typename VectorType2>
540 const VectorType2 &src,
542 std::integral_constant<bool, true>,
543 std::integral_constant<bool, false>)
const 553 template <
typename VectorType1,
typename VectorType2>
556 const VectorType2 &src,
558 std::integral_constant<bool, false>,
559 std::integral_constant<bool, false>)
const 569 inline std::vector<IndexSet>
575 std::vector<IndexSet> domain_indices;
577 domain_indices.push_back(
578 this->sub_objects[0][c]->locally_owned_domain_indices());
580 return domain_indices;
585 inline std::vector<IndexSet>
591 std::vector<IndexSet> range_indices;
593 range_indices.push_back(
594 this->sub_objects[r][0]->locally_owned_range_indices());
596 return range_indices;
603 namespace BlockLinearOperatorImplementation
620 template <
typename PayloadBlockType>
638 template <
typename... Args>
645 "TrilinosBlockPayload can only accept a payload of type TrilinosPayload.");
656 DEAL_II_NAMESPACE_CLOSE
658 #endif // DEAL_II_WITH_TRILINOS 660 #endif // dealii_trilinos_block_sparse_matrix_h
void vmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
std::vector< Epetra_Map > range_partitioner() const
BlockSparseMatrix()=default
static ::ExceptionBase & ExcIncompatibleRowNumbers(int arg1, int arg2, int arg3, int arg4)
~BlockSparseMatrix() override
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
TrilinosBlockPayload(const Args &...)
void vmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
static ::ExceptionBase & ExcNotInitialized()
void Tvmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
void Tvmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
void Tvmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
void vmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
typename BlockType::value_type value_type
void Tvmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
static ::ExceptionBase & ExcIncompatibleColNumbers(int arg1, int arg2, int arg3, int arg4)
BaseClass::value_type value_type
unsigned int n_block_cols() const
std::vector< Epetra_Map > domain_partitioner() const
void vmult(VectorType1 &dst, const VectorType2 &src) const
#define Assert(cond, exc)
PayloadBlockType BlockType
void reinit(const size_type n_block_rows, const size_type n_block_columns)
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
bool is_compressed() const
MPI_Comm get_mpi_communicator() const
void Tvmult(VectorType1 &dst, const VectorType2 &src) const
void vmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
BlockType & block(const unsigned int row, const unsigned int column)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
size_type n_nonzero_elements() const
unsigned int n_block_rows() const
std::vector< IndexSet > locally_owned_range_indices() const
TrilinosScalar residual(MPI::BlockVector &dst, const MPI::BlockVector &x, const MPI::BlockVector &b) const
BlockSparseMatrix & operator=(const BlockSparseMatrix &)=default
std::vector< IndexSet > locally_owned_domain_indices() const