MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MMPump.cpp
Go to the documentation of this file.
1 #include "header.h"
2 #include "MMPump.h"
3 #include "ElementValueFinfo.h"
4 #include "../utility/numutil.h"
5 #include <cmath>
6 
8 {
9  static SrcFinfo2< double,double > pumpOut( "PumpOut",
10  "Sends out MMPump parameters.");
11  return &pumpOut;
12 }
13 
15 {
16  static DestFinfo process( "process",
17  "Handles process call",
19  static DestFinfo reinit( "reinit",
20  "Reinit happens only in stage 0",
22 
23  static Finfo* processShared[] = {
24  &process, &reinit
25  };
26 
27  static SharedFinfo proc(
28  "proc",
29  "Shared message to receive Process message from scheduler",
30  processShared, sizeof( processShared ) / sizeof( Finfo* ));
31 
32 
34  // Field defs
36 
37 
38 
39  static ElementValueFinfo<MMPump, double> Vmax("Vmax",
40  "maximum pump velocity, scaled by mebrane"
41  "surface area. i.e., max ion flux in moles/sec",
44 
45  static ElementValueFinfo<MMPump, double> Kd("Kd",
46  "half-maximal activating concentration in mM",
48  &MMPump::getKd);
49 
51  // DestFinfo
53  static Finfo * difMMPumpFinfos[] = {
55  // Field definitions
57 
58 
59  &Vmax,
60  &Kd,
62  // SharedFinfo definitions
64 
65  &proc,
66  PumpOut(),
68  // DestFinfo definitions
70 
71  };
72 
73  static string doc[] = {
74  "Name", "MMPump",
75  "Author", "Subhasis Ray (ported from GENESIS2)",
76  "Description", "Models Michaelis-Menten pump. It is coupled with a DifShell.",
77  };
78  static ZeroSizeDinfo<int> dinfo;
79  static Cinfo MMPumpCinfo(
80  "MMPump",
82  difMMPumpFinfos,
83  sizeof(difMMPumpFinfos)/sizeof(Finfo*),
84  &dinfo,
85  doc,
86  sizeof(doc)/sizeof(string));
87 
88  return &MMPumpCinfo;
89 }
90 
91 static const Cinfo * MMpumpCinfo = MMPump::initCinfo();
92 
93 
95 // Class functions
97 
99 { ; }
100 
101 
102 
103 
104 double MMPump::getVmax(const Eref& e) const
105 {
106 
107  return Vmax_;
108 }
109 void MMPump::setVmax(const Eref& e,double value)
110 {
111 if ( value < 0.0 ) {
112  cerr << "Error: MMPump: Vmax cannot be negative!\n";
113  return;
114  }
115  Vmax_ = value;
116 }
117 
118 
119 double MMPump::getKd(const Eref& e) const
120 {
121  return Kd_;
122 }
123 void MMPump::setKd(const Eref& e,double value)
124 {
125 if ( value < 0.0 ) {
126  cerr << "Error: MMPump: Kd cannot be negative!\n";
127  return;
128  }
129  Kd_ = value;
130 }
131 
132 
133 void MMPump::process(const Eref& e, ProcPtr p)
134 {
135  PumpOut()->send(e,Vmax_,Kd_);
136 }
137 
138 void MMPump::reinit(const Eref& e, ProcPtr p)
139 {
140  return;
141 }
static const Cinfo * initCinfo()
Definition: MMPump.cpp:14
void setVmax(const Eref &e, double value)
Definition: MMPump.cpp:109
uint32_t value
Definition: moosemodule.h:42
void process(const Eref &e, ProcPtr p)
Definition: MMPump.cpp:133
double Kd_
Definition: MMPump.h:39
double Vmax_
Definition: MMPump.h:38
MMPump()
Definition: MMPump.cpp:98
double getKd(const Eref &e) const
Definition: MMPump.cpp:119
double getVmax(const Eref &e) const
Definition: MMPump.cpp:104
Definition: Eref.h:26
void reinit(const Eref &e, ProcPtr p)
Definition: MMPump.cpp:138
static const Cinfo * MMpumpCinfo
Definition: MMPump.cpp:91
void setKd(const Eref &e, double value)
Definition: MMPump.cpp:123
static SrcFinfo2< double, double > * PumpOut()
Definition: MMPump.cpp:7
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
Definition: Cinfo.h:18
Definition: Finfo.h:12