14#ifndef CT_SKIP_DEPRECATION_WARNINGS
15#pragma message("warning: ResidEval.h and class ResidEval are deprecated and will " \
16 "be removed after Cantera 3.0.")
23const int c_GE_ZERO = 1;
24const int c_GT_ZERO = 2;
25const int c_LE_ZERO = -1;
26const int c_LT_ZERO = -2;
55 virtual void constrain(
const int k,
const int flag) {
56 m_constrain[k] = flag;
58 int constraint(
const int k)
const {
59 return getValue(m_constrain, k, c_NONE);
73 if ((
int)
m_alg.size() < (k+1)) {
79 virtual bool isAlgebraic(
const int k) {
80 return (
m_alg[k] == 1);
90 virtual int eval(
const double t,
const double*
const y,
91 const double*
const ydot,
96 virtual int evalSS(
const double t,
const double*
const y,
98 return eval(t, y, 0, r);
101 virtual int evalSimpleTD(
const double t,
const double*
const y,
102 const double*
const yold,
double deltaT,
105 vector<double> ydot(nn);
106 for (
int i = 0; i < nn; i++) {
107 ydot[i] = (y[i] - yold[i]) / deltaT;
109 return eval(t, y, ydot.data(), r);
125 double*
const ydot) {
141 const int time_step_num,
142 const double* y,
const double* ydot) {
144 writelog(
"ResidEval::writeSolution\n");
145 writelogf(
" Time = %g, ievent = %d, deltaT = %g\n", time, ievent, deltaT);
149 writelogf(
"%d %g %g\n", k, y[k], ydot[k]);
175 map<int, int> m_constrain;
An error indicating that an unimplemented function has been called.
Virtual base class for DAE residual function evaluators.
virtual int getInitialConditions(const double t0, double *const y, double *const ydot)
Fill in the initial conditions.
virtual int eval(const double t, const double *const y, const double *const ydot, double *const r)
Evaluate the residual function.
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.
virtual void setAlgebraic(const int k)
Specify that solution component k is purely algebraic - that is, the derivative of this component doe...
vector< int > m_alg
Mapping vector that stores whether a degree of freedom is a DAE or not.
virtual int nEquations() const =0
Return the number of equations in the equation system.
int nparams() const
Return the number of parameters in the calculation.
virtual void constrain(const int k, const int flag)
Constrain solution component k.
virtual void initSizes()
Initialization function.
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,...
void writelogf(const char *fmt, const Args &... args)
Write a formatted message to the screen.
void writelog(const string &fmt, const Args &... args)
Write a formatted message to the screen.
Namespace for the Cantera kernel.
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
const U & getValue(const map< T, U > &m, const T &key, const U &default_val)
Const accessor for a value in a map.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...