13#ifndef dealii_trilinos_block_sparse_matrix_h
14#define dealii_trilinos_block_sparse_matrix_h
19#ifndef DEAL_II_TRILINOS_WITH_EPETRA
26#ifdef DEAL_II_TRILINOS_WITH_EPETRA
41#ifdef DEAL_II_TRILINOS_WITH_EPETRA
45template <
typename number>
161 template <
typename BlockSparsityPatternType>
163 reinit(
const std::vector<IndexSet> &input_maps,
164 const BlockSparsityPatternType &block_sparsity_pattern,
165 const MPI_Comm communicator = MPI_COMM_WORLD,
166 const bool exchange_data =
false);
173 template <
typename BlockSparsityPatternType>
175 reinit(
const BlockSparsityPatternType &block_sparsity_pattern);
185 const std::vector<IndexSet> ¶llel_partitioning,
186 const ::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
187 const MPI_Comm communicator = MPI_COMM_WORLD,
188 const double drop_tolerance = 1e-13);
198 reinit(const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
199 const double drop_tolerance = 1e-13);
242 std::vector<IndexSet>
250 std::vector<IndexSet>
259 template <
typename VectorType1,
typename VectorType2>
261 vmult(VectorType1 &dst,
const VectorType2 &src)
const;
268 template <
typename VectorType1,
typename VectorType2>
270 Tvmult(VectorType1 &dst,
const VectorType2 &src)
const;
344 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
345 <<
',' << arg4 <<
"] have differing row numbers.");
355 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
356 <<
',' << arg4 <<
"] have differing column numbers.");
363 template <
typename VectorType1,
typename VectorType2>
365 vmult(VectorType1 &dst,
366 const VectorType2 &src,
368 const std::bool_constant<true>,
369 const std::bool_constant<true>)
const;
375 template <
typename VectorType1,
typename VectorType2>
377 vmult(VectorType1 &dst,
378 const VectorType2 &src,
380 const std::bool_constant<false>,
381 const std::bool_constant<true>)
const;
387 template <
typename VectorType1,
typename VectorType2>
389 vmult(VectorType1 &dst,
390 const VectorType2 &src,
392 const std::bool_constant<true>,
393 const std::bool_constant<false>)
const;
400 template <
typename VectorType1,
typename VectorType2>
402 vmult(VectorType1 &dst,
403 const VectorType2 &src,
405 const std::bool_constant<false>,
406 const std::bool_constant<false>)
const;
424 this->
block(r, c) = d;
434 bool compressed =
true;
437 if (
block(row, col).is_compressed() ==
false)
448 template <
typename VectorType1,
typename VectorType2>
461 template <
typename VectorType1,
typename VectorType2>
474 template <
typename VectorType1,
typename VectorType2>
477 const VectorType2 &src,
479 std::bool_constant<true>,
480 std::bool_constant<true>)
const
490 template <
typename VectorType1,
typename VectorType2>
493 const VectorType2 &src,
495 std::bool_constant<false>,
496 std::bool_constant<true>)
const
506 template <
typename VectorType1,
typename VectorType2>
509 const VectorType2 &src,
511 std::bool_constant<true>,
512 std::bool_constant<false>)
const
522 template <
typename VectorType1,
typename VectorType2>
525 const VectorType2 &src,
527 std::bool_constant<false>,
528 std::bool_constant<false>)
const
538 inline std::vector<IndexSet>
544 std::vector<IndexSet> domain_indices;
547 domain_indices.push_back(
548 this->sub_objects[0][c]->locally_owned_domain_indices());
550 return domain_indices;
555 inline std::vector<IndexSet>
561 std::vector<IndexSet> range_indices;
564 range_indices.push_back(
565 this->sub_objects[r][0]->locally_owned_range_indices());
567 return range_indices;
574 namespace BlockLinearOperatorImplementation
590 template <
typename PayloadBlockType>
608 template <
typename... Args>
615 "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()