16 #ifndef dealii_petsc_sparse_matrix_h 17 # define dealii_petsc_sparse_matrix_h 22 # ifdef DEAL_II_WITH_PETSC 33 template <
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>
280 do_reinit(
const SparsityPatternType &sparsity_pattern,
281 const bool preset_nonzero_locations);
400 ~SparseMatrix()
override;
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);
516 copy_from(
const SparseMatrix &other);
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,
604 reinit(
const SparseMatrix &other);
623 <<
"The number of local rows " << arg1
624 <<
" must be larger than the total number of rows " 662 locally_owned_domain_indices()
const;
670 locally_owned_range_indices()
const;
679 mmult(SparseMatrix & C,
680 const SparseMatrix &B,
692 const SparseMatrix &B,
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);
774 # endif // DEAL_II_WITH_PETSC
#define DeclException2(Exception2, type1, type2, outsequence)
PetscScalar matrix_scalar_product(const VectorBase &u, const VectorBase &v) const
virtual const MPI_Comm & get_mpi_communicator() const override
static const bool zero_addition_can_be_elided
PetscBool is_symmetric(const double tolerance=1.e-12)
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
SparseMatrix & operator=(const double d)
void reinit(const size_type m, const size_type n, const size_type n_nonzero_per_row, const bool is_symmetric=false)
#define DEAL_II_NAMESPACE_CLOSE
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
unsigned int global_dof_index
void mmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
#define DEAL_II_NAMESPACE_OPEN
PetscScalar matrix_norm_square(const VectorBase &v) const
void Tmmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
#define DEAL_II_DEPRECATED
void do_reinit(const size_type m, const size_type n, const size_type n_nonzero_per_row, const bool is_symmetric=false)