Class ArkImplicitIntegrator#
Defined in File Integrator.h
Inheritance Relationships#
Base Type#
public Karana::Integrators::SundialsImplicitIntegrator(Class SundialsImplicitIntegrator)
Class Documentation#
-
class ArkImplicitIntegrator : public Karana::Integrators::SundialsImplicitIntegrator#
The (implicit) Adaptive Runge-Kutta integrator from the SUNDIALS suite.
Public Functions
-
ArkImplicitIntegrator(const IntegratorType &integrator_type, size_t nstates, DerivativeFunction f, const ArkImplicitIntegrator::IntegratorOptions *options = nullptr)#
Constructor for implicit arkode integrator.
Struct with options for this integrator
- Parameters:
nstates – The number of states to integrate.
f – The derivative function to calculate the derivative of the states.
integrator_type – The type of cvode integrator to use.
options – The integrator options.
-
virtual ~ArkImplicitIntegrator()#
-
virtual const kc::ks_ptr<Integrator::IntegratorOptions> getOptions() const override#
Get the options associated with the integrator.
- Returns:
The options associated with the integrator.
-
virtual km::Vec getErrorContributions() const override#
Get the error contribution for each state.
- Returns:
A vector with the error contribution for each state.
Public Members
-
const std::map<IntegratorType, ARKODE_DIRKTableID> butcher_table_id{{IntegratorType::ARKIMPLICIT_SDIRK12, ARKODE_SDIRK_2_1_2}, {IntegratorType::ARKIMPLICIT_DIRK23, ARKODE_ARK324L2SA_DIRK_4_2_3}, {IntegratorType::ARKIMPLICIT_SDIRK34, ARKODE_SDIRK_5_3_4}, {IntegratorType::ARKIMPLICIT, ARKODE_SDIRK_5_3_4}, {IntegratorType::ARKIMPLICIT_ESDIRK45, ARKODE_ARK548L2SA_DIRK_8_4_5}}#
- for the different integrator choices. The numbers are the integrator stages/embedding order/order
map with the Butcher table number (from arkode_butcher_ark.h)
Public Static Functions
-
static kc::ks_ptr<ArkImplicitIntegrator> create(const IntegratorType &integrator_type, size_t nstates, DerivativeFunction deriv_fn, const ArkImplicitIntegrator::IntegratorOptions *options = nullptr)#
Factory method for creating ArkImplicitIntegrator instances.
- Parameters:
integrator_type – the type of integrator to create
nstates – the length of the states vector
deriv_fn – the derivative function
options – options for the integrator
- Returns:
a new Arkode Integrator instance
Protected Functions
-
virtual void _initialize() final#
Initialize the implementation-specific data structures.
-
virtual void _freeMemory() final#
Free all memory, both common and implementation-specific. Must call _freeCommonMemory() to clear shared data structures.
-
virtual void _applyTolerances() final#
Copy tolerances from internal options into implementation data structures.
-
virtual void _reInit() final#
Reinitialize internal implementation state for a soft reset.
-
virtual void _advanceTo(double t_end) final#
Advances implementation to a target time; called by parent class.
- Parameters:
t_end –
-
virtual void _bindSolvers() final#
Bind internal nonlinear (and possibly linear) solvers to the implementation solver.
Protected Attributes
-
void *_arkode_mem#
Memory used by the arkode integrator.
-
kc::ks_ptr<ArkImplicitIntegrator::IntegratorOptions> _opts#
Arkode-specific integrator options.
-
ArkImplicitIntegrator(const IntegratorType &integrator_type, size_t nstates, DerivativeFunction f, const ArkImplicitIntegrator::IntegratorOptions *options = nullptr)#