Class CVodeIntegrator#
Defined in File Integrator.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public Karana::Math::Integrator(Class Integrator)
Class Documentation#
-
class CVodeIntegrator : public Karana::Math::Integrator#
The multistep CVode integrator from the SUNDIALS suite.
Public Types
Public Functions
-
CVodeIntegrator(size_t nstates, DerivativeFunction f, const IntegratorType &integrator_type, const IntegratorOptions *options = nullptr)#
Constructor
-
~CVodeIntegrator()#
-
inline virtual const std::string &typeString() const override#
Return the integrator type as a string.
- Returns:
the integrator type
-
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
-
virtual void updateJacobian(const Mat &mat) override#
Update the stored Jacobian matrix with the provided one.
This is currently an experimental feature - and not all integrators support the use of Jacobians.
- Parameters:
mat – the new Jacobian matrix
-
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.
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 *_cvode_mem#
-
IntegratorType _integrator_type#
The integrator type.
Protected Static Functions
-
static int _cvode_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
-
IntegratorOptions() = default#
-
inline IntegratorOptions(const IntegratorOptions &p)#
-
inline IntegratorOptions &operator=(const IntegratorOptions &p)#
-
inline virtual ~IntegratorOptions()#
Public Members
-
double rtol = 1e-4#
-
double atol = 1e-8#
-
long max_num_steps = 1e6#
-
unsigned int anderson_accel = 0#
Anderson acceleration used with the FixedPoint solver.
-
NLSOLVER nlsolver = NLSOLVER::FIXEDPOINT#
-
bool use_jacobian = false#
set to true to have the integrator use Jacobians (experimental)
-
IntegratorOptions() = default#
-
CVodeIntegrator(size_t nstates, DerivativeFunction f, const IntegratorType &integrator_type, const IntegratorOptions *options = nullptr)#