Class IdaIntegrator#
Defined in File Integrator.h
Nested Relationships#
Nested Types#
Inheritance Relationships#
Base Type#
public Karana::Math::Integrator(Class Integrator)
Class Documentation#
-
class IdaIntegrator : public Karana::Math::Integrator#
IDA DAE integrator from the SUNDIALS suite
Public Types
Public Functions
-
IdaIntegrator(size_t nstates, DerivativeFunction f, const IntegratorOptions *options = nullptr)#
Constructor
-
~IdaIntegrator()#
-
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
-
void nAlgebgraic(size_t sz)#
-
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 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#
Buffers for the state and state derivative. The combine the continuous followed by the algebraic states.
-
N_Vector _ydot = nullptr#
-
N_Vector _y_id#
Buffer for the SetID. This sets which states are algebric vs differential.
-
Vec _residuals#
Buffer for residuals. This buffer is also used for initializing the setting the integrator’s “ydot” values when doing a soft reset. It is also used by the residuals callback to transfer the residual values to ida.
-
size_t _nalgebraic#
The number of algebraic states. nstates = sg.nQ() + sg.nU()
nalgebraic
-
SUNMatrix _A = nullptr#
Matrix used in the linear solver.
-
SUNLinearSolver _ls = nullptr#
Linear solver.
-
SUNNonlinearSolver _nls = nullptr#
nonLinear solver
-
void *_ida_mem#
Protected Static Functions
-
static int _ida_f(realtype t, N_Vector y, N_Vector yp, 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()#
-
IntegratorOptions() = default#
-
IdaIntegrator(size_t nstates, DerivativeFunction f, const IntegratorOptions *options = nullptr)#