MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MMenz.cpp
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-2010 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 #include "header.h"
11 #include "ElementValueFinfo.h"
12 #include "lookupVolumeFromMesh.h"
13 #include "EnzBase.h"
14 #include "MMenz.h"
15 
16 #define EPSILON 1e-15
17 
19 {
21  // Field Definitions: Inherited from base class.
24  // Shared Msg Definitions: Inherited from base class.
27  // MsgDest Definitions: inherited
29 
30  static Dinfo< MMenz > dinfo;
31  static Cinfo mmEnzCinfo (
32  "MMenz",
34  0,
35  0,
36  &dinfo
37  );
38 
39  return &mmEnzCinfo;
40 }
42 
43 static const Cinfo* mmEnzCinfo = MMenz::initCinfo();
44 
46  dynamic_cast< const SrcFinfo2< double, double >* >(
47  mmEnzCinfo->findFinfo( "subOut" ) );
48 
50  dynamic_cast< const SrcFinfo2< double, double >* >(
51  mmEnzCinfo->findFinfo( "prdOut" ) );
52 
53 
55 // MMenz internal functions
57 
59  : Km_( 0.005 ), kcat_( 0.1 ), sub_( 0.0 ), enz_( 0.0 )
60 {
61  ;
62 }
63 
65 {;}
66 
68 // MsgDest Definitions
70 
71 
72 void MMenz::vSub( double n )
73 {
74  sub_ *= n;
75 }
76 
77 void MMenz::vEnz( double n )
78 {
79  enz_ = n;
80 }
81 
82 void MMenz::vProcess( const Eref& e, ProcPtr p )
83 {
84  double rate = kcat_ * enz_ * sub_ / ( numKm_ + sub_ );
85  subOut->send( e, 0, rate );
86  prdOut->send( e, rate, 0 );
87 
88  sub_ = 1.0;
89 }
90 
91 void MMenz::vReinit( const Eref& e, ProcPtr p )
92 {
93  sub_ = 1.0;
94  enz_ = 0.0;
95 }
96 
97 void MMenz::vRemesh( const Eref& e )
98 {
99 // cout << "MMenz::remesh for " << e << endl;
100  double volScale = convertConcToNumRateUsingMesh( e, subOut, 1 );
101  numKm_ = Km_ * volScale;
102 }
103 
105 // Field Definitions
107 
108 void MMenz::vSetKm( const Eref& enz, double v )
109 {
110  Km_ = v;
111  double volScale = convertConcToNumRateUsingMesh( enz, subOut, 1 );
112  numKm_ = v * volScale;
113 }
114 
115 double MMenz::vGetKm( const Eref& enz ) const
116 {
117  return Km_;
118 }
119 
120 void MMenz::vSetNumKm( const Eref& enz, double v )
121 {
122  double volScale = convertConcToNumRateUsingMesh( enz, subOut, 1 );
123  numKm_ = v;
124  Km_ = v / volScale;
125 }
126 
127 double MMenz::vGetNumKm( const Eref& enz ) const
128 {
129  double volScale = convertConcToNumRateUsingMesh( enz, subOut, 1 );
130  return Km_ * volScale;
131 }
132 
133 
134 void MMenz::vSetKcat( const Eref& e, double v )
135 {
136  if ( v < EPSILON )
137  v = EPSILON;
138  kcat_ = v;
139 }
140 
141 double MMenz::vGetKcat( const Eref& e ) const
142 {
143  return kcat_;
144 }
double vGetKm(const Eref &e) const
Definition: MMenz.cpp:115
void vSetKm(const Eref &e, double v)
Definition: MMenz.cpp:108
Definition: Dinfo.h:60
double vGetNumKm(const Eref &e) const
Definition: MMenz.cpp:127
static const SrcFinfo2< double, double > * subOut
Definition: MMenz.cpp:45
static const Cinfo * mmEnzCinfo
Definition: MMenz.cpp:43
static const Cinfo * initCinfo()
Definition: MMenz.cpp:18
void vProcess(const Eref &e, ProcPtr p)
Definition: MMenz.cpp:82
static const SrcFinfo2< double, double > * prdOut
Definition: MMenz.cpp:49
double numKm_
Km in Concentration units, millimolar.
Definition: MMenz.h:48
double sub_
kcat in 1/sec
Definition: MMenz.h:50
void send(const Eref &e, const T1 &arg1, const T2 &arg2) const
Definition: SrcFinfo.h:228
void vRemesh(const Eref &e)
Definition: MMenz.cpp:97
void vSetNumKm(const Eref &e, double v)
Definition: MMenz.cpp:120
Definition: Eref.h:26
#define EPSILON
Definition: MMenz.cpp:16
double convertConcToNumRateUsingMesh(const Eref &e, const SrcFinfo *pools, bool doPartialConversion)
MMenz()
Definition: MMenz.cpp:58
void vSub(double n)
Definition: MMenz.cpp:72
double enz_
State variable: substrate (in num units) * numKm.
Definition: MMenz.h:51
double vGetKcat(const Eref &e) const
Definition: MMenz.cpp:141
void vSetKcat(const Eref &e, double v)
Definition: MMenz.cpp:134
void vEnz(double n)
Definition: MMenz.cpp:77
double kcat_
Km in number units.
Definition: MMenz.h:49
double Km_
Definition: MMenz.h:47
virtual ~MMenz()
Definition: MMenz.cpp:64
void vReinit(const Eref &e, ProcPtr p)
Definition: MMenz.cpp:91
Definition: Cinfo.h:18
static const Cinfo * initCinfo()
Definition: EnzBase.cpp:33
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224