16#ifndef dealii_trilinos_block_sparse_matrix_h
17#define dealii_trilinos_block_sparse_matrix_h
22#ifdef DEAL_II_WITH_TRILINOS
39template <
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> & parallel_partitioning,
179 const ::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
180 const MPI_Comm & communicator = MPI_COMM_WORLD,
181 const double drop_tolerance = 1
e-13);
191 reinit(const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
192 const double drop_tolerance = 1
e-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::integral_constant<bool, true>,
362 const std::integral_constant<bool, true>)
const;
368 template <
typename VectorType1,
typename VectorType2>
370 vmult(VectorType1 & dst,
371 const VectorType2 &src,
373 const std::integral_constant<bool, false>,
374 const std::integral_constant<bool, true>)
const;
380 template <
typename VectorType1,
typename VectorType2>
382 vmult(VectorType1 & dst,
383 const VectorType2 &src,
385 const std::integral_constant<bool, true>,
386 const std::integral_constant<bool, false>)
const;
393 template <
typename VectorType1,
typename VectorType2>
395 vmult(VectorType1 & dst,
396 const VectorType2 &src,
398 const std::integral_constant<bool, false>,
399 const std::integral_constant<bool, false>)
const;
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::integral_constant<bool, true>,
473 std::integral_constant<bool, true>)
const
483 template <
typename VectorType1,
typename VectorType2>
486 const VectorType2 &src,
488 std::integral_constant<bool, false>,
489 std::integral_constant<bool, true>)
const
499 template <
typename VectorType1,
typename VectorType2>
502 const VectorType2 &src,
504 std::integral_constant<bool, true>,
505 std::integral_constant<bool, false>)
const
515 template <
typename VectorType1,
typename VectorType2>
518 const VectorType2 &src,
520 std::integral_constant<bool, false>,
521 std::integral_constant<bool, 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.");
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
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
static ::ExceptionBase & ExcIncompatibleRowNumbers(int arg1, int arg2, int arg3, int arg4)
void Tvmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
void vmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
static ::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
void vmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
#define Assert(cond, exc)
static ::ExceptionBase & ExcIncompatibleColNumbers(int arg1, int arg2, int arg3, int arg4)
static ::ExceptionBase & ExcNotInitialized()
void vmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
void Tvmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
const value_type & const_reference
unsigned int n_block_rows() const
MatrixIterator< BlockMatrixIterators::Accessor< BlockMatrixBase, true > > const_iterator
types::global_dof_index size_type
typename BlockType::value_type value_type
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)
BaseClass::value_type value_type
BlockSparseMatrix & operator=(const BlockSparseMatrix &)=default
BaseClass::size_type size_type
BlockSparseMatrix()=default
bool is_compressed() const
void reinit(const size_type n_block_rows, const size_type n_block_columns)
~BlockSparseMatrix() override
BaseClass::const_reference const_reference
TrilinosBlockPayload(const Args &...)
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::vector< IndexSet > locally_owned_domain_indices() const
BaseClass::const_pointer const_pointer
PayloadBlockType BlockType
size_type n_nonzero_elements() const
std::vector< IndexSet > locally_owned_range_indices() const
void vmult(VectorType1 &dst, const VectorType2 &src) const
BaseClass::reference reference
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)