19 const int c_GE_ZERO = 1;
20 const int c_GT_ZERO = 2;
21 const int c_LE_ZERO = -1;
22 const int c_LT_ZERO = -2;
48 virtual void constrain(
const int k,
const int flag) {
49 m_constrain[k] = flag;
51 int constraint(
const int k)
const {
52 std::map<int,int>::const_iterator i = m_constrain.find(k);
53 if (i != m_constrain.end()) {
71 if ((
int)
m_alg.size() < (k+1)) {
77 virtual bool isAlgebraic(
const int k) {
78 return (
m_alg[k] == 1);
90 virtual int eval(
const doublereal t,
const doublereal*
const y,
91 const doublereal*
const ydot,
92 doublereal*
const r) {
93 throw CanteraError(
"ResidEval::eval()",
"base class called");
96 virtual int evalSS(
const doublereal t,
const doublereal*
const y,
97 doublereal*
const r) {
98 return eval(t, y, 0, r);
101 virtual int evalSimpleTD(
const doublereal t,
const doublereal*
const y,
102 const doublereal*
const yold, doublereal deltaT,
103 doublereal*
const r) {
106 for (
int i = 0; i < nn; i++) {
107 ydot[i] = (y[i] - yold[i]) / deltaT;
119 doublereal*
const ydot) {
121 throw CanteraError(
"ResidEval::GetInitialConditions()",
"base class called");
136 const int time_step_num,
137 const double* y,
const double* ydot) {
139 printf(
"ResidEval::writeSolution\n");
140 printf(
" Time = %g, ievent = %d, deltaT = %g\n", time, ievent, deltaT);
142 printf(
" k y[] ydot[]\n");
144 printf(
"%d %g %g\n", k, y[k], ydot[k]);
149 printf(
"%d %g \n", k, y[k]);
171 std::map<int, int> m_constrain;