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);
432 const size_type n_offdiag_nonzero_per_row = 0);
463 const std::vector<size_type> &row_lengths,
465 const std::vector<size_type> &offdiag_row_lengths =
466 std::vector<size_type>());
490 template <
typename SparsityPatternType>
492 const SparsityPatternType & sparsity_pattern,
493 const std::vector<size_type> &local_rows_per_process,
494 const std::vector<size_type> &local_columns_per_process,
495 const unsigned int this_process,
496 const bool preset_nonzero_locations =
true);
535 const size_type n_offdiag_nonzero_per_row = 0);
552 const std::vector<size_type> &row_lengths,
554 const std::vector<size_type> &offdiag_row_lengths =
555 std::vector<size_type>());
576 template <
typename SparsityPatternType>
579 const SparsityPatternType & sparsity_pattern,
580 const std::vector<size_type> &local_rows_per_process,
581 const std::vector<size_type> &local_columns_per_process,
582 const unsigned int this_process,
583 const bool preset_nonzero_locations =
true);
591 template <
typename SparsityPatternType>
595 const SparsityPatternType &sparsity_pattern,
623 <<
"The number of local rows " << arg1
624 <<
" must be larger than the total number of rows "
717 const size_type n_offdiag_nonzero_per_row = 0);
731 const std::vector<size_type> &row_lengths,
733 const std::vector<size_type> &offdiag_row_lengths =
734 std::vector<size_type>());
739 template <
typename SparsityPatternType>
741 do_reinit(
const SparsityPatternType & sparsity_pattern,
742 const std::vector<size_type> &local_rows_per_process,
743 const std::vector<size_type> &local_columns_per_process,
744 const unsigned int this_process,
745 const bool preset_nonzero_locations);
750 template <
typename SparsityPatternType>
754 const SparsityPatternType &sparsity_pattern);
SparseMatrix & operator=(const value_type d)
void copy_from(const SparseMatrix &other)
virtual const MPI_Comm & get_mpi_communicator() const override
types::global_dof_index size_type
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)
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_DEPRECATED
#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
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)
IndexSet locally_owned_range_indices() const
IndexSet locally_owned_domain_indices() const
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int global_dof_index
static const bool zero_addition_can_be_elided