File arkode.hxx#

class ArkodeSolver : public Solver#

Public Functions

explicit ArkodeSolver(Options *opts = nullptr)#
~ArkodeSolver()#
inline virtual BoutReal getCurrentTimestep() override#

Return the current internal timestep.

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.

BoutReal run(BoutReal tout)#
void rhs_e(BoutReal t, BoutReal *udata, BoutReal *dudata)#
void rhs_i(BoutReal t, BoutReal *udata, BoutReal *dudata)#
void rhs(BoutReal t, BoutReal *udata, BoutReal *dudata)#
void pre(BoutReal t, BoutReal gamma, BoutReal delta, BoutReal *udata, BoutReal *rvec, BoutReal *zvec)#
void jac(BoutReal t, BoutReal *ydata, BoutReal *vdata, BoutReal *Jvdata)#

Private Functions

void set_abstol_values(BoutReal *abstolvec_data, std::vector<BoutReal> &f2dtols, std::vector<BoutReal> &f3dtols)#
void loop_abstol_values_op(Ind2D i2d, BoutReal *abstolvec_data, int &p, std::vector<BoutReal> &f2dtols, std::vector<BoutReal> &f3dtols, bool bndry)#

Private Members

BoutReal hcur#
bool diagnose = {false}#
N_Vector uvec = {nullptr}#
void *arkode_mem = {nullptr}#
BoutReal pre_Wtime = {0.0}#
int pre_ncalls = {0}#
int mxsteps#

Maximum number of steps to take between outputs.

bool imex#

Use ImEx capability.

bool solve_explicit#

Solve only explicit part.

bool solve_implicit#

Solve only implicit part.

bool set_linear#

Use linear implicit solver (only evaluates jacobian inversion once)

bool fixed_step#

Solve explicit portion in fixed timestep mode. NOTE: This is not recommended except for code comparison

int order#

Order of internal step.

BoutReal cfl_frac#

Fraction of the estimated explicitly stable step to use.

int adap_method#

Set timestep adaptivity function:

  • 0: PID adaptivity (default)

  • 1: PI

  • 2: I

  • 3: explicit Gustafsson

  • 4: implicit Gustafsson

  • 5: ImEx Gustafsson

BoutReal abstol#

Absolute tolerance.

BoutReal reltol#

Relative tolerance.

bool use_vector_abstol#

Use separate absolute tolerance for each field.

BoutReal max_timestep#

Maximum timestep (only used if greater than zero)

BoutReal min_timestep#

Minimum timestep (only used if greater than zero)

BoutReal start_timestep#

Initial timestep (only used if greater than zero)

bool fixed_point#

Use accelerated fixed point solver instead of Newton iterative.

bool use_precon#

Use user-supplied preconditioner function.

int maxl#

Number of Krylov basis vectors to use.

bool rightprec#

Use right preconditioning instead of left preconditioning.

bool use_jacobian#

Use user-supplied Jacobian function.

bool optimize#

Use ARKode optimal parameters.

int nsteps = {0}#
int nfe_evals = {0}#
int nfi_evals = {0}#
int nniters = {0}#
int npevals = {0}#
int nliters = {0}#
SUNLinearSolver sun_solver = {nullptr}#

SPGMR solver structure.

SUNNonlinearSolver nonlinear_solver = {nullptr}#

Solver for functional iterations for Adams-Moulton.

sundials::Context suncontext#

Context for SUNDIALS memory allocations.