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/table.h> 25 # include <deal.II/base/template_constraints.h> 27 # include <deal.II/lac/block_matrix_base.h> 28 # include <deal.II/lac/exceptions.h> 29 # include <deal.II/lac/full_matrix.h> 30 # include <deal.II/lac/trilinos_parallel_block_vector.h> 31 # include <deal.II/lac/trilinos_sparse_matrix.h> 35 DEAL_II_NAMESPACE_OPEN
39 template <
typename number>
89 using pointer = BaseClass::pointer;
90 using const_pointer = BaseClass::const_pointer;
91 using reference = BaseClass::reference;
92 using const_reference = BaseClass::const_reference;
93 using size_type = BaseClass::size_type;
155 template <
typename BlockSparsityPatternType>
157 reinit(
const std::vector<Epetra_Map> & input_maps,
158 const BlockSparsityPatternType &block_sparsity_pattern,
159 const bool exchange_data =
false);
166 template <
typename BlockSparsityPatternType>
168 reinit(
const std::vector<IndexSet> & input_maps,
169 const BlockSparsityPatternType &block_sparsity_pattern,
170 const MPI_Comm & communicator = MPI_COMM_WORLD,
171 const bool exchange_data =
false);
178 template <
typename BlockSparsityPatternType>
180 reinit(
const BlockSparsityPatternType &block_sparsity_pattern);
192 reinit(
const std::vector<Epetra_Map> & input_maps,
193 const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
194 const double drop_tolerance = 1e-13);
204 reinit(const ::BlockSparseMatrix<double> &deal_ii_sparse_matrix,
205 const double drop_tolerance = 1e-13);
253 std::vector<Epetra_Map>
266 std::vector<Epetra_Map>
274 std::vector<IndexSet>
282 std::vector<IndexSet>
291 template <
typename VectorType1,
typename VectorType2>
293 vmult(VectorType1 &dst,
const VectorType2 &src)
const;
300 template <
typename VectorType1,
typename VectorType2>
302 Tvmult(VectorType1 &dst,
const VectorType2 &src)
const;
376 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
377 <<
',' << arg4 <<
"] have differing row numbers.");
387 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
388 <<
',' << arg4 <<
"] have differing column numbers.");
395 template <
typename VectorType1,
typename VectorType2>
397 vmult(VectorType1 & dst,
398 const VectorType2 &src,
400 const std::integral_constant<bool, true>,
401 const std::integral_constant<bool, true>)
const;
407 template <
typename VectorType1,
typename VectorType2>
409 vmult(VectorType1 & dst,
410 const VectorType2 &src,
412 const std::integral_constant<bool, false>,
413 const std::integral_constant<bool, true>)
const;
419 template <
typename VectorType1,
typename VectorType2>
421 vmult(VectorType1 & dst,
422 const VectorType2 &src,
424 const std::integral_constant<bool, true>,
425 const std::integral_constant<bool, false>)
const;
432 template <
typename VectorType1,
typename VectorType2>
434 vmult(VectorType1 & dst,
435 const VectorType2 &src,
437 const std::integral_constant<bool, false>,
438 const std::integral_constant<bool, false>)
const;
456 this->
block(r, c) = d;
466 bool compressed =
true;
469 if (
block(row, col).is_compressed() ==
false)
480 template <
typename VectorType1,
typename VectorType2>
493 template <
typename VectorType1,
typename VectorType2>
506 template <
typename VectorType1,
typename VectorType2>
509 const VectorType2 &src,
511 std::integral_constant<bool, true>,
512 std::integral_constant<bool, true>)
const 514 if (transpose ==
true)
522 template <
typename VectorType1,
typename VectorType2>
525 const VectorType2 &src,
527 std::integral_constant<bool, false>,
528 std::integral_constant<bool, true>)
const 530 if (transpose ==
true)
538 template <
typename VectorType1,
typename VectorType2>
541 const VectorType2 &src,
543 std::integral_constant<bool, true>,
544 std::integral_constant<bool, false>)
const 546 if (transpose ==
true)
554 template <
typename VectorType1,
typename VectorType2>
557 const VectorType2 &src,
559 std::integral_constant<bool, false>,
560 std::integral_constant<bool, false>)
const 562 if (transpose ==
true)
570 inline std::vector<IndexSet>
576 std::vector<IndexSet> domain_indices;
578 domain_indices.push_back(
579 this->sub_objects[0][c]->locally_owned_domain_indices());
581 return domain_indices;
586 inline std::vector<IndexSet>
592 std::vector<IndexSet> range_indices;
594 range_indices.push_back(
595 this->sub_objects[r][0]->locally_owned_range_indices());
597 return range_indices;
604 namespace BlockLinearOperatorImplementation
621 template <
typename PayloadBlockType>
639 template <
typename... Args>
646 "TrilinosBlockPayload can only accept a payload of type TrilinosPayload.");
657 DEAL_II_NAMESPACE_CLOSE
659 #endif // DEAL_II_WITH_TRILINOS 661 #endif // dealii_trilinos_block_sparse_matrix_h
void Tvmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
BlockSparseMatrix()=default
void vmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
static::ExceptionBase & ExcIncompatibleRowNumbers(int arg1, int arg2, int arg3, int arg4)
~BlockSparseMatrix() override
void vmult_nonblock_nonblock(VectorType &dst, const VectorType &src) const
static::ExceptionBase & ExcScalarAssignmentOnlyForZeroValue()
TrilinosBlockPayload(const Args &...)
static::ExceptionBase & ExcNotInitialized()
void Tvmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
unsigned int n_block_cols() const
std::vector< IndexSet > locally_owned_range_indices() const
MPI_Comm get_mpi_communicator() const
void vmult_block_nonblock(BlockVectorType &dst, const VectorType &src) const
void vmult(VectorType1 &dst, const VectorType2 &src) const
void reinit(const size_type n_block_rows, const size_type n_block_columns)
typename BlockType::value_type value_type
static::ExceptionBase & ExcIncompatibleColNumbers(int arg1, int arg2, int arg3, int arg4)
BaseClass::value_type value_type
void vmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
std::vector< Epetra_Map > range_partitioner() const
#define Assert(cond, exc)
std::vector< IndexSet > locally_owned_domain_indices() const
PayloadBlockType BlockType
size_type n_nonzero_elements() const
TrilinosScalar residual(MPI::BlockVector &dst, const MPI::BlockVector &x, const MPI::BlockVector &b) const
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
void Tvmult_nonblock_block(VectorType &dst, const BlockVectorType &src) const
void Tvmult_block_block(BlockVectorType &dst, const BlockVectorType &src) const
BlockType & block(const unsigned int row, const unsigned int column)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
bool is_compressed() const
std::vector< Epetra_Map > domain_partitioner() const
void Tvmult(VectorType1 &dst, const VectorType2 &src) const
BlockSparseMatrix & operator=(const BlockSparseMatrix &)=default
unsigned int n_block_rows() const