23 #ifdef DEAL_II_WITH_PETSC
25 # include <petsc/private/pcimpl.h>
26 # include <petsc/private/petscimpl.h>
27 # include <petsc/private/snesimpl.h>
28 # include <petsc/private/tsimpl.h>
32 # define AssertPETSc(code) \
35 PetscErrorCode ierr = (code); \
36 AssertThrow(ierr == 0, ExcPETScError(ierr)); \
48 AssertPETSc(PetscObjectStateIncrease(
reinterpret_cast<PetscObject
>(v)));
54 AssertPETSc(PetscObjectStateIncrease(
reinterpret_cast<PetscObject
>(
A)));
60 # if DEAL_II_PETSC_VERSION_GTE(3, 14, 0)
61 return PCSetFailedReason(pc, reason);
63 pc->failedreason = reason;
71 # if DEAL_II_PETSC_VERSION_GTE(3, 11, 0)
72 snes->jacobiandomainerror = PETSC_FALSE;
74 snes->domainerror = PETSC_FALSE;
80 # if DEAL_II_PETSC_VERSION_GTE(3, 11, 0)
81 snes->jacobiandomainerror = PETSC_TRUE;
85 snes->reason = SNES_DIVERGED_FUNCTION_DOMAIN;
92 # if DEAL_II_PETSC_VERSION_LT(3, 13, 1)
93 snes->mf = mf ? PETSC_TRUE : PETSC_FALSE;
94 snes->mf_operator = mf_operator ? PETSC_TRUE : PETSC_FALSE;
97 mf_operator ? PETSC_TRUE : PETSC_FALSE,
98 mf ? PETSC_TRUE : PETSC_FALSE));
113 # if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
115 ts->max_steps = maxsteps;
124 # if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
125 if (maxtime != PETSC_DEFAULT)
126 ts->max_time = maxtime;
142 # if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
147 return static_cast<unsigned int>(step);
153 return ts->snes ? true :
false;
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
void set_use_matrix_free(SNES snes, const bool mf_operator, const bool mf)
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 snes_set_jacobian_domain_error(SNES snes)
void ts_set_max_steps(TS ts, const PetscInt maxsteps)
void petsc_increment_state_counter(Vec v)
unsigned int ts_get_step_number(TS ts)
#define AssertPETSc(code)