Cantera
3.0.0
|
Virtual base class for DAE residual function evaluators. More...
#include <ResidEval.h>
Virtual base class for DAE residual function evaluators.
Classes derived from ResidEval evaluate the residual function
\[ \vec{F}(t,\vec{y}, \vec{y^\prime}) \]
The DAE solver attempts to find a solution y(t) such that F = 0.
Definition at line 38 of file ResidEval.h.
Public Member Functions | |
virtual void | constrain (const int k, const int flag) |
Constrain solution component k. | |
int | constraint (const int k) const |
virtual void | initSizes () |
Initialization function. | |
virtual void | setAlgebraic (const int k) |
Specify that solution component k is purely algebraic - that is, the derivative of this component does not appear in the residual function. | |
virtual bool | isAlgebraic (const int k) |
virtual int | eval (const double t, const double *const y, const double *const ydot, double *const r) |
Evaluate the residual function. | |
virtual int | evalSS (const double t, const double *const y, double *const r) |
virtual int | evalSimpleTD (const double t, const double *const y, const double *const yold, double deltaT, double *const r) |
virtual int | getInitialConditions (const double t0, double *const y, double *const ydot) |
Fill in the initial conditions. | |
virtual int | nEquations () const =0 |
Return the number of equations in the equation system. | |
virtual void | writeSolution (int ievent, const double time, const double deltaT, const int time_step_num, const double *y, const double *ydot) |
Write out to a file or to standard output the current solution. | |
int | nparams () const |
Return the number of parameters in the calculation. | |
Protected Attributes | |
vector< int > | m_alg |
Mapping vector that stores whether a degree of freedom is a DAE or not. | |
map< int, int > | m_constrain |
|
inline |
Definition at line 41 of file ResidEval.h.
|
inlinevirtual |
Definition at line 44 of file ResidEval.h.
|
inlinevirtual |
Constrain solution component k.
Possible values for 'flag' are:
Definition at line 55 of file ResidEval.h.
|
inline |
Definition at line 58 of file ResidEval.h.
|
inlinevirtual |
Initialization function.
Definition at line 63 of file ResidEval.h.
|
inlinevirtual |
Specify that solution component k is purely algebraic - that is, the derivative of this component does not appear in the residual function.
Definition at line 72 of file ResidEval.h.
|
inlinevirtual |
Definition at line 79 of file ResidEval.h.
|
inlinevirtual |
Evaluate the residual function.
Called by the integrator.
t | time. (input) |
y | solution vector. (input) |
ydot | rate of change of solution vector. (input) |
r | residual vector (output) |
Reimplemented in ResidJacEval.
Definition at line 90 of file ResidEval.h.
|
inlinevirtual |
Definition at line 96 of file ResidEval.h.
|
inlinevirtual |
Definition at line 101 of file ResidEval.h.
|
inlinevirtual |
Fill in the initial conditions.
Values for both the solution and the value of ydot may be provided.
[in] | t0 | Time |
[out] | y | Solution vector |
[out] | ydot | Rate of change of solution vector. |
Reimplemented in ResidJacEval.
Definition at line 124 of file ResidEval.h.
|
pure virtual |
Return the number of equations in the equation system.
Implemented in ResidJacEval.
|
inlinevirtual |
Write out to a file or to standard output the current solution.
ievent is a description of the event that caused this function to be called.
Definition at line 139 of file ResidEval.h.
|
inline |
Return the number of parameters in the calculation.
This is the number of parameters in the sensitivity calculation. We have set this to zero and have included it for later expansion
Definition at line 164 of file ResidEval.h.
|
protected |
Mapping vector that stores whether a degree of freedom is a DAE or not.
The first index is the equation number. The second index is 1 if it is a DAE, and zero if it is not.
Definition at line 174 of file ResidEval.h.
|
protected |
Definition at line 175 of file ResidEval.h.