MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ReadCspace.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment,
4 ** copyright (C) 2003-2004 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _READCSPACE_H
11 #define _READCSPACE_H
12 
14 {
15  public:
16  CspaceMolInfo( char name, double conc )
17  : name_( name ), conc_( conc )
18  {
19  ;
20  }
22  : name_( 'a' ), conc_( 0.0 )
23  {
24  ;
25  }
26 
27  bool operator<( const CspaceMolInfo& other ) const
28  {
29  return ( name_ < other.name_ );
30  }
31 
32  double conc() {
33  return conc_;
34  }
35  private:
36  char name_;
37  double conc_;
38 };
39 
41 {
42  public:
43  CspaceReacInfo( const string& name, double r1, double r2 )
44  : name_( name ), r1_( r1 ), r2_( r2 )
45  {
46  ;
47  }
49  : name_( "" ), r1_( 0.1 ), r2_( 0.1 )
50  {
51  ;
52  }
53 
54  bool operator<( const CspaceReacInfo& other ) const
55  {
56  return ( name_ < other.name_ );
57  }
58 
59  string name() {
60  return name_;
61  }
62  double r1() {
63  return r1_;
64  }
65  double r2() {
66  return r2_;
67  }
68  private:
69  string name_;
70  double r1_;
71  double r2_;
72 };
73 
75 {
76  public:
77  ReadCspace();
78 
79  void printHeader();
80  void printFooter();
81 
82 
83  void printMol(Id id, double conc, double concinit, double vol);
84 
85  void printReac( Id id, double kf, double kb);
86 
87  void printEnz( Id id, Id cplx, double k1, double k2, double k3);
88 
89  Id readModelString( const string& model,
90  const string& modelname, Id pa, const string& solverClass );
91  // void setupGslRun( double plotdt );
92  void makePlots( double plotdt );
93 
94  void build( const char* name );
95  void expandEnzyme(
96  const char* name, int e, int s, int p, int p2 = 0);
97  void expandReaction( const char* name, int nm1 );
98 
99  void deployParameters();
100  void testReadModel( );
101 
102  void makeMolecule( char name );
103 
104  private:
105  static const double SCALE;
106  static const double DEFAULT_CONC;
107  static const double DEFAULT_RATE;
108  static const double DEFAULT_KM;
109  static const bool USE_PIPE;
110 
111  Id base_; // manager of model tree. A SimManager
112  Id compt_; // compartment holding model tree.
113  Id mesh_; // mesh entry below compartment
114  ostream* fout_;
115 
116  // All the molecules, in alphabetical order.
117  vector< Id > mol_;
118  vector< unsigned int > molseq_;
119  // Just a list of reactions and enzymes, in order of occurrence
120  vector< Id > reac_;
121  // All the model parameters. First are the mol concs, then rates
122  vector< double > parms_;
123  // Temporary storage for default molecular concs.
124  vector< double > molparms_;
125 
126  vector< CspaceMolInfo > mollist_;
127  vector< CspaceReacInfo > reaclist_;
128 };
129 
130 #endif // _READCSPACE_H
static const double DEFAULT_RATE
Definition: ReadCspace.h:107
string name_
Definition: ReadCspace.h:69
vector< CspaceReacInfo > reaclist_
Definition: ReadCspace.h:127
void printMol(Id id, double conc, double concinit, double vol)
Definition: ReadCspace.cpp:56
double conc_
Definition: ReadCspace.h:37
void printHeader()
Definition: ReadCspace.cpp:32
vector< Id > reac_
Definition: ReadCspace.h:120
ostream * fout_
Definition: ReadCspace.h:114
vector< double > parms_
Definition: ReadCspace.h:122
CspaceReacInfo(const string &name, double r1, double r2)
Definition: ReadCspace.h:43
bool operator<(const CspaceReacInfo &other) const
Definition: ReadCspace.h:54
vector< CspaceMolInfo > mollist_
Definition: ReadCspace.h:126
void expandEnzyme(const char *name, int e, int s, int p, int p2=0)
Definition: ReadCspace.cpp:184
double conc()
Definition: ReadCspace.h:32
static const double DEFAULT_KM
Definition: ReadCspace.h:108
void build(const char *name)
Definition: ReadCspace.cpp:253
Id readModelString(const string &model, const string &modelname, Id pa, const string &solverClass)
Definition: ReadCspace.cpp:86
void deployParameters()
Definition: ReadCspace.cpp:329
vector< Id > mol_
Definition: ReadCspace.h:117
void makeMolecule(char name)
Definition: ReadCspace.cpp:296
void makePlots(double plotdt)
Definition: ReadCspace.cpp:139
void expandReaction(const char *name, int nm1)
Definition: ReadCspace.cpp:220
void printEnz(Id id, Id cplx, double k1, double k2, double k3)
Definition: ReadCspace.cpp:78
static const bool USE_PIPE
Definition: ReadCspace.h:109
void printReac(Id id, double kf, double kb)
Definition: ReadCspace.cpp:72
static char name[]
Definition: mfield.cpp:401
bool operator<(const CspaceMolInfo &other) const
Definition: ReadCspace.h:27
double r2()
Definition: ReadCspace.h:65
void testReadModel()
Definition: ReadCspace.cpp:361
Definition: Id.h:17
void printFooter()
Definition: ReadCspace.cpp:38
static const double DEFAULT_CONC
Definition: ReadCspace.h:106
string name()
Definition: ReadCspace.h:59
CspaceMolInfo(char name, double conc)
Definition: ReadCspace.h:16
vector< unsigned int > molseq_
Definition: ReadCspace.h:118
static const double SCALE
Definition: ReadCspace.h:105
double r1()
Definition: ReadCspace.h:62
vector< double > molparms_
Definition: ReadCspace.h:124