8#ifndef CT_CVODESWRAPPER_H
9#define CT_CVODESWRAPPER_H
15#include "sundials/sundials_nvector.h"
35 virtual void setTolerances(
double reltol,
size_t n,
double* abstol);
40 virtual void reinitialize(
double t0,
FuncEval& func);
42 virtual doublereal
step(
double tout);
45 virtual double*
derivative(
double tout,
int n);
48 return static_cast<int>(m_neq);
50 virtual int nEvals()
const;
60 virtual void setBandwidth(
int N_Upper,
int N_Lower) {
64 virtual int nSensParams() {
65 return static_cast<int>(m_np);
67 virtual double sensitivity(
size_t k,
size_t p);
84 void sensInit(
double t0,
FuncEval& func);
94 N_Vector m_y, m_abstol;
102 double m_reltolsens, m_abstolsens;
104 double m_hmax, m_hmin;
106 int m_maxErrTestFails;
109 int m_mupper, m_mlower;
Wrapper class for 'cvodes' integrator from LLNL.
virtual int nEvals() const
The number of function evaluations.
virtual int lastOrder() const
Order used during the last solution step.
virtual void setMinStepSize(double hmin)
Set the minimum step size.
void * m_linsol
Sundials linear solver object.
std::string m_error_message
Error message information provide by CVodes.
CVodesIntegrator()
Constructor.
double m_time
The current integrator time.
bool m_sens_ok
Indicates whether the sensitivities stored in m_yS have been updated for at the current integrator ti...
virtual void initialize(double t0, FuncEval &func)
Initialize the integrator for a new problem.
SundialsContext m_sundials_ctx
SUNContext object for Sundials>=6.0.
virtual void integrate(double tout)
Integrate the system of equations.
virtual void setMaxSteps(int nmax)
Set the maximum number of time-steps the integrator can take before reaching the next output time.
virtual doublereal step(double tout)
Integrate the system of equations.
virtual void setSensitivityTolerances(double reltol, double abstol)
Set the sensitivity error tolerances.
virtual double * solution()
The current value of the solution of the system of equations.
virtual void setTolerances(double reltol, size_t n, double *abstol)
Set error tolerances.
virtual int maxSteps()
Returns the maximum number of time-steps the integrator can take before reaching the next output time...
virtual void setMaxStepSize(double hmax)
Set the maximum step size.
void applyOptions()
Applies user-specified options to the underlying CVODES solver.
virtual int nEquations() const
The number of equations.
virtual double * derivative(double tout, int n)
n-th derivative of the output function at time tout.
virtual void setProblemType(int probtype)
Set the problem type.
virtual void setMethod(MethodType t)
Set the solution method.
void * m_linsol_matrix
matrix used by Sundials
virtual void setMaxErrTestFails(int n)
Set the maximum permissible number of error test failures.
virtual std::string getErrorInfo(int N)
Returns a string listing the weighted error estimates associated with each solution component.
virtual void setMaxOrder(int n)
Set the maximum integration order that will be used.
Virtual base class for ODE right-hand-side function evaluators.
Abstract base class for ODE system integrators.
A wrapper for managing a SUNContext object, need for Sundials >= 6.0.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
Namespace for the Cantera kernel.
MethodType
Specifies the method used to integrate the system of equations.