20 #ifndef dealii_petsc_compatibility_h 21 #define dealii_petsc_compatibility_h 23 #include <deal.II/base/config.h> 24 #include <deal.II/lac/exceptions.h> 26 #ifdef DEAL_II_WITH_PETSC 28 #include <petscconf.h> 35 DEAL_II_NAMESPACE_OPEN
54 const std::string &value)
56 #if DEAL_II_PETSC_VERSION_LT(3, 7, 0) 57 const PetscErrorCode ierr = PetscOptionsSetValue (name.c_str (), value.c_str ());
59 const PetscErrorCode ierr = PetscOptionsSetValue (
nullptr, name.c_str (), value.c_str ());
79 return MatDestroy (&matrix);
97 return KSPDestroy (&krylov_solver);
110 const MatOption option_name,
111 const PetscBool option_value = PETSC_FALSE)
113 const PetscErrorCode ierr = MatSetOption (matrix, option_name, option_value);
145 DEAL_II_NAMESPACE_CLOSE
147 #endif // DEAL_II_WITH_PETSC 148 #endif // dealii_petsc_compatibility_h PetscErrorCode destroy_matrix(Mat &matrix)
#define AssertThrow(cond, exc)
void set_matrix_option(Mat &matrix, const MatOption option_name, const PetscBool option_value=PETSC_FALSE)
void set_option_value(const std::string &name, const std::string &value)
PetscBool PetscBooleanType
void set_keep_zero_rows(Mat &matrix)
PetscErrorCode destroy_krylov_solver(KSP &krylov_solver)
void close_matrix(Mat &matrix)