Cantera  2.0
FuncEval.h
Go to the documentation of this file.
1 /**
2  * @file FuncEval.h
3  *
4  */
5 
6 // Copyright 2001 California Institute of Technology
7 
8 #ifndef CT_FUNCEVAL_H
9 #define CT_FUNCEVAL_H
10 
11 #include "cantera/base/ct_defs.h"
12 
13 namespace Cantera
14 {
15 
16 
17 /**
18  * Virtual base class for ODE right-hand-side function evaluators.
19  * Classes derived from FuncEval evaluate the right-hand-side function
20  * \f$ \vec{F}(t,\vec{y})\f$ in
21  * \f[
22  * \dot{\vec{y}} = \vec{F}(t,\vec{y}).
23  * \f]
24  * @ingroup odeGroup
25  */
26 class FuncEval
27 {
28 
29 public:
30 
31  FuncEval() {}
32  virtual ~FuncEval() {}
33 
34  /**
35  * Evaluate the right-hand-side function. Called by the
36  * integrator.
37  * @param t time. (input)
38  * @param y solution vector. (input)
39  * @param ydot rate of change of solution vector. (output)
40  * @param p parameter vector
41  */
42  virtual void eval(double t, double* y, double* ydot, double* p)=0;
43 
44  /**
45  * Fill the solution vector with the initial conditions
46  * at initial time t0.
47  */
48  virtual void getInitialConditions(double t0, size_t leny, double* y)=0;
49 
50  /**
51  * Number of equations.
52  */
53  virtual size_t neq()=0;
54 
55  //! Number of parameters.
56  virtual size_t nparams() {
57  return 0;
58  }
59 
60 protected:
61 
62 private:
63 
64 };
65 
66 }
67 
68 #endif