44 virtual void eval(
double t, span<const double> y, span<double> ydot,
45 span<const double> p) {
57 virtual void evalDae(
double t, span<const double> y, span<const double> ydot,
58 span<const double> p, span<double> residual) {
77 int evalNoThrow(
double t, span<const double> y, span<double> ydot);
88 int evalDaeNoThrow(
double t, span<const double> y, span<const double> ydot,
89 span<double> residual);
177 virtual size_t neq()
const = 0;
186 m_suppress_errors = suppress;
191 return m_suppress_errors;
212 bool m_suppress_errors =
false;
Virtual base class for ODE/DAE right-hand-side function evaluators.
void suppressErrors(bool suppress)
Enable or disable suppression of errors when calling eval()
virtual void eval(double t, span< const double > y, span< double > ydot, span< const double > p)
Evaluate the right-hand-side ODE function.
virtual void getStateDae(span< double > y, span< double > ydot)
Fill in the vectors y and ydot with the current state of the system.
int evalRootFunctionsNoThrow(double t, span< const double > y, span< double > gout)
Wrapper for evalRootFunctions that converts exceptions to return codes.
vector< double > m_paramScales
Scaling factors for each sensitivity parameter.
virtual void preconditionerSolve(span< const double > rhs, span< double > output)
Evaluate the linear system Ax=b where A is the preconditioner.
void clearErrors()
Clear any previously-stored suppressed errors.
virtual void evalRootFunctions(double t, span< const double > y, span< double > gout)
Evaluate the event/root functions currently in play.
virtual void updatePreconditioner(double gamma)
Update the preconditioner based on already computed jacobian values.
bool suppressErrors() const
Get current state of error suppression.
virtual void getState(span< double > y)
Fill in the vector y with the current state of the system.
virtual size_t neq() const =0
Number of equations.
int preconditioner_setup_nothrow(double t, span< const double > y, double gamma)
Preconditioner setup that doesn't throw an error but returns a CVODES flag.
int evalNoThrow(double t, span< const double > y, span< double > ydot)
Evaluate the right-hand side using return code to indicate status.
int preconditioner_solve_nothrow(span< const double > rhs, span< double > output)
Preconditioner solve that doesn't throw an error but returns a CVODES flag.
virtual void evalDae(double t, span< const double > y, span< const double > ydot, span< const double > p, span< double > residual)
Evaluate the right-hand-side DAE function.
int evalDaeNoThrow(double t, span< const double > y, span< const double > ydot, span< double > residual)
Evaluate the right-hand side using return code to indicate status.
virtual size_t nRootFunctions() const
Number of event/root functions exposed to the integrator.
vector< string > m_errors
Errors occurring during function evaluations.
virtual void getConstraints(span< double > constraints)
Given a vector of length neq(), mark which variables should be considered algebraic constraints.
virtual size_t nparams() const
Number of sensitivity parameters.
string getErrors() const
Return a string containing the text of any suppressed errors.
virtual void preconditionerSetup(double t, span< const double > y, double gamma)
Evaluate the setup processes for the Jacobian preconditioner.
vector< double > m_sens_params
Values for the problem parameters for which sensitivities are computed This is the array which is per...
An error indicating that an unimplemented function has been called.
This file contains definitions of constants, types and terms that are used in internal routines and a...
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Namespace for the Cantera kernel.