14 #include "../shell/Wildcard.h"
16 static const double RANGE = 4.0e-17;
17 using namespace moose;
28 "Sends out Vm value of compartment on each timestep" );
38 "Sends out Vm value of compartment to adjacent compartments,"
46 "Sends out Raxial information on each timestep, "
47 "fields are Ra and Vm" );
65 "Handles 'process' call",
69 "Handles 'reinit' call",
72 static Finfo* processShared[] =
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* )
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.",
96 "Handles Reinit call for the 'init' phase of the CompartmentBase "
99 static Finfo* initShared[] =
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* )
123 "Handles conductance and Reversal potential arguments from Channel",
127 static Finfo* channelShared[] =
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* )
142 "Handles Raxial info: arguments are Ra and Vm.",
147 static Finfo* axialShared[] =
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* )
172 "Handles Axial information. Argument is just Vm.",
175 static Finfo* raxialShared[] =
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* )
192 "membrane potential",
197 "Membrane capacitance",
202 "Resting membrane potential",
207 "Current going through membrane",
211 "Current injection to deliver into compartment",
216 "Initial value for membrane potential",
221 "Membrane resistance",
226 "Axial resistance of compartment",
231 "Diameter of compartment",
236 "Length of compartment",
241 "X coordinate of start of compartment",
246 "Y coordinate of start of compartment",
251 "Z coordinate of start of compartment",
256 "x coordinate of end of compartment",
261 "y coordinate of end of compartment",
266 "z coordinate of end of compartment",
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)"
284 "Sends a random injection current to the compartment. Must be"
285 "updated each timestep."
286 "Arguments to randInject are probability and current.",
291 "Message for organizing compartments into groups, called"
292 "cables. Doesn't do anything.",
296 "Displaces compartment by specified vector",
301 "Assigns length and dia and accounts for any electrical "
302 "scaling needed as a result.",
307 static Finfo* compartmentFinfos[] =
338 static string doc[] =
340 "Name",
"CompartmentBase",
341 "Author",
"Upi Bhalla",
342 "Description",
"CompartmentBase object, for branching neuron models.",
349 sizeof( compartmentFinfos ) /
sizeof(
Finfo* ),
352 sizeof(doc)/
sizeof(
string)
383 if ( value <
RANGE ) {
384 cout <<
"Warning: Ignored attempt to set " << field <<
385 " of compartment " <<
387 " to " << value <<
" as it is less than " <<
RANGE << endl;
485 if ( value > 0 &&
length_ > 0 &&
488 double ratio = value /
length_;
641 for ( vector< Id >::iterator j = kids.begin(); j != kids.end(); j++ )
642 if ( j->element()->getName() ==
"scaleFormula" )
648 double len,
double dia )
656 ( length_ * dia * dia ) );
658 vector< ObjId > chans;
660 for (
unsigned int i = 0; i < chans.size(); ++i ) {
664 gbar *= len * dia / ( length_ *
diameter_ );
668 vector< ObjId > concs;
670 for (
unsigned int i = 0; i < concs.size(); ++i ) {
692 if ( orig->
cinfo() == zClass )
698 vector< CompartmentDataHolder > cdh( num );
700 for (
unsigned int i = 0; i < num; ++i ) {
701 Eref er( orig, i + start );
704 cdh[i].readData( cb, er );
707 for (
unsigned int i = 0; i < num; ++i ) {
708 Eref er( orig, i + start );
711 cdh[i].writeData( cb, er );
virtual void vInitProc(const Eref &e, ProcPtr p)=0
Id init(int argc, char **argv, bool &doUnitTests, bool &doRegressionTests, unsigned int &benchmark)
virtual void vHandleAxial(double Vm)=0
static const Cinfo * compartmentBaseCinfo
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
double getEm(const Eref &e) const
virtual void vRandInject(const Eref &e, double prob, double current)=0
virtual void vSetInject(const Eref &e, double Inject)=0
void handleRaxial(double Ra, double Vm)
static const double RANGE
double getDiameter() const
void setLength(double length)
virtual void zombieSwap(const Cinfo *zCinfo)
virtual func, this base version must be called by all derived classes
static const Cinfo * compartmentCinfo
virtual void vSetCm(const Eref &e, double Cm)=0
virtual double vGetRm(const Eref &e) const =0
static void children(const Eref &e, vector< Id > &ret)
virtual double vGetInject(const Eref &e) const =0
virtual void vSetEm(const Eref &e, double Em)=0
virtual double vGetRa(const Eref &e) const =0
static bool set(const ObjId &dest, const string &field, A arg)
virtual void vSetVm(const Eref &e, double Vm)=0
bool rangeWarning(const string &field, double value)
void randInject(const Eref &e, double prob, double current)
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.
virtual void vProcess(const Eref &e, ProcPtr p)=0
double getCm(const Eref &e) const
void setInitVm(const Eref &e, double initVm)
void setEm(const Eref &e, double Em)
bool doubleEq(double x, double y)
virtual double vGetVm(const Eref &e) const =0
void setGeomAndElec(const Eref &e, double length, double dia)
Scales electrical values along with setting length, dia.
virtual ~CompartmentBase()
double getInitVm(const Eref &e) const
void handleChannel(const Eref &e, double Gk, double Ek)
void initReinit(const Eref &e, ProcPtr p)
virtual void vSetRa(const Eref &e, double Ra)=0
void initProc(const Eref &e, ProcPtr p)
void setCm(const Eref &e, double Cm)
double getIm(const Eref &e) const
virtual double vGetEm(const Eref &e) const =0
virtual void vHandleChannel(const Eref &e, double Gk, double Ek)=0
int allChildren(ObjId start, unsigned int index, const string &insideBrace, vector< ObjId > &ret)
const Cinfo * cinfo() const
void displace(double dx, double dy, double dz)
Displaces compartment by specified distance vector.
void setInject(const Eref &e, double Inject)
virtual void vReinit(const Eref &e, ProcPtr p)=0
virtual double vGetIm(const Eref &e) const =0
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.
void handleAxial(double Vm)
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
static SrcFinfo1< double > * VmOut()
double getRa(const Eref &e) const
static SrcFinfo2< double, double > * raxialOut()
static SrcFinfo1< double > * axialOut()
virtual void vInjectMsg(const Eref &e, double current)=0
virtual void vSetInitVm(const Eref &e, double initVm)=0
void setDiameter(double diameter)
virtual void vInitReinit(const Eref &e, ProcPtr p)=0
void reinit(const Eref &e, ProcPtr p)
virtual void vHandleRaxial(double Ra, double Vm)=0
static A get(const ObjId &dest, const string &field)
static const Cinfo * initCinfo()
void injectMsg(const Eref &e, double current)
virtual double vGetInitVm(const Eref &e) const =0
void setRa(const Eref &e, double Ra)
double getRm(const Eref &e) const
static const Cinfo * initCinfo()
void setRm(const Eref &e, double Rm)
virtual void vSetSolver(const Eref &e, Id hsolve)