18#ifdef DEAL_II_WITH_TRILINOS
44 const size_type n_block_columns)
53 this->
sub_objects.reinit(n_block_rows, n_block_columns);
71 template <
typename BlockSparsityPatternType>
74 const std::vector<IndexSet> & parallel_partitioning,
75 const BlockSparsityPatternType &block_sparsity_pattern,
77 const bool exchange_data)
79 std::vector<Epetra_Map> epetra_maps;
80 for (
size_type i = 0; i < block_sparsity_pattern.n_block_rows(); ++i)
81 epetra_maps.push_back(
82 parallel_partitioning[i].make_trilinos_map(communicator,
false));
84 Assert(epetra_maps.size() == block_sparsity_pattern.n_block_rows(),
86 block_sparsity_pattern.n_block_rows()));
87 Assert(epetra_maps.size() == block_sparsity_pattern.n_block_cols(),
89 block_sparsity_pattern.n_block_cols()));
96 block_sparsity_pattern.n_block_rows()));
99 block_sparsity_pattern.n_block_cols()));
103 reinit(block_sparsity_pattern.n_block_rows(),
104 block_sparsity_pattern.n_block_cols());
115 this->
sub_objects[r][c]->reinit(parallel_partitioning[r],
116 parallel_partitioning[c],
117 block_sparsity_pattern.block(r, c),
125 template <
typename BlockSparsityPatternType>
128 const BlockSparsityPatternType &block_sparsity_pattern)
130 std::vector<IndexSet> parallel_partitioning;
131 for (
size_type i = 0; i < block_sparsity_pattern.n_block_rows(); ++i)
132 parallel_partitioning.emplace_back(
135 reinit(parallel_partitioning, block_sparsity_pattern);
165 const std::vector<IndexSet> & parallel_partitioning,
166 const ::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
168 const double drop_tolerance)
174 dealii_block_sparse_matrix.n_block_rows()));
177 dealii_block_sparse_matrix.n_block_cols()));
187 this->
sub_objects[r][c]->reinit(parallel_partitioning[r],
188 parallel_partitioning[c],
189 dealii_block_sparse_matrix.block(r,
202 const ::BlockSparseMatrix<double> &dealii_block_sparse_matrix,
203 const double drop_tolerance)
205 Assert(dealii_block_sparse_matrix.n_block_rows() ==
206 dealii_block_sparse_matrix.n_block_cols(),
208 dealii_block_sparse_matrix.n_block_cols()));
209 Assert(dealii_block_sparse_matrix.m() == dealii_block_sparse_matrix.n(),
211 dealii_block_sparse_matrix.n()));
213 std::vector<IndexSet> parallel_partitioning;
214 for (
size_type i = 0; i < dealii_block_sparse_matrix.n_block_rows(); ++i)
215 parallel_partitioning.emplace_back(
218 reinit(parallel_partitioning,
219 dealii_block_sparse_matrix,
238 std::uint64_t n_nonzero = 0;
313 return this->
sub_objects[0][0]->get_mpi_communicator();
328 const ::BlockDynamicSparsityPattern &,
void reinit(const unsigned int n_blocks, const size_type n_elements_per_block)
BlockIndices column_block_indices
unsigned int n_block_rows() const
Table< 2, SmartPointer< BlockType, BlockMatrixBase< SparseMatrix > > > sub_objects
unsigned int n_block_cols() const
BlockIndices row_block_indices
BlockType & block(const unsigned int row, const unsigned int column)
size_type n_block_rows() const
SparsityPatternType & block(const size_type row, const size_type column)
const BlockIndices & get_column_indices() const
size_type n_block_cols() const
const BlockIndices & get_row_indices() const
real_type l2_norm() const
std::size_t n_nonzero_elements() const
BaseClass::size_type size_type
~BlockSparseMatrix() override
TrilinosScalar residual(MPI::BlockVector &dst, const MPI::BlockVector &x, const MPI::BlockVector &b) const
MPI_Comm get_mpi_communicator() const
std::uint64_t n_nonzero_elements() const
void reinit(const size_type n_block_rows, const size_type n_block_columns)
BaseClass::BlockType BlockType
void vmult(VectorType1 &dst, const VectorType2 &src) const
real_type l2_norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcNotInitialized()
IndexSet complete_index_set(const IndexSet::size_type N)