13 ResidJacEval::ResidJacEval(doublereal atol) :
28 "atol must be greater than zero");
33 doublereal*
const ydot)
35 for (
int i = 0; i <
neq_; i++) {
39 for (
int i = 0; i <
neq_; i++) {
47 const doublereal deltaT,
const doublereal* y,
48 const doublereal* ydot)
53 const doublereal* y,
const doublereal* ydot)
59 const doublereal delta_t,
61 const doublereal* ydot)
67 const doublereal*
const ySoln,
68 const doublereal*
const ySolnDot,
69 doublereal*
const deltaYSoln,
70 const doublereal*
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 doublereal*
const ysoln,
86 const doublereal*
const ysolnOld,
87 doublereal*
const ysolnScales)
89 if (ysolnScales && ysolnScales[0] == 0.0) {
90 for (
int i = 0; i <
neq_; i++) {
107 const doublereal delta_t,
108 const doublereal*
const y,
109 const doublereal*
const ydot)
115 doublereal*
const rhs)
121 const doublereal* y,
const doublereal* ydot,
122 doublereal*
const resid,
124 const int id_x,
const doublereal delta_x)
126 throw CanteraError(
"ResidJacEval::evalResidNJ()",
"Not implemented\n");
133 double deltaT = -1.0;
138 doublereal cj,
const doublereal*
const y,
140 doublereal*
const resid)
142 doublereal*
const* jac_colPts = J.colPts();
143 return evalJacobianDP(t, delta_t, cj, y, ydot, jac_colPts, resid);
147 const doublereal c_j,
148 const doublereal*
const y,
149 const doublereal*
const ydot,
150 doublereal*
const* jac_colPts,
151 doublereal*
const resid)
153 throw CanteraError(
"ResidJacEval::evalJacobianDP()",
"Not implemented\n");
virtual int evalJacobianDP(const doublereal t, const doublereal delta_t, doublereal cj, const doublereal *const y, const doublereal *const ydot, doublereal *const *jacobianColPts, doublereal *const resid)
Calculate an analytical Jacobian and the residual at the current time and values. ...
virtual void user_out2(const int ifunc, const doublereal t, const doublereal delta_t, const doublereal *const y, const doublereal *const ydot)
This function may be used to create output at various points in the execution of an application...
virtual int evalResidNJ(const doublereal t, const doublereal delta_t, const doublereal *const y, const doublereal *const ydot, doublereal *const resid, const ResidEval_Type_Enum evalType=Base_ResidEval, const int id_x=-1, const doublereal delta_x=0.0)
Evaluate the residual function.
int neq_
Number of equations.
virtual int eval(const doublereal t, const doublereal *const y, const doublereal *const ydot, doublereal *const r)
Evaluate the residual function.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
virtual int getInitialConditions(const doublereal t0, doublereal *const y, doublereal *const ydot)
Fill in the initial conditions.
virtual void user_out(const int ifunc, const doublereal t, const doublereal *y, const doublereal *ydot)
This function may be used to create output at various points in the execution of an application...
ResidEval_Type_Enum
Differentiates the type of residual evaluations according to functionality.
virtual int nEquations() const
Return the number of equations in the equation system.
virtual int calcDeltaSolnVariables(const doublereal t, const doublereal *const y, const doublereal *const ydot, doublereal *const delta_y, const doublereal *const solnWeights=0)
Return a vector of delta y's for calculation of the numerical Jacobian.
virtual int matrixConditioning(doublereal *const matrix, const int nrows, doublereal *const rhs)
Multiply the matrix by another matrix that leads to better conditioning.
virtual int evalJacobian(const doublereal t, const doublereal delta_t, doublereal cj, const doublereal *const y, const doublereal *const ydot, DenseMatrix &J, doublereal *const resid)
Calculate an analytical Jacobian and the residual at the current time and values. ...
Dense, Square (not sparse) matrices.
doublereal m_atol
constant value of atol
Base class for exceptions thrown by Cantera classes.
virtual int evalTimeTrackingEqns(const doublereal t, const doublereal delta_t, const doublereal *const y, const doublereal *const ydot)
Evaluate the time tracking equations, if any.
virtual void calcSolnScales(const doublereal t, const doublereal *const y, const doublereal *const y_old, doublereal *const yScales)
Returns a vector of column scale factors that can be used to column scale Jacobians.
virtual doublereal filterSolnPrediction(const doublereal t, doublereal *const y)
Filter the solution predictions.
Namespace for the Cantera kernel.
virtual bool evalStoppingCritera(const doublereal t, const doublereal delta_t, const doublereal *const y, const doublereal *const ydot)
Evaluate any stopping criteria other than a final time limit.
void setAtol(doublereal atol)
Set a global value of the absolute tolerance.
virtual doublereal filterNewStep(const doublereal t, const doublereal *const ybase, doublereal *const step)
Filter the solution predictions.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...