15#ifndef dealii_trilinos_block_sparse_matrix_h
16#define dealii_trilinos_block_sparse_matrix_h
21#ifdef DEAL_II_WITH_TRILINOS
38template <
typename number>
154 template <
typename BlockSparsityPatternType>
156 reinit(
const std::vector<IndexSet> &input_maps,
157 const BlockSparsityPatternType &block_sparsity_pattern,
158 const MPI_Comm communicator = MPI_COMM_WORLD,
159 const bool exchange_data =
false);
166 template <
typename BlockSparsityPatternType>
168 reinit(
const BlockSparsityPatternType &block_sparsity_pattern);
178 const std::vector<IndexSet> ¶llel_partitioning,
179 const ::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
180 const MPI_Comm communicator = MPI_COMM_WORLD,
181 const double drop_tolerance = 1e-13);
191 reinit(const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
192 const double drop_tolerance = 1e-13);
235 std::vector<IndexSet>
243 std::vector<IndexSet>
252 template <
typename VectorType1,
typename VectorType2>
254 vmult(VectorType1 &dst,
const VectorType2 &src)
const;
261 template <
typename VectorType1,
typename VectorType2>
263 Tvmult(VectorType1 &dst,
const VectorType2 &src)
const;
337 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
338 <<
',' << arg4 <<
"] have differing row numbers.");
348 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
349 <<
',' << arg4 <<
"] have differing column numbers.");
356 template <
typename VectorType1,
typename VectorType2>
358 vmult(VectorType1 &dst,
359 const VectorType2 &src,
361 const std::bool_constant<true>,
362 const std::bool_constant<true>)
const;
368 template <
typename VectorType1,
typename VectorType2>
370 vmult(VectorType1 &dst,
371 const VectorType2 &src,
373 const std::bool_constant<false>,
374 const std::bool_constant<true>)
const;
380 template <
typename VectorType1,
typename VectorType2>
382 vmult(VectorType1 &dst,
383 const VectorType2 &src,
385 const std::bool_constant<true>,
386 const std::bool_constant<false>)
const;
393 template <
typename VectorType1,
typename VectorType2>
395 vmult(VectorType1 &dst,
396 const VectorType2 &src,
398 const std::bool_constant<false>,
399 const std::bool_constant<false>)
const;
417 this->
block(r, c) = d;
427 bool compressed =
true;
430 if (
block(row, col).is_compressed() ==
false)
441 template <
typename VectorType1,
typename VectorType2>
454 template <
typename VectorType1,
typename VectorType2>
467 template <
typename VectorType1,
typename VectorType2>
470 const VectorType2 &src,
472 std::bool_constant<true>,
473 std::bool_constant<true>)
const
483 template <
typename VectorType1,
typename VectorType2>
486 const VectorType2 &src,
488 std::bool_constant<false>,
489 std::bool_constant<true>)
const
499 template <
typename VectorType1,
typename VectorType2>
502 const VectorType2 &src,
504 std::bool_constant<true>,
505 std::bool_constant<false>)
const
515 template <
typename VectorType1,
typename VectorType2>
518 const VectorType2 &src,
520 std::bool_constant<false>,
521 std::bool_constant<false>)
const
531 inline std::vector<IndexSet>
537 std::vector<IndexSet> domain_indices;
539 domain_indices.push_back(
540 this->sub_objects[0][c]->locally_owned_domain_indices());
542 return domain_indices;
547 inline std::vector<IndexSet>
553 std::vector<IndexSet> range_indices;
555 range_indices.push_back(
556 this->sub_objects[r][0]->locally_owned_range_indices());
558 return range_indices;
565 namespace BlockLinearOperatorImplementation
581 template <
typename PayloadBlockType>
599 template <
typename... Args>
606 "TrilinosBlockPayload can only accept a payload of type TrilinosPayload.");
void Tvmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
void vmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
void Tvmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
const value_type & const_reference
void Tvmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
unsigned int n_block_rows() const
MatrixIterator< BlockMatrixIterators::Accessor< BlockMatrixBase, true > > const_iterator
void vmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
types::global_dof_index size_type
typename BlockType::value_type value_type
void vmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
unsigned int n_block_cols() const
const value_type * const_pointer
MatrixIterator< BlockMatrixIterators::Accessor< BlockMatrixBase, false > > iterator
BlockType & block(const unsigned int row, const unsigned int column)
void vmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
void Tvmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
BaseClass::value_type value_type
BlockSparseMatrix & operator=(const BlockSparseMatrix &)=default
BlockSparseMatrix()=default
bool is_compressed() const
~BlockSparseMatrix() override
BaseClass::const_reference const_reference
TrilinosScalar residual(MPI::BlockVector &dst, const MPI::BlockVector &x, const MPI::BlockVector &b) const
MPI_Comm get_mpi_communicator() const
void Tvmult(VectorType1 &dst, const VectorType2 &src) const
BaseClass::pointer pointer
std::uint64_t n_nonzero_elements() const
std::vector< IndexSet > locally_owned_domain_indices() const
BaseClass::const_pointer const_pointer
void reinit(const size_type n_block_rows, const size_type n_block_columns)
std::vector< IndexSet > locally_owned_range_indices() const
void vmult(VectorType1 &dst, const VectorType2 &src) const
BaseClass::reference reference
TrilinosBlockPayload(const Args &...)
PayloadBlockType BlockType
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcIncompatibleRowNumbers(int arg1, int arg2, int arg3, int arg4)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
#define Assert(cond, exc)
static ::ExceptionBase & ExcIncompatibleColNumbers(int arg1, int arg2, int arg3, int arg4)
static ::ExceptionBase & ExcNotInitialized()