20 #ifndef dealii_petsc_compatibility_h
21 #define dealii_petsc_compatibility_h
23 #include <deal.II/base/config.h>
25 #include <deal.II/lac/exceptions.h>
27 #ifdef DEAL_II_WITH_PETSC
29 # include <petscconf.h>
30 # include <petscksp.h>
31 # include <petscmat.h>
36 DEAL_II_NAMESPACE_OPEN
48 # if DEAL_II_PETSC_VERSION_LT(3, 7, 0)
49 const PetscErrorCode ierr =
50 PetscOptionsSetValue(name.c_str(), value.c_str());
52 const PetscErrorCode ierr =
53 PetscOptionsSetValue(
nullptr, name.c_str(), value.c_str());
74 return MatDestroy(&matrix);
93 return KSPDestroy(&krylov_solver);
107 const MatOption option_name,
108 const PetscBool option_value = PETSC_FALSE)
110 const PetscErrorCode ierr = MatSetOption(matrix, option_name, option_value);
144 DEAL_II_NAMESPACE_CLOSE
146 #endif // DEAL_II_WITH_PETSC
147 #endif // dealii_petsc_compatibility_h