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>
31# define AssertPETSc(code) \
34 PetscErrorCode ierr = (code); \
35 AssertThrow(ierr == 0, ExcPETScError(ierr)); \
47 AssertPETSc(PetscObjectStateIncrease(
reinterpret_cast<PetscObject
>(v)));
53 AssertPETSc(PetscObjectStateIncrease(
reinterpret_cast<PetscObject
>(A)));
59# if DEAL_II_PETSC_VERSION_GTE(3, 14, 0)
60 return PCSetFailedReason(pc, reason);
62 pc->failedreason = reason;
70# if DEAL_II_PETSC_VERSION_GTE(3, 11, 0)
71 snes->jacobiandomainerror = PETSC_FALSE;
73 snes->domainerror = PETSC_FALSE;
79# if DEAL_II_PETSC_VERSION_GTE(3, 11, 0)
80 snes->jacobiandomainerror = PETSC_TRUE;
84 snes->reason = SNES_DIVERGED_FUNCTION_DOMAIN;
91# if DEAL_II_PETSC_VERSION_LT(3, 13, 1)
92 snes->mf = mf ? PETSC_TRUE : PETSC_FALSE;
93 snes->mf_operator = mf_operator ? PETSC_TRUE : PETSC_FALSE;
96 mf_operator ? PETSC_TRUE : PETSC_FALSE,
97 mf ? PETSC_TRUE : PETSC_FALSE));
112# if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
114 ts->max_steps = maxsteps;
123# if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
124 if (maxtime != PETSC_DEFAULT)
125 ts->max_time = maxtime;
135# if DEAL_II_PETSC_VERSION_LT(3, 8, 0)
140 return static_cast<unsigned int>(step);
146 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)