6#define CT_SKIP_DEPRECATION_WARNINGS
15 warn_deprecated(
"class ResidJacEval",
"To be removed after Cantera 3.0");
28 "atol must be greater than zero");
35 for (
int i = 0; i <
neq_; i++) {
39 for (
int i = 0; i <
neq_; i++) {
47 const double deltaT,
const double* y,
53 const double* y,
const double* ydot)
67 const double*
const ySoln,
68 const double*
const ySolnDot,
69 double*
const deltaYSoln,
70 const double*
const solnWeights)
73 for (
int i = 0; i <
neq_; i++) {
74 deltaYSoln[i] =
m_atol + fabs(1.0E-6 * ySoln[i]);
77 for (
int i = 0; i <
neq_; i++) {
78 deltaYSoln[i] = std::max(1.0E-2 * solnWeights[i], 1.0E-6 * fabs(ySoln[i]));
85 const double*
const ysoln,
86 const double*
const ysolnOld,
87 double*
const ysolnScales)
89 if (ysolnScales && ysolnScales[0] == 0.0) {
90 for (
int i = 0; i <
neq_; i++) {
107 const double delta_t,
108 const double*
const y,
109 const double*
const ydot)
121 const double* y,
const double* ydot,
124 const int id_x,
const double delta_x)
132 double deltaT = -1.0;
137 double cj,
const double*
const y,
141 double*
const* jac_colPts = J.colPts();
142 return evalJacobianDP(t, delta_t, cj, y, ydot, jac_colPts, resid);
147 const double*
const y,
148 const double*
const ydot,
149 double*
const* jac_colPts,
Dense, Square (not sparse) matrices.
Base class for exceptions thrown by Cantera classes.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
An error indicating that an unimplemented function has been called.
virtual double filterNewStep(const double t, const double *const ybase, double *const step)
Filter the solution predictions.
virtual int evalTimeTrackingEqns(const double t, const double delta_t, const double *const y, const double *const ydot)
Evaluate the time tracking equations, if any.
virtual int evalResidNJ(const double t, const double delta_t, const double *const y, const double *const ydot, double *const resid, const ResidEval_Type_Enum evalType=Base_ResidEval, const int id_x=-1, const double delta_x=0.0)
Evaluate the residual function.
void setAtol(double atol)
Set a global value of the absolute tolerance.
int nEquations() const override
Return the number of equations in the equation system.
virtual void user_out(const int ifunc, const double t, const double *y, const double *ydot)
This function may be used to create output at various points in the execution of an application.
virtual int matrixConditioning(double *const matrix, const int nrows, double *const rhs)
Multiply the matrix by another matrix that leads to better conditioning.
virtual int calcDeltaSolnVariables(const double t, const double *const y, const double *const ydot, double *const delta_y, const double *const solnWeights=0)
Return a vector of delta y's for calculation of the numerical Jacobian.
virtual bool evalStoppingCritera(const double t, const double delta_t, const double *const y, const double *const ydot)
Evaluate any stopping criteria other than a final time limit.
virtual void user_out2(const int ifunc, const double t, const double delta_t, const double *const y, const double *const ydot)
This function may be used to create output at various points in the execution of an application.
ResidJacEval(double atol=1.0e-13)
Default constructor.
virtual double filterSolnPrediction(const double t, double *const y)
Filter the solution predictions.
int eval(const double t, const double *const y, const double *const ydot, double *const r) override
Evaluate the residual function.
virtual int evalJacobian(const double t, const double delta_t, double cj, const double *const y, const double *const ydot, DenseMatrix &J, double *const resid)
Calculate an analytical Jacobian and the residual at the current time and values.
int getInitialConditions(const double t0, double *const y, double *const ydot) override
Fill in the initial conditions.
int neq_
Number of equations.
double m_atol
constant value of atol
virtual void calcSolnScales(const double t, const double *const y, const double *const y_old, double *const yScales)
Returns a vector of column scale factors that can be used to column scale Jacobians.
virtual int evalJacobianDP(const double t, const double delta_t, double cj, const double *const y, const double *const ydot, double *const *jacobianColPts, double *const resid)
Calculate an analytical Jacobian and the residual at the current time and values.
This file contains definitions for utility functions and text for modules, inputfiles and logging,...
Namespace for the Cantera kernel.
ResidEval_Type_Enum
Differentiates the type of residual evaluations according to functionality.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.