MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
moose::CompartmentBase Class Referenceabstract

#include <CompartmentBase.h>

+ Inheritance diagram for moose::CompartmentBase:
+ Collaboration diagram for moose::CompartmentBase:

Public Member Functions

void cable ()
 
 CompartmentBase ()
 
void displace (double dx, double dy, double dz)
 Displaces compartment by specified distance vector. More...
 
double getCm (const Eref &e) const
 
double getDiameter () const
 
double getEm (const Eref &e) const
 
double getIm (const Eref &e) const
 
double getInitVm (const Eref &e) const
 
double getInject (const Eref &e) const
 
double getLength () const
 
double getRa (const Eref &e) const
 
double getRm (const Eref &e) const
 
double getVm (const Eref &e) const
 
double getX () const
 
double getX0 () const
 
double getY () const
 
double getY0 () const
 
double getZ () const
 
double getZ0 () const
 
void handleAxial (double Vm)
 
void handleChannel (const Eref &e, double Gk, double Ek)
 
void handleRaxial (double Ra, double Vm)
 
void initProc (const Eref &e, ProcPtr p)
 
void initReinit (const Eref &e, ProcPtr p)
 
void injectMsg (const Eref &e, double current)
 
void process (const Eref &e, ProcPtr p)
 
void randInject (const Eref &e, double prob, double current)
 
bool rangeWarning (const string &field, double value)
 
void reinit (const Eref &e, ProcPtr p)
 
void setCm (const Eref &e, double Cm)
 
void setDiameter (double diameter)
 
void setEm (const Eref &e, double Em)
 
void setGeomAndElec (const Eref &e, double length, double dia)
 Scales electrical values along with setting length, dia. More...
 
void setInitVm (const Eref &e, double initVm)
 
void setInject (const Eref &e, double Inject)
 
void setLength (double length)
 
void setRa (const Eref &e, double Ra)
 
void setRm (const Eref &e, double Rm)
 
void setVm (const Eref &e, double Vm)
 
void setX (double value)
 
void setX0 (double value)
 
void setY (double value)
 
void setY0 (double value)
 
void setZ (double value)
 
void setZ0 (double value)
 
void updateLength ()
 
virtual double vGetCm (const Eref &e) const =0
 
virtual double vGetEm (const Eref &e) const =0
 
virtual double vGetIm (const Eref &e) const =0
 
virtual double vGetInitVm (const Eref &e) const =0
 
virtual double vGetInject (const Eref &e) const =0
 
virtual double vGetRa (const Eref &e) const =0
 
virtual double vGetRm (const Eref &e) const =0
 
virtual double vGetVm (const Eref &e) const =0
 
virtual void vHandleAxial (double Vm)=0
 
virtual void vHandleChannel (const Eref &e, double Gk, double Ek)=0
 
virtual void vHandleRaxial (double Ra, double Vm)=0
 
virtual void vInitProc (const Eref &e, ProcPtr p)=0
 
virtual void vInitReinit (const Eref &e, ProcPtr p)=0
 
virtual void vInjectMsg (const Eref &e, double current)=0
 
virtual void vProcess (const Eref &e, ProcPtr p)=0
 
virtual void vRandInject (const Eref &e, double prob, double current)=0
 
virtual void vReinit (const Eref &e, ProcPtr p)=0
 
virtual void vSetCm (const Eref &e, double Cm)=0
 
virtual void vSetEm (const Eref &e, double Em)=0
 
virtual void vSetInitVm (const Eref &e, double initVm)=0
 
virtual void vSetInject (const Eref &e, double Inject)=0
 
virtual void vSetRa (const Eref &e, double Ra)=0
 
virtual void vSetRm (const Eref &e, double Rm)=0
 
virtual void vSetSolver (const Eref &e, Id hsolve)
 
virtual void vSetVm (const Eref &e, double Vm)=0
 
virtual ~CompartmentBase ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
static SrcFinfo1< double > * VmOut ()
 
static void zombify (Element *orig, const Cinfo *zClass, Id hsolve)
 

Private Attributes

double diameter_
 
double length_
 
double x0_
 
double x_
 
double y0_
 
double y_
 
double z0_
 
double z_
 

Detailed Description

Definition at line 30 of file CompartmentBase.h.

Constructor & Destructor Documentation

CompartmentBase::CompartmentBase ( )

Definition at line 364 of file CompartmentBase.cpp.

References diameter_, length_, x0_, x_, y0_, y_, z0_, and z_.

365 {
366  x_ = 0.0;
367  y_ = 0.0;
368  z_ = 0.0;
369  x0_ = 0.0;
370  y0_ = 0.0;
371  z0_ = 0.0;
372  diameter_ = 0.0;
373  length_ = 0.0;
374 }
CompartmentBase::~CompartmentBase ( )
virtual

Definition at line 376 of file CompartmentBase.cpp.

377 {
378  ;
379 }

Member Function Documentation

void CompartmentBase::cable ( )

Dummy function to act as recipient of 'cable' message, which is just for grouping compartments.

Definition at line 623 of file CompartmentBase.cpp.

Referenced by initCinfo().

624 {
625  ;
626 }

+ Here is the caller graph for this function:

void CompartmentBase::displace ( double  dx,
double  dy,
double  dz 
)

Displaces compartment by specified distance vector.

Definition at line 628 of file CompartmentBase.cpp.

References x0_, x_, y0_, y_, z0_, and z_.

Referenced by initCinfo().

629 {
630  x0_ += dx;
631  x_ += dx;
632  y0_ += dy;
633  y_ += dy;
634  z0_ += dz;
635  z_ += dz;
636 }

+ Here is the caller graph for this function:

double CompartmentBase::getCm ( const Eref e) const

Definition at line 420 of file CompartmentBase.cpp.

References vGetCm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

421 {
422  return vGetCm( e );
423 }
virtual double vGetCm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getDiameter ( ) const

Definition at line 477 of file CompartmentBase.cpp.

References diameter_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

478 {
479  return diameter_;
480 }

+ Here is the caller graph for this function:

double CompartmentBase::getEm ( const Eref e) const

Definition at line 409 of file CompartmentBase.cpp.

References vGetEm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

410 {
411  return vGetEm( e );
412 }
virtual double vGetEm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getIm ( const Eref e) const

Definition at line 447 of file CompartmentBase.cpp.

References vGetIm().

Referenced by initCinfo().

448 {
449  return vGetIm( e );
450 }
virtual double vGetIm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getInitVm ( const Eref e) const

Definition at line 467 of file CompartmentBase.cpp.

References vGetInitVm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

468 {
469  return vGetInitVm( e );
470 }
virtual double vGetInitVm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getInject ( const Eref e) const

Definition at line 457 of file CompartmentBase.cpp.

References vGetInject().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

458 {
459  return vGetInject( e );
460 }
virtual double vGetInject(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getLength ( ) const

Definition at line 497 of file CompartmentBase.cpp.

References length_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

498 {
499  return length_;
500 }

+ Here is the caller graph for this function:

double CompartmentBase::getRa ( const Eref e) const

Definition at line 442 of file CompartmentBase.cpp.

References vGetRa().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

443 {
444  return vGetRa( e );
445 }
virtual double vGetRa(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getRm ( const Eref e) const

Definition at line 431 of file CompartmentBase.cpp.

References vGetRm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

432 {
433  return vGetRm( e );
434 }
virtual double vGetRm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getVm ( const Eref e) const

Definition at line 399 of file CompartmentBase.cpp.

References vGetVm().

Referenced by initCinfo().

400 {
401  return vGetVm( e );
402 }
virtual double vGetVm(const Eref &e) const =0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double CompartmentBase::getX ( ) const

Definition at line 547 of file CompartmentBase.cpp.

References x_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

548 {
549  return x_;
550 }

+ Here is the caller graph for this function:

double CompartmentBase::getX0 ( ) const

Definition at line 514 of file CompartmentBase.cpp.

References x0_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

515 {
516  return x0_;
517 }

+ Here is the caller graph for this function:

double CompartmentBase::getY ( ) const

Definition at line 558 of file CompartmentBase.cpp.

References y_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

559 {
560  return y_;
561 }

+ Here is the caller graph for this function:

double CompartmentBase::getY0 ( ) const

Definition at line 525 of file CompartmentBase.cpp.

References y0_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

526 {
527  return y0_;
528 }

+ Here is the caller graph for this function:

double CompartmentBase::getZ ( ) const

Definition at line 569 of file CompartmentBase.cpp.

References z_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

570 {
571  return z_;
572 }

+ Here is the caller graph for this function:

double CompartmentBase::getZ0 ( ) const

Definition at line 536 of file CompartmentBase.cpp.

References z0_.

Referenced by initCinfo(), and moose::CompartmentDataHolder::readData().

537 {
538  return z0_;
539 }

+ Here is the caller graph for this function:

void CompartmentBase::handleAxial ( double  Vm)

handleAxial handles incoming axial message data.

Definition at line 608 of file CompartmentBase.cpp.

References vHandleAxial().

Referenced by initCinfo().

609 {
610  vHandleAxial( Vm );
611 }
virtual void vHandleAxial(double Vm)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::handleChannel ( const Eref e,
double  Gk,
double  Ek 
)

handleChannel handles information coming from the channel to the compartment

Definition at line 598 of file CompartmentBase.cpp.

References vHandleChannel().

Referenced by initCinfo().

599 {
600  vHandleChannel( e, Gk, Ek );
601 }
virtual void vHandleChannel(const Eref &e, double Gk, double Ek)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::handleRaxial ( double  Ra,
double  Vm 
)

handleRaxial handles incoming raxial message data.

Definition at line 603 of file CompartmentBase.cpp.

References vHandleRaxial().

Referenced by initCinfo().

604 {
605  vHandleRaxial( Ra, Vm );
606 }
virtual void vHandleRaxial(double Ra, double Vm)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * CompartmentBase::initCinfo ( )
static

Initializes the class info.

The initCinfo() function sets up the CompartmentBase class. This function uses the common trick of having an internal static value which is created the first time the function is called. There are several static arrays set up here. The ones which use SharedFinfos are for shared messages where multiple kinds of information go along the same connection.

Definition at line 59 of file CompartmentBase.cpp.

References axialOut(), cable(), compartmentCinfo, displace(), getCm(), getDiameter(), getEm(), getIm(), getInitVm(), getInject(), getLength(), getRa(), getRm(), getVm(), getX(), getX0(), getY(), getY0(), getZ(), getZ0(), handleAxial(), handleChannel(), handleRaxial(), init(), Neutral::initCinfo(), initProc(), initReinit(), injectMsg(), process(), randInject(), raxialOut(), reinit(), setCm(), setDiameter(), setEm(), setGeomAndElec(), setInitVm(), setInject(), setLength(), setRa(), setRm(), setVm(), setX(), setX0(), setY(), setY0(), setZ(), setZ0(), and VmOut().

Referenced by moose::Compartment::initCinfo(), and ZombieCompartment::initCinfo().

60 {
62  // Shared messages
64  static DestFinfo process( "process",
65  "Handles 'process' call",
67 
68  static DestFinfo reinit( "reinit",
69  "Handles 'reinit' call",
71 
72  static Finfo* processShared[] =
73  {
74  &process, &reinit
75  };
76 
77  static SharedFinfo proc( "proc",
78  "This is a shared message to receive Process messages from the scheduler"
79  "objects. The Process should be called _second_ in each clock tick, after the Init message."
80  "The first entry in the shared msg is a MsgDest "
81  "for the Process operation. It has a single argument, "
82  "ProcInfo, which holds lots of information about current "
83  "time, thread, dt and so on. The second entry is a MsgDest "
84  "for the Reinit operation. It also uses ProcInfo. "
85  "- Handles 'reinit' and 'process' calls.",
86  processShared, sizeof( processShared ) / sizeof( Finfo* )
87  );
89 
90  static DestFinfo initProc( "initProc",
91  "Handles Process call for the 'init' phase of the CompartmentBase "
92  "calculations. These occur as a separate Tick cycle from the "
93  "regular proc cycle, and should be called before the proc msg.",
95  static DestFinfo initReinit( "initReinit",
96  "Handles Reinit call for the 'init' phase of the CompartmentBase "
97  "calculations.",
99  static Finfo* initShared[] =
100  {
102  };
103 
104  static SharedFinfo init( "init",
105  "This is a shared message to receive Init messages from "
106  "the scheduler objects. Its job is to separate the "
107  "compartmental calculations from the message passing. "
108  "It doesn't really need to be shared, as it does not use "
109  "the reinit part, but the scheduler objects expect this "
110  "form of message for all scheduled output. The first "
111  "entry is a MsgDest for the Process operation. It has a "
112  "single argument, ProcInfo, which holds lots of "
113  "information about current time, thread, dt and so on. "
114  "The second entry is a dummy MsgDest for the Reinit "
115  "operation. It also uses ProcInfo. "
116  "- Handles 'initProc' and 'initReinit' calls.",
117  initShared, sizeof( initShared ) / sizeof( Finfo* )
118  );
119 
121 
122  static DestFinfo handleChannel( "handleChannel",
123  "Handles conductance and Reversal potential arguments from Channel",
125  // VmOut is declared above as it needs to be in scope for later funcs.
126 
127  static Finfo* channelShared[] =
128  {
130  };
131  static SharedFinfo channel( "channel",
132  "This is a shared message from a compartment to channels. "
133  "The first entry is a MsgDest for the info coming from "
134  "the channel. It expects Gk and Ek from the channel "
135  "as args. The second entry is a MsgSrc sending Vm "
136  "- Handles 'handleChannel' and 'VmOut' calls.",
137  channelShared, sizeof( channelShared ) / sizeof( Finfo* )
138  );
140  // axialOut declared above as it is needed in file scope
141  static DestFinfo handleRaxial( "handleRaxial",
142  "Handles Raxial info: arguments are Ra and Vm.",
145  );
146 
147  static Finfo* axialShared[] =
148  {
150  };
151  static SharedFinfo axial( "axial",
152  "This is a shared message between asymmetric compartments. "
153  "axial messages (this kind) connect up to raxial "
154  "messages (defined below). The soma should use raxial "
155  "messages to connect to the axial message of all the "
156  "immediately adjacent dendritic compartments.This puts "
157  "the (low) somatic resistance in series with these "
158  "dendrites. Dendrites should then use raxial messages to"
159  "connect on to more distal dendrites. In other words, "
160  "raxial messages should face outward from the soma. "
161  "The first entry is a MsgSrc sending Vm to the axialFunc"
162  "of the target compartment. The second entry is a MsgDest "
163  "for the info coming from the other compt. It expects "
164  "Ra and Vm from the other compt as args. Note that the "
165  "message is named after the source type. "
166  "- Handles 'axialOut' and 'handleRaxial' calls.",
167  axialShared, sizeof( axialShared ) / sizeof( Finfo* )
168  );
169 
171  static DestFinfo handleAxial( "handleAxial",
172  "Handles Axial information. Argument is just Vm.",
174  // rxialOut declared above as it is needed in file scope
175  static Finfo* raxialShared[] =
176  {
178  };
179  static SharedFinfo raxial( "raxial",
180  "This is a raxial shared message between asymmetric compartments. The \n"
181  "first entry is a MsgDest for the info coming from the other compt. It \n"
182  "expects Vm from the other compt as an arg. The second is a MsgSrc sending \n"
183  "Ra and Vm to the raxialFunc of the target compartment. \n"
184  "- Handles 'handleAxial' and 'raxialOut' calls.",
185  raxialShared, sizeof( raxialShared ) / sizeof( Finfo* )
186  );
188  // Value Finfos.
190 
192  "membrane potential",
195  );
197  "Membrane capacitance",
200  );
202  "Resting membrane potential",
205  );
207  "Current going through membrane",
209  );
210  static ElementValueFinfo< CompartmentBase, double > inject( "inject",
211  "Current injection to deliver into compartment",
214  );
215  static ElementValueFinfo< CompartmentBase, double > initVm( "initVm",
216  "Initial value for membrane potential",
219  );
221  "Membrane resistance",
224  );
226  "Axial resistance of compartment",
229  );
230  static ValueFinfo< CompartmentBase, double > diameter( "diameter",
231  "Diameter of compartment",
234  );
235  static ValueFinfo< CompartmentBase, double > length( "length",
236  "Length of compartment",
239  );
241  "X coordinate of start of compartment",
244  );
246  "Y coordinate of start of compartment",
249  );
251  "Z coordinate of start of compartment",
254  );
256  "x coordinate of end of compartment",
259  );
261  "y coordinate of end of compartment",
264  );
266  "z coordinate of end of compartment",
269  );
270 
272  // DestFinfo definitions
274  static DestFinfo injectMsg( "injectMsg",
275  "The injectMsg corresponds to the INJECT message in the "
276  "GENESIS compartment. Unlike the 'inject' field, any value "
277  "assigned by handleInject applies only for a single timestep."
278  "So it needs to be updated every dt for a steady (or varying)"
279  "injection current",
281  );
282 
283  static DestFinfo randInject( "randInject",
284  "Sends a random injection current to the compartment. Must be"
285  "updated each timestep."
286  "Arguments to randInject are probability and current.",
289 
290  static DestFinfo cable( "cable",
291  "Message for organizing compartments into groups, called"
292  "cables. Doesn't do anything.",
294  );
295  static DestFinfo displace( "displace",
296  "Displaces compartment by specified vector",
299  );
300  static DestFinfo setGeomAndElec( "setGeomAndElec",
301  "Assigns length and dia and accounts for any electrical "
302  "scaling needed as a result.",
305  );
307  static Finfo* compartmentFinfos[] =
308  {
309  &Vm, // Value
310  &Cm, // Value
311  &Em, // Value
312  &Im, // ReadOnlyValue
313  &inject, // Value
314  &initVm, // Value
315  &Rm, // Value
316  &Ra, // Value
317  &diameter, // Value
318  &length, // Value
319  &x0, // Value
320  &y0, // Value
321  &z0, // Value
322  &x, // Value
323  &y, // Value
324  &z, // Value
325  &injectMsg, // DestFinfo
326  &randInject, // DestFinfo
327  &injectMsg, // DestFinfo
328  &cable, // DestFinfo
329  &displace, // DestFinfo
330  &setGeomAndElec, // DestFinfo
331  &proc, // SharedFinfo
332  &init, // SharedFinfo
333  &channel, // SharedFinfo
334  &axial, // SharedFinfo
335  &raxial // SharedFinfo
336  };
337 
338  static string doc[] =
339  {
340  "Name", "CompartmentBase",
341  "Author", "Upi Bhalla",
342  "Description", "CompartmentBase object, for branching neuron models.",
343  };
344  static ZeroSizeDinfo< int > dinfo;
345  static Cinfo compartmentCinfo(
346  "CompartmentBase",
348  compartmentFinfos,
349  sizeof( compartmentFinfos ) / sizeof( Finfo* ),
350  &dinfo,
351  doc,
352  sizeof(doc)/sizeof(string)
353  );
354 
355  return &compartmentCinfo;
356 }
Id init(int argc, char **argv, bool &doUnitTests, bool &doRegressionTests, unsigned int &benchmark)
Definition: main.cpp:150
void setX(double value)
double getVm(const Eref &e) const
void setVm(const Eref &e, double Vm)
void process(const Eref &e, ProcPtr p)
double getInject(const Eref &e) const
void setZ(double value)
double getEm(const Eref &e) const
Definition: OpFunc.h:56
void handleRaxial(double Ra, double Vm)
Definition: EpFunc.h:64
double getDiameter() const
void setLength(double length)
static const Cinfo * compartmentCinfo
Definition: Compartment.cpp:53
void randInject(const Eref &e, double prob, double current)
Definition: OpFunc.h:40
double getCm(const Eref &e) const
void setInitVm(const Eref &e, double initVm)
void setEm(const Eref &e, double Em)
void setGeomAndElec(const Eref &e, double length, double dia)
Scales electrical values along with setting length, dia.
double getInitVm(const Eref &e) const
void handleChannel(const Eref &e, double Gk, double Ek)
void initReinit(const Eref &e, ProcPtr p)
void initProc(const Eref &e, ProcPtr p)
void setCm(const Eref &e, double Cm)
double getIm(const Eref &e) const
Definition: OpFunc.h:27
void displace(double dx, double dy, double dz)
Displaces compartment by specified distance vector.
void setInject(const Eref &e, double Inject)
void handleAxial(double Vm)
void setZ0(double value)
static SrcFinfo1< double > * VmOut()
double getRa(const Eref &e) const
static SrcFinfo2< double, double > * raxialOut()
static SrcFinfo1< double > * axialOut()
void setDiameter(double diameter)
void reinit(const Eref &e, ProcPtr p)
Definition: OpFunc.h:13
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void injectMsg(const Eref &e, double current)
void setRa(const Eref &e, double Ra)
void setX0(double value)
double getRm(const Eref &e) const
Definition: Cinfo.h:18
void setRm(const Eref &e, double Rm)
Definition: EpFunc.h:79
void setY0(double value)
Definition: Finfo.h:12
void setY(double value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::initProc ( const Eref e,
ProcPtr  p 
)

The initProc function is for a second phase of 'process' operations. It sends the axial and raxial messages to other compartments. It has to be executed out of phase with the main process so that all compartments are equivalent and there is no calling order dependence in the results.

Definition at line 588 of file CompartmentBase.cpp.

References vInitProc().

Referenced by initCinfo().

589 {
590  vInitProc( e, p );
591 }
virtual void vInitProc(const Eref &e, ProcPtr p)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::initReinit ( const Eref e,
ProcPtr  p 
)

Empty function to do another reinit step out of phase with the main one. Nothing needs doing there.

Definition at line 593 of file CompartmentBase.cpp.

References vInitReinit().

Referenced by initCinfo().

594 {
595  vInitReinit( e, p );
596 }
virtual void vInitReinit(const Eref &e, ProcPtr p)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::injectMsg ( const Eref e,
double  current 
)

Injects a constantly updated current into the compartment. Unlike the 'inject' field, this injected current is applicable only for a single timestep. So this is meant to be used as the destination of a message rather than as a one-time assignment.

Definition at line 613 of file CompartmentBase.cpp.

References vInjectMsg().

Referenced by initCinfo().

614 {
615  vInjectMsg( e, current );
616 }
virtual void vInjectMsg(const Eref &e, double current)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::process ( const Eref e,
ProcPtr  p 
)

The process function does the object updating and sends out messages to channels, nernsts, and so on.

Definition at line 578 of file CompartmentBase.cpp.

References vProcess().

Referenced by initCinfo().

579 {
580  vProcess( e, p );
581 }
virtual void vProcess(const Eref &e, ProcPtr p)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::randInject ( const Eref e,
double  prob,
double  current 
)

Injects a constantly updated current into the compartment, with a probability prob. Note that it isn't the current amplitude that is random, it is the presence or absence of the current that is probabilistic.

Definition at line 618 of file CompartmentBase.cpp.

References vRandInject().

Referenced by initCinfo().

619 {
620  vRandInject( e, prob, current );
621 }
virtual void vRandInject(const Eref &e, double prob, double current)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CompartmentBase::rangeWarning ( const string &  field,
double  value 
)

A utility function to check for assignment to fields that must be > 0

Definition at line 381 of file CompartmentBase.cpp.

References RANGE.

Referenced by setCm(), setRa(), setRm(), moose::Compartment::vSetCm(), moose::Compartment::vSetRa(), and moose::Compartment::vSetRm().

382 {
383  if ( value < RANGE ) {
384  cout << "Warning: Ignored attempt to set " << field <<
385  " of compartment " <<
386  // c->target().e->name() <<
387  " to " << value << " as it is less than " << RANGE << endl;
388  return 1;
389  }
390  return 0;
391 }
uint32_t value
Definition: moosemodule.h:42
static const double RANGE

+ Here is the caller graph for this function:

void CompartmentBase::reinit ( const Eref e,
ProcPtr  p 
)

The reinit function reinitializes all fields.

Definition at line 583 of file CompartmentBase.cpp.

References vReinit().

Referenced by initCinfo().

584 {
585  vReinit( e, p );
586 }
virtual void vReinit(const Eref &e, ProcPtr p)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setCm ( const Eref e,
double  Cm 
)

Definition at line 414 of file CompartmentBase.cpp.

References rangeWarning(), and vSetCm().

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

415 {
416  if ( rangeWarning( "Cm", Cm ) ) return;
417  vSetCm( e, Cm );
418 }
virtual void vSetCm(const Eref &e, double Cm)=0
bool rangeWarning(const string &field, double value)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setDiameter ( double  diameter)

Definition at line 472 of file CompartmentBase.cpp.

References diameter_, and value.

Referenced by initCinfo(), makeCompt(), setGeomAndElec(), and moose::CompartmentDataHolder::writeData().

473 {
474  diameter_ = value;
475 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the caller graph for this function:

void CompartmentBase::setEm ( const Eref e,
double  Em 
)

Definition at line 404 of file CompartmentBase.cpp.

References vSetEm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::writeData().

405 {
406  vSetEm( e, Em );
407 }
virtual void vSetEm(const Eref &e, double Em)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setGeomAndElec ( const Eref e,
double  length,
double  dia 
)

Scales electrical values along with setting length, dia.

Definition at line 647 of file CompartmentBase.cpp.

References allChildren(), ALLDATA, diameter_, doubleEq(), Field< A >::get(), hasScaleFormula(), length_, Eref::objId(), Field< A >::set(), setDiameter(), setLength(), vGetCm(), vGetRa(), vGetRm(), vSetCm(), vSetRa(), vSetRm(), x0_, x_, y0_, y_, z0_, and z_.

Referenced by initCinfo().

649 {
650  if ( length_ > 0 && diameter_ > 0 && len > 0 && dia > 0 &&
652  (x_-x0_)*(x_-x0_) + (y_-y0_)*(y_-y0_) + (z_-z0_)*(z_-z0_) ) ) {
653  vSetRm( e, vGetRm( e ) * diameter_ * length_ / ( dia * len ) );
654  vSetCm( e, vGetCm( e ) * dia * len / ( diameter_ * length_ ) );
655  vSetRa( e, vGetRa( e ) * len * (diameter_ * diameter_) /
656  ( length_ * dia * dia ) );
657  // Rescale channel Gbars here
658  vector< ObjId > chans;
659  allChildren( e.objId(), ALLDATA, "ISA=ChanBase", chans );
660  for ( unsigned int i = 0; i < chans.size(); ++i ) {
661  if ( hasScaleFormula( chans[i].eref() ) )
662  continue; // Later we will eval the formula with len and dia
663  double gbar = Field< double >::get( chans[i], "Gbar" );
664  gbar *= len * dia / ( length_ * diameter_ );
665  Field< double >::set( chans[i], "Gbar", gbar );
666  }
667  // Rescale CaConc sizes here
668  vector< ObjId > concs;
669  allChildren( e.objId(), ALLDATA, "ISA=CaConcBase", concs );
670  for ( unsigned int i = 0; i < concs.size(); ++i ) {
671  Field< double >::set( concs[i], "length", len );
672  Field< double >::set( concs[i], "diameter", dia );
673  }
674 
675  setLength( len );
676  setDiameter( dia );
677  }
678 }
void setLength(double length)
virtual void vSetCm(const Eref &e, double Cm)=0
virtual double vGetRm(const Eref &e) const =0
virtual double vGetRa(const Eref &e) const =0
static bool set(const ObjId &dest, const string &field, A arg)
Definition: SetGet.h:245
virtual void vSetRm(const Eref &e, double Rm)=0
static bool hasScaleFormula(const Eref &e)
virtual double vGetCm(const Eref &e) const =0
const unsigned int ALLDATA
Used by ObjId and Eref.
Definition: consts.cpp:22
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16
virtual void vSetRa(const Eref &e, double Ra)=0
ObjId objId() const
Definition: Eref.cpp:57
int allChildren(ObjId start, unsigned int index, const string &insideBrace, vector< ObjId > &ret)
Definition: Wildcard.cpp:495
void setDiameter(double diameter)
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setInitVm ( const Eref e,
double  initVm 
)

Definition at line 462 of file CompartmentBase.cpp.

References vSetInitVm().

Referenced by initCinfo(), and moose::CompartmentDataHolder::writeData().

463 {
464  vSetInitVm( e, initVm );
465 }
virtual void vSetInitVm(const Eref &e, double initVm)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setInject ( const Eref e,
double  Inject 
)

Definition at line 452 of file CompartmentBase.cpp.

References vSetInject().

Referenced by initCinfo(), and moose::CompartmentDataHolder::writeData().

453 {
454  vSetInject( e, Inject );
455 }
virtual void vSetInject(const Eref &e, double Inject)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setLength ( double  length)

Definition at line 482 of file CompartmentBase.cpp.

References doubleEq(), length_, value, x0_, x_, y0_, y_, z0_, and z_.

Referenced by initCinfo(), makeCompt(), setGeomAndElec(), and moose::CompartmentDataHolder::writeData().

483 {
484  // If length is assigned correctly, also redo the end coords to match.
485  if ( value > 0 && length_ > 0 &&
487  (x_-x0_)*(x_-x0_) + (y_-y0_)*(y_-y0_) + (z_-z0_)*(z_-z0_) ) ) {
488  double ratio = value / length_;
489  x_ = x0_ + ratio * ( x_ - x0_ );
490  y_ = y0_ + ratio * ( y_ - y0_ );
491  z_ = z0_ + ratio * ( z_ - z0_ );
492  }
493 
494  length_ = value;
495 }
uint32_t value
Definition: moosemodule.h:42
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setRa ( const Eref e,
double  Ra 
)

Definition at line 436 of file CompartmentBase.cpp.

References rangeWarning(), and vSetRa().

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

437 {
438  if ( rangeWarning( "Ra", Ra ) ) return;
439  vSetRa( e, Ra );
440 }
bool rangeWarning(const string &field, double value)
virtual void vSetRa(const Eref &e, double Ra)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setRm ( const Eref e,
double  Rm 
)

Definition at line 425 of file CompartmentBase.cpp.

References rangeWarning(), and vSetRm().

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

426 {
427  if ( rangeWarning( "Rm", Rm ) ) return;
428  vSetRm( e, Rm );
429 }
bool rangeWarning(const string &field, double value)
virtual void vSetRm(const Eref &e, double Rm)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setVm ( const Eref e,
double  Vm 
)

Definition at line 394 of file CompartmentBase.cpp.

References vSetVm().

Referenced by initCinfo().

395 {
396  vSetVm( e, Vm );
397 }
virtual void vSetVm(const Eref &e, double Vm)=0

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setX ( double  value)

Definition at line 541 of file CompartmentBase.cpp.

References updateLength(), value, and x_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

542 {
543  x_ = value;
544  updateLength();
545 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setX0 ( double  value)

Definition at line 508 of file CompartmentBase.cpp.

References updateLength(), value, and x0_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

509 {
510  x0_ = value;
511  updateLength();
512 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setY ( double  value)

Definition at line 552 of file CompartmentBase.cpp.

References updateLength(), value, and y_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

553 {
554  y_ = value;
555  updateLength();
556 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setY0 ( double  value)

Definition at line 519 of file CompartmentBase.cpp.

References updateLength(), value, and y0_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

520 {
521  y0_ = value;
522  updateLength();
523 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setZ ( double  value)

Definition at line 563 of file CompartmentBase.cpp.

References updateLength(), value, and z_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

564 {
565  z_ = value;
566  updateLength();
567 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::setZ0 ( double  value)

Definition at line 530 of file CompartmentBase.cpp.

References updateLength(), value, and z0_.

Referenced by initCinfo(), makeCompt(), and moose::CompartmentDataHolder::writeData().

531 {
532  z0_ = value;
533  updateLength();
534 }
uint32_t value
Definition: moosemodule.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CompartmentBase::updateLength ( )

A utility function update length if any of the coords change

Definition at line 502 of file CompartmentBase.cpp.

References length_, x0_, x_, y0_, y_, z0_, and z_.

Referenced by setX(), setX0(), setY(), setY0(), setZ(), and setZ0().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetCm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getCm(), and setGeomAndElec().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetEm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getEm().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetIm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getIm().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetInitVm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getInitVm().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetInject ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getInject().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetRa ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getRa(), and setGeomAndElec().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetRm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getRm(), and setGeomAndElec().

+ Here is the caller graph for this function:

virtual double moose::CompartmentBase::vGetVm ( const Eref e) const
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by getVm().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vHandleAxial ( double  Vm)
pure virtual

handleAxial handles incoming axial message data.

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by handleAxial().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vHandleChannel ( const Eref e,
double  Gk,
double  Ek 
)
pure virtual

handleChannel handles information coming from the channel to the compartment

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by handleChannel().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vHandleRaxial ( double  Ra,
double  Vm 
)
pure virtual

handleRaxial handles incoming raxial message data.

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by handleRaxial().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vInitProc ( const Eref e,
ProcPtr  p 
)
pure virtual

The initProc function is for a second phase of 'process' operations. It sends the axial and raxial messages to other compartments. It has to be executed out of phase with the main process so that all compartments are equivalent and there is no calling order dependence in the results.

Implemented in ZombieCompartment, moose::Compartment, and SymCompartment.

Referenced by initProc().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vInitReinit ( const Eref e,
ProcPtr  p 
)
pure virtual

Empty function to do another reinit step out of phase with the main one. Nothing needs doing there.

Implemented in ZombieCompartment, moose::Compartment, and SymCompartment.

Referenced by initReinit().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vInjectMsg ( const Eref e,
double  current 
)
pure virtual

Injects a constantly updated current into the compartment. Unlike the 'inject' field, this injected current is applicable only for a single timestep. So this is meant to be used as the destination of a message rather than as a one-time assignment.

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by injectMsg().

+ Here is the caller graph for this function:

SrcFinfo1< double > * CompartmentBase::VmOut ( )
static

This Finfo is used to send out Vm to channels, spikegens, etc

It is exposed here so that HSolve can also use it to send out the Vm to the recipients.

Definition at line 26 of file CompartmentBase.cpp.

Referenced by initCinfo(), HSolveActive::sendValues(), moose::LIF::vProcess(), moose::ExIF::vProcess(), moose::QIF::vProcess(), moose::AdExIF::vProcess(), moose::AdThreshIF::vProcess(), moose::IzhIF::vProcess(), moose::Compartment::vProcess(), and moose::Compartment::vReinit().

26  {
27  static SrcFinfo1< double > VmOut( "VmOut",
28  "Sends out Vm value of compartment on each timestep" );
29  return &VmOut;
30 }
static SrcFinfo1< double > * VmOut()

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vProcess ( const Eref e,
ProcPtr  p 
)
pure virtual

The process function does the object updating and sends out messages to channels, nernsts, and so on.

Implemented in ZombieCompartment, moose::Compartment, moose::IzhIF, moose::IntFireBase, moose::AdExIF, moose::AdThreshIF, moose::QIF, moose::ExIF, and moose::LIF.

Referenced by process().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vRandInject ( const Eref e,
double  prob,
double  current 
)
pure virtual

Injects a constantly updated current into the compartment, with a probability prob. Note that it isn't the current amplitude that is random, it is the presence or absence of the current that is probabilistic.

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by randInject().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vReinit ( const Eref e,
ProcPtr  p 
)
pure virtual

The reinit function reinitializes all fields.

Implemented in ZombieCompartment, moose::Compartment, moose::IzhIF, moose::IntFireBase, moose::AdExIF, moose::AdThreshIF, moose::QIF, SymCompartment, moose::ExIF, and moose::LIF.

Referenced by reinit().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetCm ( const Eref e,
double  Cm 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setCm(), and setGeomAndElec().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetEm ( const Eref e,
double  Em 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setEm().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetInitVm ( const Eref e,
double  initVm 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setInitVm().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetInject ( const Eref e,
double  Inject 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setInject().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetRa ( const Eref e,
double  Ra 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setGeomAndElec(), and setRa().

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetRm ( const Eref e,
double  Rm 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setGeomAndElec(), and setRm().

+ Here is the caller graph for this function:

void CompartmentBase::vSetSolver ( const Eref e,
Id  hsolve 
)
virtual

Reimplemented in ZombieCompartment.

Definition at line 685 of file CompartmentBase.cpp.

Referenced by zombify().

686 {;}

+ Here is the caller graph for this function:

virtual void moose::CompartmentBase::vSetVm ( const Eref e,
double  Vm 
)
pure virtual

Implemented in ZombieCompartment, and moose::Compartment.

Referenced by setVm().

+ Here is the caller graph for this function:

void CompartmentBase::zombify ( Element orig,
const Cinfo zClass,
Id  hsolve 
)
static

This function is used to swap Cinfos of any CompartmentBase derived class. Used for making ZombieCompartments.

Definition at line 689 of file CompartmentBase.cpp.

References Element::cinfo(), Eref::data(), Element::localDataStart(), Element::numLocalData(), vSetSolver(), and Element::zombieSwap().

691 {
692  if ( orig->cinfo() == zClass )
693  return;
694  unsigned int start = orig->localDataStart();
695  unsigned int num = orig->numLocalData();
696  if ( num == 0 )
697  return;
698  vector< CompartmentDataHolder > cdh( num );
699 
700  for ( unsigned int i = 0; i < num; ++i ) {
701  Eref er( orig, i + start );
702  const CompartmentBase* cb =
703  reinterpret_cast< const CompartmentBase* >( er.data() );
704  cdh[i].readData( cb, er );
705  }
706  orig->zombieSwap( zClass );
707  for ( unsigned int i = 0; i < num; ++i ) {
708  Eref er( orig, i + start );
709  CompartmentBase* cb = reinterpret_cast< CompartmentBase* >( er.data() );
710  cb->vSetSolver( er, hsolve );
711  cdh[i].writeData( cb, er );
712  }
713 }
virtual void zombieSwap(const Cinfo *zCinfo)
virtual func, this base version must be called by all derived classes
Definition: Element.cpp:159
Definition: Eref.h:26
const Cinfo * cinfo() const
Definition: Element.cpp:66
virtual unsigned int localDataStart() const =0
Returns index of first data entry on this node.
virtual unsigned int numLocalData() const =0
Returns number of local data entries on this node.
virtual void vSetSolver(const Eref &e, Id hsolve)

+ Here is the call graph for this function:

Member Data Documentation

double moose::CompartmentBase::diameter_
private

Definition at line 262 of file CompartmentBase.h.

Referenced by CompartmentBase(), getDiameter(), setDiameter(), and setGeomAndElec().

double moose::CompartmentBase::length_
private
double moose::CompartmentBase::x0_
private
double moose::CompartmentBase::x_
private
double moose::CompartmentBase::y0_
private
double moose::CompartmentBase::y_
private
double moose::CompartmentBase::z0_
private
double moose::CompartmentBase::z_
private

The documentation for this class was generated from the following files: