File petsc.hxx¶
Defines
-
OPT_SIZE¶
Functions
-
PetscErrorCode PetscMonitor(TS, PetscInt, PetscReal, Vec, void *ctx)
Monitor function called on every internal timestep.
-
PetscErrorCode PetscSNESMonitor(SNES, PetscInt, PetscReal, void *ctx)
Monitor function for SNES.
-
PetscErrorCode solver_ijacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat*, Mat*, MatStructure*, void*)¶
Compute IJacobian = dF/dU + a dF/dUdot - a dummy matrix used for pc=none.
Variables
-
BoutReal simtime
-
struct snes_info¶
- #include <petsc.hxx>
Data for SNES.
-
class PetscSolver : public Solver¶
Public Functions
-
~PetscSolver()¶
-
virtual int init(int NOUT, BoutReal TIMESTEP) override¶
Initialise the solver NOTE: nout and tstep should be passed to run, not init. Needed because of how the PETSc TS code works
-
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 rhs(TS ts, PetscReal t, Vec globalin, Vec globalout)¶
Wrapper for the RHS function.
-
PetscErrorCode pre(PC pc, Vec x, Vec y)¶
Wrapper for the preconditioner.
-
PetscErrorCode jac(Vec x, Vec y)¶
Wrapper for the Jacobian function.
Private Members
-
Vec state¶
-
Vec u¶
PETSc solution vector.
-
TS ts¶
PETSc timestepper object.
-
Mat J¶
-
Mat Jmf¶
RHS Jacobian.
-
MatFDColoring matfdcoloring¶
-
int nout¶
The number of outputs.
-
bool diagnose¶
If true, print some information about current stage.
-
PetscBool interpolate¶
Whether to interpolate or not.
-
char output_name[PETSC_MAX_PATH_LEN]¶
-
PetscBool output_flag¶
-
PetscInt prev_linear_its¶
-
bool adaptive¶
Use adaptive timestepping.
Friends
-
friend PetscErrorCode PetscMonitor(TS, PetscInt, PetscReal, Vec, void *ctx)¶
Monitor function called on every internal timestep.
-
friend PetscErrorCode PetscSNESMonitor(SNES, PetscInt, PetscReal, void *ctx)¶
Monitor function for SNES.
-
friend PetscErrorCode solver_ijacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat*, Mat*, MatStructure*, void*)¶
Compute IJacobian = dF/dU + a dF/dUdot - a dummy matrix used for pc=none.
-
~PetscSolver()¶