16 #ifndef dealii__petsc_parallel_sparse_matrix_h 17 #define dealii__petsc_parallel_sparse_matrix_h 19 #include <deal.II/base/config.h> 21 #ifdef DEAL_II_WITH_PETSC 23 # include <deal.II/lac/exceptions.h> 24 # include <deal.II/lac/petsc_matrix_base.h> 25 # include <deal.II/lac/petsc_parallel_vector.h> 28 DEAL_II_NAMESPACE_OPEN
178 const size_type local_rows,
179 const size_type local_columns,
180 const size_type n_nonzero_per_row,
182 const size_type n_offdiag_nonzero_per_row = 0);
207 const size_type local_rows,
208 const size_type local_columns,
209 const std::vector<size_type> &row_lengths,
211 const std::vector<size_type> &offdiag_row_lengths = std::vector<size_type>());
235 template <
typename SparsityPatternType>
237 const SparsityPatternType &sparsity_pattern,
238 const std::vector<size_type> &local_rows_per_process,
239 const std::vector<size_type> &local_columns_per_process,
240 const unsigned int this_process,
241 const bool preset_nonzero_locations =
true);
266 void reinit (
const MPI_Comm &communicator,
269 const size_type local_rows,
270 const size_type local_columns,
271 const size_type n_nonzero_per_row,
273 const size_type n_offdiag_nonzero_per_row = 0);
280 void reinit (
const MPI_Comm &communicator,
283 const size_type local_rows,
284 const size_type local_columns,
285 const std::vector<size_type> &row_lengths,
287 const std::vector<size_type> &offdiag_row_lengths = std::vector<size_type>());
308 template <
typename SparsityPatternType>
309 void reinit (
const MPI_Comm &communicator,
310 const SparsityPatternType &sparsity_pattern,
311 const std::vector<size_type> &local_rows_per_process,
312 const std::vector<size_type> &local_columns_per_process,
313 const unsigned int this_process,
314 const bool preset_nonzero_locations =
true);
322 template <
typename SparsityPatternType>
325 const SparsityPatternType &sparsity_pattern,
326 const MPI_Comm &communicator);
350 <<
"The number of local rows " << arg1
351 <<
" must be larger than the total number of rows " << arg2);
409 const size_type local_rows,
410 const size_type local_columns,
411 const size_type n_nonzero_per_row,
413 const size_type n_offdiag_nonzero_per_row = 0);
420 const size_type local_rows,
421 const size_type local_columns,
422 const std::vector<size_type> &row_lengths,
424 const std::vector<size_type> &offdiag_row_lengths = std::vector<size_type>());
429 template <
typename SparsityPatternType>
430 void do_reinit (
const SparsityPatternType &sparsity_pattern,
431 const std::vector<size_type> &local_rows_per_process,
432 const std::vector<size_type> &local_columns_per_process,
433 const unsigned int this_process,
434 const bool preset_nonzero_locations);
439 template <
typename SparsityPatternType>
442 const SparsityPatternType &sparsity_pattern);
463 DEAL_II_NAMESPACE_CLOSE
465 #endif // DEAL_II_WITH_PETSC static::ExceptionBase & ExcLocalRowsTooLarge(int arg1, int arg2)
#define DeclException2(Exception2, type1, type2, outsequence)
virtual const MPI_Comm & get_mpi_communicator() const
void copy_from(const SparseMatrix &other)
IndexSet locally_owned_domain_indices() const
void do_reinit(const size_type m, const size_type n, const size_type local_rows, const size_type local_columns, const size_type n_nonzero_per_row, const bool is_symmetric=false, const size_type n_offdiag_nonzero_per_row=0)
types::global_dof_index size_type
PetscScalar matrix_scalar_product(const Vector &u, const Vector &v) const
static const bool zero_addition_can_be_elided
SparseMatrix & operator=(const value_type d)
unsigned int global_dof_index
void reinit(const MPI_Comm &communicator, const size_type m, const size_type n, const size_type local_rows, const size_type local_columns, const size_type n_nonzero_per_row, const bool is_symmetric=false, const size_type n_offdiag_nonzero_per_row=0)
PetscBooleanType is_symmetric(const double tolerance=1.e-12)
IndexSet locally_owned_range_indices() const
PetscScalar matrix_norm_square(const Vector &v) const