23#ifndef dealii_petsc_compatibility_h
24#define dealii_petsc_compatibility_h
30#ifdef DEAL_II_WITH_PETSC
35# include <petscsnes.h>
37# if DEAL_II_PETSC_VERSION_LT(3, 19, 0)
38# define PETSC_SUCCESS 0
47#ifdef DEAL_II_WITH_PETSC
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
constexpr bool running_in_debug_mode()
#define DEAL_II_NAMESPACE_CLOSE
#define AssertThrow(cond, exc)
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)