26 #ifndef dealii_petsc_compatibility_h
27 #define dealii_petsc_compatibility_h
33 #ifdef DEAL_II_WITH_PETSC
35 # include <petscksp.h>
36 # include <petscmat.h>
38 # include <petscsnes.h>
40 # if DEAL_II_PETSC_VERSION_LT(3, 19, 0)
41 # define PETSC_SUCCESS 0
57 const PetscErrorCode ierr =
58 PetscOptionsSetValue(
nullptr, name.c_str(), value.c_str());
73 const MatOption option_name,
74 const PetscBool option_value = PETSC_FALSE)
76 const PetscErrorCode ierr = MatSetOption(
matrix, option_name, option_value);
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertThrow(cond, exc)
@ matrix
Contents is actually a matrix.
void set_use_matrix_free(SNES snes, const bool mf_operator, const bool mf)
void set_option_value(const std::string &name, const std::string &value)
void set_keep_zero_rows(Mat &matrix)
PetscErrorCode pc_set_failed_reason(PC pc, PCFailedReason reason)
void ts_set_max_time(TS ts, const PetscReal maxtime)
void snes_reset_domain_flags(SNES snes)
void set_matrix_option(Mat &matrix, const MatOption option_name, const PetscBool option_value=PETSC_FALSE)
void snes_set_jacobian_domain_error(SNES snes)
void ts_set_max_steps(TS ts, const PetscInt maxsteps)
void petsc_increment_state_counter(Vec v)
void close_matrix(Mat &matrix)
unsigned int ts_get_step_number(TS ts)