File petsc.hxx#
-
class PetscSolver : public Solver#
Public Functions
-
~PetscSolver()#
-
virtual int init() override#
Initialise the solver.
-
virtual int run() override#
Run the solver, calling monitors nout times, at intervals of tstep. This function is called by solve(), and is specific to each solver type
This should probably be protected, since it shouldn’t be called by users.
-
PetscErrorCode formFunction(Vec U, Vec F)#
Residual calculation.
-
PetscErrorCode pre(Vec x, Vec y)#
Wrapper for the preconditioner.
Private Functions
-
void updateColoring()#
Updates the coloring using Jfd.
Private Members
-
Vec state#
-
Vec u = {nullptr}#
PETSc solution vector.
-
TS ts = {nullptr}#
PETSc timestepper object.
-
SNES snes = {nullptr}#
PETSc nonlinear solver object.
-
KSP ksp = {nullptr}#
PETSc linear solver.
-
Mat Jfd = {nullptr}#
Finite Difference Jacobian.
-
bool interpolate#
Interpolate to regular times?
-
bool diagnose#
If true, print some information about current stage.
-
bool user_precon#
Use user-supplied preconditioning function?
-
int maxnl#
Maximum nonlinear iterations per SNES solve.
-
int maxf#
Maximum number of function evaluations allowed in the solver (default: 10000)
-
int maxl#
Maximum linear iterations.
-
bool matrix_free#
Use matrix free Jacobian.
-
bool matrix_free_operator#
Use matrix free Jacobian in the operator?
-
int lag_jacobian#
Re-use Jacobian.
-
bool use_coloring#
Use matrix coloring.
-
int mxstep#
Friends
-
friend PetscErrorCode PetscMonitor(TS, PetscInt, PetscReal, Vec, void *ctx)#
-
friend PetscErrorCode solver_ijacobian(TS, BoutReal, Vec, Vec, PetscReal shift, Mat J, Mat Jpre, void *ctx)#
-
friend PetscErrorCode solver_ijacobian_color(TS ts, PetscReal t, Vec U, Vec Udot, PetscReal shift, Mat J, Mat B, void *ctx)#
-
~PetscSolver()#