MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SymCompartment Class Reference

#include <SymCompartment.h>

+ Inheritance diagram for SymCompartment:
+ Collaboration diagram for SymCompartment:

Public Member Functions

void raxialCylinder (double Ra, double Vm)
 
void raxialSphere (double Ra, double Vm)
 
void raxialSym (double Ra, double Vm)
 
void sumRaxial (double Ra)
 
 SymCompartment ()
 
void vInitProc (const Eref &e, ProcPtr p)
 
void vInitReinit (const Eref &e, ProcPtr p)
 
void vReinit (const Eref &e, ProcPtr p)
 
 ~SymCompartment ()
 
- Public Member Functions inherited from moose::Compartment
void cable ()
 
 Compartment ()
 
virtual double vGetCm (const Eref &e) const
 
virtual double vGetEm (const Eref &e) const
 
virtual double vGetIm (const Eref &e) const
 
virtual double vGetInitVm (const Eref &e) const
 
virtual double vGetInject (const Eref &e) const
 
virtual double vGetRa (const Eref &e) const
 
virtual double vGetRm (const Eref &e) const
 
virtual double vGetVm (const Eref &e) const
 
void vHandleAxial (double Vm)
 
void vHandleChannel (const Eref &e, double Gk, double Ek)
 
void vHandleRaxial (double Ra, double Vm)
 
void vInjectMsg (const Eref &e, double current)
 
void vProcess (const Eref &e, ProcPtr p)
 
void vRandInject (const Eref &e, double prob, double current)
 
virtual void vSetCm (const Eref &e, double Cm)
 
virtual void vSetEm (const Eref &e, double Em)
 
virtual void vSetInitVm (const Eref &e, double initVm)
 
virtual void vSetInject (const Eref &e, double Inject)
 
virtual void vSetRa (const Eref &e, double Ra)
 
virtual void vSetRm (const Eref &e, double Rm)
 
virtual void vSetVm (const Eref &e, double Vm)
 
virtual ~Compartment ()
 
- Public Member Functions inherited from moose::CompartmentBase
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 void vSetSolver (const Eref &e, Id hsolve)
 
virtual ~CompartmentBase ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from moose::Compartment
static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from moose::CompartmentBase
static const CinfoinitCinfo ()
 
static SrcFinfo1< double > * VmOut ()
 
static void zombify (Element *orig, const Cinfo *zClass, Id hsolve)
 

Private Attributes

double coeff_
 
double RaSum_
 

Additional Inherited Members

- Protected Attributes inherited from moose::Compartment
double A_
 
double B_
 
double Cm_
 
double Em_
 
double Im_
 
double initVm_
 
double inject_
 
double lastIm_
 
double Ra_
 
double Rm_
 
double sumInject_
 
double Vm_
 

Detailed Description

The SymCompartment class sets up a symmetric compartment for branched nerve calculations. Handles electronic structure and also channels. This version splits the Ra between either end of the compartment and is hence slightly cleaner than the asymmetric compartment. The default EE method is not a particularly efficient way of doing the calculations, so we should use a solver for any substantial calculations.

Definition at line 24 of file SymCompartment.h.

Constructor & Destructor Documentation

SymCompartment::SymCompartment ( )

Definition at line 283 of file SymCompartment.cpp.

283  :
284  coeff_(0.0),
285  RaSum_(0.0)
286 {
287  ;
288 }
SymCompartment::~SymCompartment ( )
inline

Definition at line 28 of file SymCompartment.h.

28 {;}

Member Function Documentation

const Cinfo * SymCompartment::initCinfo ( )
static

Definition at line 50 of file SymCompartment.cpp.

References cylinderOut(), distalOut(), moose::Compartment::initCinfo(), proximalOut(), raxialCylinder(), raxialSphere(), raxialSym(), sumRaxial(), sumRaxialOut(), and symCompartmentCinfo.

Referenced by ReadCell::buildCompartment().

51 {
52  // process and init and reinit are inherited from Compartment.
54  // Dest Finfos
56 
57  static DestFinfo raxialSphere( "raxialSphere",
58  "Expects Ra and Vm from other compartment. This is a special case when"
59  " other compartments are evenly distributed on a spherical compartment.",
62  );
63  static DestFinfo raxialCylinder( "raxialCylinder",
64  "Expects Ra and Vm from other compartment. This is a special case when"
65  " other compartments are evenly distributed on the curved surface"
66  " of the cylindrical compartment, so we assume that the"
67  " cylinder does not add any further resistance.",
70  );
71  static DestFinfo raxialSym( "raxialSym",
72  "Expects Ra and Vm from other compartment.",
75  );
76  static DestFinfo sumRaxial( "sumRaxial",
77  "Expects Ra from other compartment.",
80  );
82  // Shared Finfos.
84  // The SrcFinfos raxialOut, sumRaxialOut and requestSumAxial
85  // are defined above to get them into file-wide scope.
86 
87  static Finfo* distalShared[] =
88  {
89  &raxialSym, &sumRaxial,// &handleSumRaxialRequest,
90  distalOut(), sumRaxialOut(), //requestSumAxial()
91  };
92 
93  static Finfo* proximalShared[] =
94  {
97  };
98 
99  static SharedFinfo proximal( "proximal",
100  "This is a shared message between symmetric compartments.\n"
101  "It goes from the proximal end of the current compartment to\n"
102  "distal end of the compartment closer to the soma.\n",
103  proximalShared, sizeof( proximalShared ) / sizeof( Finfo* )
104  );
105 
106  static SharedFinfo distal( "distal",
107  "This is a shared message between symmetric compartments.\n"
108  "It goes from the distal end of the current compartment to the \n"
109  "proximal end of one further from the soma. \n"
110  "The Ra values collected from children and\n"
111  "sibling nodes are used for computing the equivalent resistance \n"
112  "between each pair of nodes using star-mesh transformation.\n"
113  "Mathematically this is the same as the proximal message, but\n"
114  "the distinction is important for traversal and clarity.\n",
115  distalShared, sizeof( distalShared ) / sizeof( Finfo* )
116  );
117 
118  static SharedFinfo sibling( "sibling",
119  "This is a shared message between symmetric compartments.\n"
120  "Conceptually, this goes from the proximal end of the current \n"
121  "compartment to the proximal end of a sibling compartment \n"
122  "on a branch in a dendrite. However,\n"
123  "this works out to the same as a 'distal' message in terms of \n"
124  "equivalent circuit. The Ra values collected from siblings \n"
125  "and parent node are used for \n"
126  "computing the equivalent resistance between each pair of\n"
127  "nodes using star-mesh transformation.\n",
128  distalShared, sizeof( distalShared ) / sizeof( Finfo* )
129  );
130 
131  static Finfo* sphereShared[] = {
132  &raxialSphere,
133  distalOut(),
134  };
135 
136  static SharedFinfo sphere( "sphere",
137  "This is a shared message between a spherical compartment \n"
138  "(typically soma) and a number of evenly spaced cylindrical \n"
139  "compartments, typically primary dendrites.\n"
140  "The sphere contributes the usual Ra/2 to the resistance\n"
141  "between itself and children. The child compartments \n"
142  "do not connect across to each other\n"
143  "through sibling messages. Instead they just connect to the soma\n"
144  "through the 'proximalOnly' message\n",
145  sphereShared, sizeof( sphereShared )/sizeof( Finfo* )
146  );
147  static Finfo* cylinderShared[] = {
149  cylinderOut(),
150  };
151 
152  static SharedFinfo cylinder( "cylinder",
153  "This is a shared message between a cylindrical compartment \n"
154  "(typically a dendrite) and a number of evenly spaced child \n"
155  "compartments, typically dendritic spines, protruding from the\n"
156  "curved surface of the cylinder. We assume that the resistance\n"
157  "from the cylinder curved surface to its axis is negligible.\n"
158  "The child compartments do not need to connect across to each \n"
159  "other through sibling messages. Instead they just connect to the\n"
160  "parent dendrite through the 'proximalOnly' message\n",
161  cylinderShared, sizeof( cylinderShared )/sizeof( Finfo* )
162  );
163 
164  static Finfo* proximalOnlyShared[] = {
165  &raxialSphere,
166  proximalOut(),
167  };
168  static SharedFinfo proximalOnly( "proximalOnly",
169  "This is a shared message between a dendrite and a parent\n"
170  "compartment whose offspring are spatially separated from each\n"
171  "other. For example, evenly spaced dendrites emerging from a soma\n"
172  "or spines emerging from a common parent dendrite. In these cases\n"
173  "the sibling dendrites do not need to connect to each other\n"
174  "through 'sibling' messages. Instead they just connect to the\n"
175  "parent compartment (soma or dendrite) through this message\n",
176  proximalOnlyShared, sizeof( proximalOnlyShared )/sizeof( Finfo* )
177  );
178 
180  static Finfo* symCompartmentFinfos[] =
181  {
182 
184  // SharedFinfo definitions
186  // The inherited process and init messages do not need to be
187  // overridden.
188  &proximal,
189  &distal,
190  &sibling,
191  &sphere,
192  &cylinder,
193  &proximalOnly
194 
196  // MsgSrc definitions
198 
200  // DestFinfo definitions
202  };
203 
204  // static SchedInfo schedInfo[] = { { process, 0, 0 }, { init, 0, 1 } };
205 
206  static string doc[] =
207  {
208  "Name", "SymCompartment",
209  "Author", "Upi Bhalla; updated and documented by Subhasis Ray",
210  "Description", "SymCompartment object, for branching neuron models. In symmetric\n"
211  "compartments the axial resistance is equally divided on two sides of\n"
212  "the node. The equivalent circuit of the passive compartment becomes:\n"
213  "(NOTE: you must use a fixed-width font like Courier for correct rendition of the diagrams below)::\n"
214  " \n"
215  " Ra/2 B Ra/2 \n"
216  " A-/\\/\\/\\_____/\\/\\/\\-- C \n"
217  " | \n"
218  " ____|____ \n"
219  " | | \n"
220  " | \\ \n"
221  " | / Rm \n"
222  " ---- Cm \\ \n"
223  " ---- / \n"
224  " | | \n"
225  " | _____ \n"
226  " | --- Em \n"
227  " |_________| \n"
228  " | \n"
229  " __|__ \n"
230  " ///// \n"
231  " \n"
232  " \n\n"
233  "In case of branching, the B-C part of the parent's axial resistance\n"
234  "forms a Y with the A-B part of the children::\n\n"
235  " B' \n"
236  " | \n"
237  " / \n"
238  " \\ \n"
239  " / \n"
240  " \\ \n"
241  " / \n"
242  " |A' \n"
243  " B | \n"
244  " A-----/\\/\\/\\-----/\\/\\/\\------|C \n"
245  " | \n"
246  " |A\" \n"
247  " / \n"
248  " \\ \n"
249  " / \n"
250  " \\ \n"
251  " / \n"
252  " | \n"
253  " B\" \n\n\n"
254  "As per basic circuit analysis techniques, the C node is replaced using\n"
255  "star-mesh transform. This requires all sibling compartments at a\n"
256  "branch point to be connected via 'sibling' messages by the user (or\n"
257  "by the cell reader in case of prototypes). For the same reason, the\n"
258  "child compartment must be connected to the parent by\n"
259  "distal-proximal message pair. The calculation of the\n"
260  "coefficient for computing equivalent resistances in the mesh is done\n"
261  "at reinit.",
262  };
263  static Dinfo< SymCompartment > dinfo;
264 
265  static Cinfo symCompartmentCinfo(
266  "SymCompartment",
268  symCompartmentFinfos,
269  sizeof( symCompartmentFinfos ) / sizeof( Finfo* ),
270  &dinfo,
271  doc, sizeof(doc)/sizeof(string)
272  );
273 
274  return &symCompartmentCinfo;
275 }
static SrcFinfo2< double, double > * cylinderOut()
static SrcFinfo2< double, double > * proximalOut()
void raxialSym(double Ra, double Vm)
static const Cinfo * initCinfo()
Definition: Compartment.cpp:26
Definition: Dinfo.h:60
Definition: OpFunc.h:40
void raxialSphere(double Ra, double Vm)
static const Cinfo * symCompartmentCinfo
void sumRaxial(double Ra)
Definition: OpFunc.h:27
void raxialCylinder(double Ra, double Vm)
static SrcFinfo2< double, double > * distalOut()
Definition: Cinfo.h:18
Definition: Finfo.h:12
static SrcFinfo1< double > * sumRaxialOut()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SymCompartment::raxialCylinder ( double  Ra,
double  Vm 
)

Definition at line 367 of file SymCompartment.cpp.

References moose::Compartment::A_, moose::Compartment::B_, moose::Compartment::Im_, and moose::Compartment::Vm_.

Referenced by initCinfo().

368 {
369  double invR = 2.0 / Ra;
370  A_ += Vm * invR;
371  B_ += invR;
372  Im_ += ( Vm - Vm_ ) * invR;
373 }

+ Here is the caller graph for this function:

void SymCompartment::raxialSphere ( double  Ra,
double  Vm 
)

Definition at line 359 of file SymCompartment.cpp.

References moose::Compartment::A_, moose::Compartment::B_, moose::Compartment::Im_, moose::Compartment::Ra_, and moose::Compartment::Vm_.

Referenced by initCinfo().

360 {
361  double invR = 2.0 / ( Ra + Ra_ );
362  A_ += Vm * invR;
363  B_ += invR;
364  Im_ += ( Vm - Vm_ ) * invR;
365 }

+ Here is the caller graph for this function:

void SymCompartment::raxialSym ( double  Ra,
double  Vm 
)

Definition at line 338 of file SymCompartment.cpp.

References moose::Compartment::A_, moose::Compartment::B_, coeff_, moose::Compartment::Im_, and moose::Compartment::Vm_.

Referenced by initCinfo().

339 {
340  // cout << "SymCompartment " << ":: raxialSym: Ra = " << Ra << ", Vm = " << Vm << endl;
341  /*
342  Ra *= coeff_;
343  A_ += Vm / Ra;
344  B_ += 1.0 / Ra;
345  Im_ += ( Vm - Vm_ ) / Ra;
346  */
347 
348  double R = Ra * coeff_;
349  // cout << "raxialSym:R=" << R << endl;
350  A_ += Vm / R;
351  B_ += 1.0 / R;
352  Im_ += (Vm - Vm_) / R;
353  // double invR = 2.0 / ( Ra + Ra_ );
354  // A_ += Vm * invR;
355  // B_ += invR;
356  // Im_ += ( Vm - Vm_ ) * invR;
357 }

+ Here is the caller graph for this function:

void SymCompartment::sumRaxial ( double  Ra)

Definition at line 331 of file SymCompartment.cpp.

References coeff_, moose::Compartment::Ra_, and RaSum_.

Referenced by initCinfo().

332 {
333  RaSum_ += Ra_/Ra;
334  coeff_ = ( 1 + RaSum_ ) / 2.0;
335  // cout << "SymCompartment::sumRaxial: coeff = " << coeff_ << endl;
336 }

+ Here is the caller graph for this function:

void SymCompartment::vInitProc ( const Eref e,
ProcPtr  p 
)
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.

Reimplemented from moose::Compartment.

Definition at line 296 of file SymCompartment.cpp.

References cylinderOut(), distalOut(), proximalOut(), moose::Compartment::Ra_, and moose::Compartment::Vm_.

297 {
298  // cout << "SymCompartment " << e.id().path() << ":: innerInitProc: A = " << A_ << ", B = " << B_ << endl;
299  distalOut()->send( e, Ra_, Vm_ ); // to kids
300  proximalOut()->send( e, Ra_, Vm_ ); // to parent
301  cylinderOut()->send( e, 1e-6, Vm_ ); // to kids
302 }
static SrcFinfo2< double, double > * cylinderOut()
static SrcFinfo2< double, double > * proximalOut()
static SrcFinfo2< double, double > * distalOut()

+ Here is the call graph for this function:

void SymCompartment::vInitReinit ( const Eref e,
ProcPtr  p 
)
virtual

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

Reimplemented from moose::Compartment.

Definition at line 320 of file SymCompartment.cpp.

321 {
322  // cout << "SymCompartment " << e.id().path() << ":: innerInitReinit: coeff = " << coeff_ << ", coeff2 = " << coeff2_ << endl;
323  // coeff_ = 0.0;
324  // coeff2_ = 0.0;
325  // RaSum_ = 0.0;
326  // RaSum2_ = 0.0;
327  // requestSumAxial()->send( e );
328  // requestSumAxial2()->send( e );
329 }
void SymCompartment::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

The reinit function reinitializes all fields.

Reimplemented from moose::Compartment.

Definition at line 305 of file SymCompartment.cpp.

References moose::Compartment::Ra_, sumRaxialOut(), and moose::Compartment::vReinit().

306 {
308  // We don't want to recalculate these every time step - the request... methods are not required
309  // requestSumAxial()->send( e );
310  // requestSumAxial2()->send( e );
311  sumRaxialOut()->send( e, Ra_ );
312  // sumRaxial2Out()->send( e, Ra_ );
313 
314  // cout << "SymCompartment " << e.id().path() << ":: innerReinit: coeff = " << coeff_ << ", coeff2 = " << coeff2_ << endl;
315 }
void vReinit(const Eref &e, ProcPtr p)
static SrcFinfo1< double > * sumRaxialOut()

+ Here is the call graph for this function:

Member Data Documentation

double SymCompartment::coeff_
private

Definition at line 46 of file SymCompartment.h.

Referenced by raxialSym(), and sumRaxial().

double SymCompartment::RaSum_
private

Definition at line 47 of file SymCompartment.h.

Referenced by sumRaxial().


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