Class ArkExplicitIntegrator#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class ArkExplicitIntegrator : public Karana::Math::Integrator#

The multistep ArkODE explicit integrator from the SUNDIALS suite.

Public Types

enum class NLSOLVER#

the nonlinear solver type to use

Values:

enumerator FIXEDPOINT#
enumerator NEWTON#
enum class METHOD#

the solver type to use

Values:

enumerator HUEN_EULER#
enumerator ZONNEVELD#
enumerator CASH_KARP#
enumerator DORMAND_PRINCE#
enumerator FEHLBERG78#

Public Functions

ArkExplicitIntegrator(size_t nstates, DerivativeFunction f, const IntegratorType &integrator_type, const IntegratorOptions *options = nullptr)#

Constructor

~ArkExplicitIntegrator()#
inline virtual const std::string &typeString() const override#

Return the integrator type as a string.

Returns:

the integrator type

virtual std::unique_ptr<Integrator::IntegratorOptions> getOptions() override#

Get the options associated with the integrator.

Returns:

The options associated with the integrator.

virtual IntegratorType getIntegratorType() const override#

Get the IntegratorType for this integrator.

Returns:

The IntegratorType for this integrator.

virtual void hardReset(size_t nstates) override#

Reset the state size.

Parameters:

nstates – the new state size

virtual void softReset(const Ktime &new_t, const Vec &new_x) override#

Reset the cached time and state and to the new values going forward.

Parameters:
  • new_t – the new time

  • new_x – the new state

virtual Ktime advanceTo(const Ktime &t_end) override#

Method to advance the sytem state to a specified time.

Parameters:

to_t – the desired end time

Returns:

the actual end time

Public Members

const std::map<METHOD, ARKODE_ERKTableID> ButcherTableId{{METHOD::HUEN_EULER, ARKODE_HEUN_EULER_2_1_2}, {METHOD::ZONNEVELD, ARKODE_ZONNEVELD_5_3_4}, {METHOD::CASH_KARP, ARKODE_CASH_KARP_6_4_5}, {METHOD::DORMAND_PRINCE, ARKODE_DORMAND_PRINCE_7_4_5}, {METHOD::FEHLBERG78, ARKODE_FEHLBERG_13_7_8}}#

map with the Butcher table number (from arkode_butcher_erk.h) for the different integrator choices. The numbers are the integrator stages/embedding order/order

Protected Attributes

SUNContext _sunctx = nullptr#
N_Vector _y = nullptr#
SUNMatrix _A = nullptr#

Matrix used in the linear solver.

SUNLinearSolver _ls = nullptr#

Linear solver.

SUNNonlinearSolver _nls = nullptr#

nonLinear solver

void *_arkode_mem#
Vec _dx#

Protected Static Functions

static int _arkode_f(realtype t, N_Vector y, N_Vector ydot, void *user_data)#
struct IntegratorOptions : public Karana::Math::Integrator::IntegratorOptions#

Struct with options for this integrator

Public Functions

inline IntegratorOptions &operator=(const IntegratorOptions &p)#
inline virtual ~IntegratorOptions()#

Public Members

double rtol = 1e-4#
double atol = 1e-8#
Vec atol_vec#
long max_num_steps = 500#

Maximum number of steps the solver can take before erroring.

NLSOLVER nlsolver = NLSOLVER::FIXEDPOINT#
METHOD method = METHOD::ZONNEVELD#