IdasIntegrator.cpp Source File#
IdasIntegrator.cpp
Go to the documentation of this file.
Header file for class IdasIntegrator.
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Virtual base class for ODE/DAE right-hand-side function evaluators.
Definition FuncEval.h:32
virtual void getStateDae(double *y, double *ydot)
Fill in the vectors y and ydot with the current state of the system.
Definition FuncEval.h:148
vector< double > m_paramScales
Scaling factors for each sensitivity parameter.
Definition FuncEval.h:184
int evalDaeNoThrow(double t, double *y, double *ydot, double *residual)
Evaluate the right-hand side using return code to indicate status.
Definition FuncEval.cpp:39
virtual void getConstraints(double *constraints)
Given a vector of length neq(), mark which variables should be considered algebraic constraints.
Definition FuncEval.h:63
string getErrors() const
Return a string containing the text of any suppressed errors.
Definition FuncEval.cpp:71
vector< double > m_sens_params
Values for the problem parameters for which sensitivities are computed This is the array which is per...
Definition FuncEval.h:181
double step(double tout) override
Integrate the system of equations.
Definition IdasIntegrator.cpp:482
void setMaxStepSize(double hmax) override
Set the maximum step size.
Definition IdasIntegrator.cpp:137
double * solution() override
The current value of the solution of the system of equations.
Definition IdasIntegrator.cpp:88
int m_maxNonlinConvFails
Maximum number of nonlinear convergence failures.
Definition IdasIntegrator.h:157
void checkError(long flag, const string &ctMethod, const string &idaMethod) const
Check whether an IDAS method indicated an error.
Definition IdasIntegrator.cpp:548
size_t m_nabs
! Number of variables for which absolute tolerances were provided
Definition IdasIntegrator.h:131
void setMaxOrder(int n) override
Set the maximum integration order that will be used.
Definition IdasIntegrator.cpp:128
int m_maxNonlinIters
Maximum number of nonlinear solver iterations at one solution.
Definition IdasIntegrator.h:154
bool m_sens_ok
Indicates whether the sensitivities stored in m_yS and m_ySdot have been updated for the current inte...
Definition IdasIntegrator.h:148
int maxSteps() override
Returns the maximum number of time-steps the integrator can take before reaching the next output time...
Definition IdasIntegrator.cpp:154
int m_itol
Flag indicating whether scalar (IDA_SS) or vector (IDA_SV) absolute tolerances are being used.
Definition IdasIntegrator.h:122
int m_maxErrTestFails
Maximum number of error test failures in attempting one step.
Definition IdasIntegrator.h:139
void setSensitivityTolerances(double reltol, double abstol) override
Set the sensitivity error tolerances.
Definition IdasIntegrator.cpp:116
void applyOptions()
Applies user-specified options to the underlying IDAS solver.
Definition IdasIntegrator.cpp:324
void integrate(double tout) override
Integrate the system of equations.
Definition IdasIntegrator.cpp:445
void setTolerances(double reltol, size_t n, double *abstol) override
Set error tolerances.
Definition IdasIntegrator.cpp:93
void setLinearSolverType(const string &linearSolverType) override
Set the linear solver type.
Definition IdasIntegrator.cpp:123
void setMaxErrTestFails(int n) override
Set the maximum permissible number of error test failures.
Definition IdasIntegrator.cpp:159
void setMaxSteps(int nmax) override
Set the maximum number of time-steps the integrator can take before reaching the next output time.
Definition IdasIntegrator.cpp:146
AnyMap solverStats() const override
Get solver stats from integrator.
Definition IdasIntegrator.cpp:167
double m_tInteg
The latest time reached by the integrator. May be greater than m_time.
Definition IdasIntegrator.h:113
void initialize(double t0, FuncEval &func) override
Initialize the integrator for a new problem.
Definition IdasIntegrator.cpp:218
int m_maxsteps
Maximum number of internal steps taken in a call to integrate()
Definition IdasIntegrator.h:136
string getErrorInfo(int N)
Returns a string listing the weighted error estimates associated with each solution component.
Definition IdasIntegrator.cpp:524
bool m_setSuppressAlg
If true, the algebraic variables don't contribute to error tolerances.
Definition IdasIntegrator.h:160
virtual string linearSolverType() const
Return the integrator problem type.
Definition Integrator.h:131
A wrapper for managing a SUNContext object, need for Sundials >= 6.0.
Definition SundialsContext.h:20
void fmt_append(fmt::memory_buffer &b, Args... args)
Versions 6.2.0 and 6.2.1 of fmtlib do not include this define before they include windows....
Definition fmt.h:29
static void ida_err(int error_code, const char *module, const char *function, char *msg, void *eh_data)
Function called by IDA when an error is encountered instead of writing to stdout.
Definition IdasIntegrator.cpp:49
static int ida_rhs(realtype t, N_Vector y, N_Vector ydot, N_Vector r, void *f_data)
Function called by IDA to evaluate the residual, given y and ydot.
Definition IdasIntegrator.cpp:40
Contains declarations for string manipulation functions within Cantera.
Generated by