16#ifndef dealii_petsc_sparse_matrix_h
17# define dealii_petsc_sparse_matrix_h
22# ifdef DEAL_II_WITH_PETSC
33template <
typename MatrixType>
112 const std::vector<size_type> &row_lengths,
132 template <
typename SparsityPatternType>
133 explicit SparseMatrix(
const SparsityPatternType &sparsity_pattern,
134 const bool preset_nonzero_locations =
true);
178 const std::vector<size_type> &row_lengths,
206 template <
typename SparsityPatternType>
208 reinit(
const SparsityPatternType &sparsity_pattern,
209 const bool preset_nonzero_locations =
true);
272 const std::vector<size_type> &row_lengths,
278 template <
typename SparsityPatternType>
281 const bool preset_nonzero_locations);
424 template <
typename SparsityPatternType>
426 const SparsityPatternType & sparsity_pattern,
427 const std::vector<size_type> &local_rows_per_process,
428 const std::vector<size_type> &local_columns_per_process,
429 const unsigned int this_process,
430 const bool preset_nonzero_locations =
true);
471 template <
typename SparsityPatternType>
474 const SparsityPatternType & sparsity_pattern,
475 const std::vector<size_type> &local_rows_per_process,
476 const std::vector<size_type> &local_columns_per_process,
477 const unsigned int this_process,
478 const bool preset_nonzero_locations =
true);
486 template <
typename SparsityPatternType>
490 const SparsityPatternType &sparsity_pattern,
518 <<
"The number of local rows " << arg1
519 <<
" must be larger than the total number of rows "
599 template <
typename SparsityPatternType>
601 do_reinit(
const SparsityPatternType & sparsity_pattern,
602 const std::vector<size_type> &local_rows_per_process,
603 const std::vector<size_type> &local_columns_per_process,
604 const unsigned int this_process,
605 const bool preset_nonzero_locations);
610 template <
typename SparsityPatternType>
614 const SparsityPatternType &sparsity_pattern);
SparseMatrix & operator=(const value_type d)
void copy_from(const SparseMatrix &other)
void reinit(const MPI_Comm &communicator, const SparsityPatternType &sparsity_pattern, const std::vector< size_type > &local_rows_per_process, const std::vector< size_type > &local_columns_per_process, const unsigned int this_process, const bool preset_nonzero_locations=true)
virtual const MPI_Comm & get_mpi_communicator() const override
PetscBool is_symmetric(const double tolerance=1.e-12)
void mmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
void do_reinit(const size_type m, const size_type n, const size_type n_nonzero_per_row, const bool is_symmetric=false)
virtual const MPI_Comm & get_mpi_communicator() const override
void Tmmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
void reinit(const size_type m, const size_type n, const size_type n_nonzero_per_row, const bool is_symmetric=false)
SparseMatrix(const SparseMatrix &)=delete
SparseMatrix & operator=(const SparseMatrix &)=delete
SparseMatrix & operator=(const double d)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
void mmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
PetscScalar matrix_scalar_product(const Vector &u, const Vector &v) const
void Tmmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
static ::ExceptionBase & ExcLocalRowsTooLarge(int arg1, int arg2)
static const bool zero_addition_can_be_elided
#define DeclException2(Exception2, type1, type2, outsequence)
PetscScalar matrix_norm_square(const Vector &v) const
IndexSet locally_owned_range_indices() const
IndexSet locally_owned_domain_indices() const
void do_reinit(const SparsityPatternType &sparsity_pattern, const std::vector< size_type > &local_rows_per_process, const std::vector< size_type > &local_columns_per_process, const unsigned int this_process, const bool preset_nonzero_locations)
unsigned int global_dof_index
static const bool zero_addition_can_be_elided