MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DifBufferBase.cpp
Go to the documentation of this file.
1 #include "header.h"
2 #include "DifBufferBase.h"
3 #include "ElementValueFinfo.h"
4 #include "../utility/numutil.h"
5 #include <cmath>
6 
8 {
10  "reactionOut",
11  "Sends out reaction rates (forward and backward), and concentrations"
12  " (free-buffer and bound-buffer molecules).");
13  return &reactionOut;
14 }
15 
16 
18  static SrcFinfo2< double, double > sourceOut("innerDifSourceOut",
19  "Sends out source information.");
20  return &sourceOut;
21 }
22 
24  static SrcFinfo2< double, double > sourceOut("outerDifSourceOut",
25  "Sends out source information.");
26  return &sourceOut;
27 }
28 
30 {
31  static DestFinfo process( "process",
32  "Handles process call",
34  static DestFinfo reinit( "reinit",
35  "Reinit happens only in stage 0",
37 
38  static Finfo* processShared[] = {
39  &process,
40  &reinit
41  };
42 
43  static SharedFinfo proc(
44  "proc",
45  "Here we create 2 shared finfos to attach with the Ticks. This is because we want to perform DifBufferBase "
46  "computations in 2 stages, much as in the Compartment object. "
47  "In the first stage we send out the concentration value to other DifBufferBases and Buffer elements. We also",
48  processShared,
49  sizeof( processShared ) / sizeof( Finfo* ));
50 
51  static DestFinfo concentration("concentration",
52  "Receives concentration (from DifShell).",
54  static Finfo* bufferShared[] = {
55  &concentration, DifBufferBase::reactionOut()
56  };
57  static SharedFinfo buffer( "buffer",
58  "This is a shared message with DifShell. "
59  "During stage 0:\n "
60  " - DifBufferBase sends ion concentration\n"
61  " - Buffer updates buffer concentration and sends it back immediately using a call-back.\n"
62  " - DifShell updates the time-derivative ( dC / dt ) \n"
63  "\n"
64  "During stage 1: \n"
65  " - DifShell advances concentration C \n\n"
66  "This scheme means that the Buffer does not need to be scheduled, and it does its computations when "
67  "it receives a cue from the DifShell. May not be the best idea, but it saves us from doing the above "
68  "computations in 3 stages instead of 2." ,
69  bufferShared,
70  sizeof( bufferShared ) / sizeof( Finfo* ));
71 
72  static DestFinfo fluxFromOut( "fluxFromOut",
73  "Destination message",
75 
76  static Finfo* innerDifShared[] = {
77  &fluxFromOut,
79 
80  };
81 
82  static SharedFinfo innerDif( "innerDif",
83  "This shared message (and the next) is between DifBufferBases: adjoining shells exchange information to "
84  "find out the flux between them. "
85  "Using this message, an inner shell sends to, and receives from its outer shell." ,
86  innerDifShared,
87  sizeof( innerDifShared ) / sizeof( Finfo* ));
88 
89  static DestFinfo fluxFromIn( "fluxFromIn", "",
91 
92  static Finfo* outerDifShared[] = {
93  &fluxFromIn,
95 
96  };
97 
98  static SharedFinfo outerDif( "outerDif",
99  "Using this message, an outer shell sends to, and receives from its inner shell." ,
100  outerDifShared,
101  sizeof( outerDifShared ) / sizeof( Finfo* ));
102 
104  // Field defs
106  static ElementValueFinfo<DifBufferBase, double> activation("activation",
107  "Ion concentration from incoming conc message.",
111  "Forward rate constant of buffer molecules 1/mM/s (?)",
115  "Backward rate constant of buffer molecules. 1/s",
119  "Diffusion constant of buffer molecules. m^2/s",
122  static ElementValueFinfo<DifBufferBase, double> bFree("bFree",
123  "Free buffer concentration",
126  static ElementValueFinfo<DifBufferBase, double> bBound("bBound",
127  "Bound buffer concentration",
130  static ElementValueFinfo<DifBufferBase, double> bTot("bTot",
131  "Total buffer concentration.",
134  static ElementValueFinfo<DifBufferBase, double> length("length",
135  "Length of shell",
138  static ElementValueFinfo<DifBufferBase, double> diameter("diameter",
139  "Diameter of shell",
142  static ElementValueFinfo<DifBufferBase, unsigned int> shapeMode("shapeMode",
143  "shape of the shell: SHELL=0, SLICE=SLAB=1, USERDEF=3",
146 
147  static ElementValueFinfo<DifBufferBase, double> thickness("thickness",
148  "Thickness of shell",
151 
152  static ElementValueFinfo<DifBufferBase, double> innerArea("innerArea",
153  "Inner area of shell",
156  static ElementValueFinfo<DifBufferBase, double> outerArea("outerArea",
157  "Outer area of shell",
160  static ElementValueFinfo< DifBufferBase, double> volume( "volume", "",
163 
165  // DestFinfo
167  static Finfo * difBufferFinfos[] = {
169  // Field definitions
171 
172  &activation,
173  &D,
174  &bFree,
175  &bBound,
176  &bTot,
177  &kf,
178  &kb,
179  //&prevFree,
180  //&prevBound,
181  &length,
182  &diameter,
183  &shapeMode,
184  &thickness,
185  &innerArea,
186  &outerArea,
187  &volume,
189  // SharedFinfo definitions
191  &proc,
192  &buffer,
193  &innerDif,
194  &outerDif,
195  //
196  reactionOut(),
200  // DestFinfo definitions
202  &concentration,
203  };
204 
205  static string doc[] = {
206  "Name", "DifBufferBase",
207  "Author", "Subhasis Ray (ported from GENESIS2)",
208  "Description", "Models diffusible buffer where total concentration is constant. It is"
209  " coupled with a DifShell.",
210  };
211  static ZeroSizeDinfo<int> dinfo;
212  static Cinfo difBufferCinfo(
213  "DifBufferBase",
215  difBufferFinfos,
216  sizeof(difBufferFinfos)/sizeof(Finfo*),
217  &dinfo,
218  doc,
219  sizeof(doc)/sizeof(string));
220 
221  return &difBufferCinfo;
222 }
223 
225 
226 
228 // Class functions
230 
232 { ; }
233 
234 
235 double DifBufferBase::getActivation(const Eref& e) const
236 {
237  return vGetActivation(e);
238 }
239 
241 {
242  vSetActivation(e,value);
243 }
244 
245 
246 double DifBufferBase::getBFree(const Eref& e) const
247 {
248  return vGetBFree(e);
249 }
250 
251 void DifBufferBase::setBFree(const Eref& e,double value)
252 {
253  vSetBFree(e,value);
254 }
255 
256 double DifBufferBase::getBBound(const Eref& e) const
257 {
258  return vGetBBound(e);
259 }
260 void DifBufferBase::setBBound(const Eref& e,double value)
261 {
262  vSetBBound(e,value);
263 }
264 
265 double DifBufferBase::getBTot(const Eref& e) const
266 {
267  return vGetBTot(e);
268 }
269 
270 void DifBufferBase::setBTot(const Eref& e,double value)
271 {
272  vSetBTot(e,value);
273 }
274 
275 
276 double DifBufferBase::getKf(const Eref& e) const
277 {
278  return vGetKf(e);
279 }
280 
281 void DifBufferBase::setKf(const Eref& e,double value)
282 {
283  vSetKf(e,value);
284 }
285 
286 double DifBufferBase::getKb(const Eref& e) const
287 {
288  return vGetKb(e);
289 }
290 
291 void DifBufferBase::setKb(const Eref& e,double value)
292 {
293  vSetKb(e,value);
294 }
295 
296 double DifBufferBase::getD(const Eref& e) const
297 {
298  return vGetD(e);
299 }
300 
301 void DifBufferBase::setD(const Eref& e,double value)
302 {
303  vSetD(e,value);
304 }
305 
306 void DifBufferBase::setShapeMode(const Eref& e, unsigned int shapeMode )
307 {
308  vSetShapeMode(e,shapeMode);
309 }
310 
311 unsigned int DifBufferBase::getShapeMode(const Eref& e) const
312 {
313  return vGetShapeMode(e);
314 }
315 
316 void DifBufferBase::setLength(const Eref& e, double length )
317 {
318  vSetLength(e,length);
319 }
320 
321 double DifBufferBase::getLength(const Eref& e ) const
322 {
323  return vGetLength(e);
324 }
325 
326 void DifBufferBase::setDiameter(const Eref& e, double diameter )
327 {
328  vSetDiameter(e,diameter);
329 }
330 
331 double DifBufferBase::getDiameter(const Eref& e ) const
332 {
333  return vGetDiameter(e);
334 }
335 
336 void DifBufferBase::setThickness( const Eref& e, double thickness )
337 {
338  vSetThickness(e,thickness);
339 }
340 
341 double DifBufferBase::getThickness(const Eref& e) const
342 {
343  return vGetThickness(e);
344 }
345 
346 void DifBufferBase::setVolume(const Eref& e, double volume )
347 {
348  vSetVolume(e,volume);
349 }
350 
351 double DifBufferBase::getVolume(const Eref& e ) const
352 {
353  return vGetVolume(e);
354 }
355 
356 void DifBufferBase::setOuterArea(const Eref& e, double outerArea )
357 {
358  vSetOuterArea(e,outerArea);
359 }
360 
361 double DifBufferBase::getOuterArea(const Eref& e ) const
362 {
363  return vGetOuterArea(e);
364 }
365 
366 void DifBufferBase::setInnerArea(const Eref& e, double innerArea )
367 {
368  vSetInnerArea(e,innerArea);
369 }
370 
371 double DifBufferBase::getInnerArea(const Eref& e) const
372 {
373  return vGetInnerArea(e);
374 }
375 
376 
377 
378 void DifBufferBase::buffer(const Eref& e,double C)
379 {
380  vBuffer(e,C);
381 }
382 
383 void DifBufferBase::reinit( const Eref& e, ProcPtr p )
384 {
385  vReinit( e, p );
386 }
387 
389 {
390  vProcess( e, p );
391 }
392 void DifBufferBase:: fluxFromOut(const Eref& e,double outerC, double outerThickness )
393 {
394  vFluxFromOut(e,outerC,outerThickness);
395 }
396 void DifBufferBase:: fluxFromIn(const Eref& e,double innerC, double innerThickness )
397 {
398  vFluxFromIn(e,innerC,innerThickness);
399 }
virtual double vGetActivation(const Eref &e) const =0
static const Cinfo * initCinfo()
virtual void vReinit(const Eref &e, ProcPtr p)=0
uint32_t value
Definition: moosemodule.h:42
void setBBound(const Eref &e, double value)
void fluxFromOut(const Eref &e, double outerC, double outerThickness)
virtual void vSetKb(const Eref &e, double value)=0
double getVolume(const Eref &e) const
virtual double vGetD(const Eref &e) const =0
virtual void vSetThickness(const Eref &e, double thickness)=0
static const Cinfo * difBufferCinfo
double getD(const Eref &e) const
virtual void vSetActivation(const Eref &e, double value)=0
double getThickness(const Eref &e) const
double getKb(const Eref &e) const
Definition: EpFunc.h:64
void setDiameter(const Eref &e, double value)
virtual double vGetBFree(const Eref &e) const =0
void fluxFromIn(const Eref &e, double innerC, double innerThickness)
virtual double vGetKf(const Eref &e) const =0
static SrcFinfo4< double, double, double, double > * reactionOut()
virtual double vGetInnerArea(const Eref &e) const =0
void setKf(const Eref &e, double value)
virtual double vGetOuterArea(const Eref &e) const =0
double getLength(const Eref &e) const
virtual void vSetBFree(const Eref &e, double value)=0
virtual double vGetBTot(const Eref &e) const =0
virtual void vFluxFromOut(const Eref &e, double outerC, double outerThickness)=0
static SrcFinfo2< double, double > * outerDifSourceOut()
virtual void vSetOuterArea(const Eref &e, double outerArea)=0
virtual void vSetBBound(const Eref &e, double value)=0
virtual double vGetKb(const Eref &e) const =0
void setShapeMode(const Eref &e, unsigned int value)
void setInnerArea(const Eref &e, double innerArea)
virtual void vBuffer(const Eref &e, double C)=0
double getBFree(const Eref &e) const
double getInnerArea(const Eref &e) const
virtual void vSetBTot(const Eref &e, double value)=0
virtual void vSetVolume(const Eref &e, double volume)=0
virtual double vGetThickness(const Eref &e) const =0
virtual void vProcess(const Eref &e, ProcPtr p)=0
void setVolume(const Eref &e, double volume)
unsigned int getShapeMode(const Eref &e) const
virtual void vFluxFromIn(const Eref &e, double innerC, double innerThickness)=0
virtual void vSetKf(const Eref &e, double value)=0
virtual double vGetDiameter(const Eref &e) const =0
Definition: Eref.h:26
void process(const Eref &e, ProcPtr p)
double getOuterArea(const Eref &e) const
virtual double vGetVolume(const Eref &e) const =0
void setOuterArea(const Eref &e, double outerArea)
virtual void vSetDiameter(const Eref &e, double diameter)=0
void reinit(const Eref &e, ProcPtr p)
double getBTot(const Eref &e) const
void setThickness(const Eref &e, double value)
void setD(const Eref &e, double value)
void setActivation(const Eref &e, double value)
void setKb(const Eref &e, double value)
double getBBound(const Eref &e) const
virtual double vGetLength(const Eref &e) const =0
double getActivation(const Eref &e) const
double getDiameter(const Eref &e) const
static SrcFinfo2< double, double > * innerDifSourceOut()
virtual double vGetBBound(const Eref &e) const =0
virtual void vSetShapeMode(const Eref &e, unsigned int shapeMode)=0
virtual void vSetInnerArea(const Eref &e, double innerArea)=0
virtual void vSetD(const Eref &e, double value)=0
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
virtual void vSetLength(const Eref &e, double length)=0
void buffer(const Eref &e, double C)
void setLength(const Eref &e, double value)
double getKf(const Eref &e) const
Definition: Cinfo.h:18
void setBTot(const Eref &e, double value)
void setBFree(const Eref &e, double value)
Definition: EpFunc.h:79
virtual unsigned int vGetShapeMode(const Eref &e) const =0
Definition: Finfo.h:12