COPASI API  4.16.103
CLayoutEngine.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 #ifndef CLAYOUTENGINE_H
7 #define CLAYOUTENGINE_H
8 
9 #include <vector>
10 #include <sstream>
11 
12 #include "odepack++/CLSODA.h"
13 
15 
17 {
18 public:
19  struct Data
20  {
23  };
24 
26 
27  double step();
28 
29  void calcForces(std::vector<double> & state, std::vector<double> & forces);
30  void calcRHS(std::vector<double> & state, double* rhs);
31 
33  {return mpLayout;};
34 
35  // /tell the engine that a variable was changed outside
36  //void changeVar(int index, double value);
37 
38 protected:
39 
40  void stepIntegration();
41 
43 
44  unsigned int mIndex;
45 
46  std::vector<double> mVariables;
47  std::vector<double> mRhs;
48 
49  //for RK4
50  std::vector<double> mRhsA;
51  std::vector<double> mRhsB;
52  std::vector<double> mRhsC;
53  std::vector<double> mVar2;
54 
56 // std::vector<double> mVelocities;
57 // std::vector<double> mForce;
58 
60 
61  /**
62  * LSODA C_FLOAT64 work area
63  */
64  std::vector< C_FLOAT64 > mDWork;
65 
66  /**
67  * LSODA C_INT work area
68  */
69  std::vector< C_INT > mIWork;
70 
71  /**
72  * Stream to capture LSODA error messages
73  */
74  std::ostringstream mErrorMsg;
75 
76  /**
77  * LSODA state.
78  */
80 
81  /**
82  * mData.dim is the dimension of the ODE system.
83  * mData.pMethod contains CLsodaMethod * this to be used in the static method EvalF
84  */
86 
87  /**
88  * Current time.
89  */
91 
92  static void EvalF(const C_INT * n, const C_FLOAT64 * t, const C_FLOAT64 * y, C_FLOAT64 * ydot);
93 
94  /**
95  * This evaluates the derivatives
96  */
97  void evalF(const C_FLOAT64 * t, const C_FLOAT64 * y, C_FLOAT64 * ydot);
98 };
99 
100 #endif // CLAYOUTENGINE_H
#define C_INT
Definition: copasi.h:115
unsigned int mIndex
Definition: CLayoutEngine.h:44
void evalF(const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot)
std::vector< double > mRhs
Definition: CLayoutEngine.h:47
CLayoutEngine * pMethod
Definition: CLayoutEngine.h:22
std::vector< double > mRhsA
Definition: CLayoutEngine.h:50
std::vector< double > mVariables
Definition: CLayoutEngine.h:46
std::ostringstream mErrorMsg
Definition: CLayoutEngine.h:74
static void EvalF(const C_INT *n, const C_FLOAT64 *t, const C_FLOAT64 *y, C_FLOAT64 *ydot)
std::vector< C_INT > mIWork
Definition: CLayoutEngine.h:69
C_FLOAT64 mTime
Definition: CLayoutEngine.h:90
CAbstractLayoutInterface * mpLayout
Definition: CLayoutEngine.h:42
Definition: CLSODA.h:24
CAbstractLayoutInterface * getLayoutInterface()
Definition: CLayoutEngine.h:32
std::vector< C_FLOAT64 > mDWork
Definition: CLayoutEngine.h:64
void calcRHS(std::vector< double > &state, double *rhs)
#define C_FLOAT64
Definition: copasi.h:92
std::vector< double > mRhsB
Definition: CLayoutEngine.h:51
CLayoutEngine(CAbstractLayoutInterface *l, bool so)
void calcForces(std::vector< double > &state, std::vector< double > &forces)
C_INT mLsodaStatus
Definition: CLayoutEngine.h:79
std::vector< double > mVar2
Definition: CLayoutEngine.h:53
std::vector< double > mRhsC
Definition: CLayoutEngine.h:52
void stepIntegration()