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

#include <ZombieCompartment.h>

+ Inheritance diagram for ZombieCompartment:
+ Collaboration diagram for ZombieCompartment:

Public Member Functions

void dummy (const Eref &e, ProcPtr p)
 
double mtrand (void)
 
double vGetCm (const Eref &e) const
 
double vGetEm (const Eref &e) const
 
double vGetIm (const Eref &e) const
 
double vGetInitVm (const Eref &e) const
 
double vGetInject (const Eref &e) const
 
double vGetRa (const Eref &e) const
 
double vGetRm (const Eref &e) const
 
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 vInitProc (const Eref &e, ProcPtr p)
 
void vInitReinit (const Eref &e, ProcPtr p)
 
void vInjectMsg (const Eref &e, double current)
 
void vProcess (const Eref &e, ProcPtr p)
 
void vRandInject (const Eref &e, double prob, double current)
 
void vReinit (const Eref &e, ProcPtr p)
 
void vSetCm (const Eref &e, double Cm)
 
void vSetEm (const Eref &e, double Em)
 
void vSetInitVm (const Eref &e, double initVm)
 
void vSetInject (const Eref &e, double Inject)
 
void vSetRa (const Eref &e, double Ra)
 
void vSetRm (const Eref &e, double Rm)
 
void vSetSolver (const Eref &e, Id hsolve)
 Assigns the solver to the zombie. More...
 
void vSetVm (const Eref &e, double Vm)
 
 ZombieCompartment ()
 
virtual ~ZombieCompartment ()
 
- 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 ~CompartmentBase ()
 

Static Public Member Functions

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 Member Functions

void copyFields (moose::Compartment *c)
 

Private Attributes

HSolvehsolve_
 
moose::RNG< double > rng
 

Static Private Attributes

static const double EPSILON = 1.0e-15
 

Detailed Description

Zombie object that lets HSolve do its calculations, while letting the user interact with this object as if it were the original object.

Definition at line 35 of file ZombieCompartment.h.

Constructor & Destructor Documentation

ZombieCompartment::ZombieCompartment ( )

Definition at line 58 of file ZombieCompartment.cpp.

59 {
60  hsolve_ = NULL;
61 }
ZombieCompartment::~ZombieCompartment ( )
virtual

Definition at line 63 of file ZombieCompartment.cpp.

64 {
65  ;
66 }

Member Function Documentation

void ZombieCompartment::copyFields ( moose::Compartment c)
private
void ZombieCompartment::dummy ( const Eref e,
ProcPtr  p 
)
const Cinfo * ZombieCompartment::initCinfo ( )
static

Initializes the class info.

The initCinfo() function sets up the Compartment 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 24 of file ZombieCompartment.cpp.

References moose::CompartmentBase::initCinfo(), and zombieCompartmentCinfo.

Referenced by HSolve::zombify().

25 {
27  // static Finfo* compartmentFinfos[] = { };
28 
29  static string doc[] =
30  {
31  "Name", "ZombieCompartment",
32  "Author", "Upi Bhalla",
33  "Description", "Compartment object, for branching neuron models.",
34  };
35 
36  static Dinfo< ZombieCompartment > dinfo;
38  "ZombieCompartment",
39  CompartmentBase::initCinfo(),
40  0,
41  0,
42  // compartmentFinfos,
43  // sizeof( compartmentFinfos ) / sizeof( Finfo* ),
44  &dinfo,
45  doc,
46  sizeof( doc )/ sizeof( string )
47  );
48 
49  return &zombieCompartmentCinfo;
50 }
Definition: Dinfo.h:60
static const Cinfo * zombieCompartmentCinfo
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double ZombieCompartment::mtrand ( void  )

Definition at line 217 of file ZombieCompartment.cpp.

References moose::rng, and moose::RNG< T >::uniform().

218 {
219  return rng.uniform( );
220 }
moose::RNG< double > rng
T uniform(const T a, const T b)
Generate a uniformly distributed random number between a and b.
Definition: RNG.h:90

+ Here is the call graph for this function:

double ZombieCompartment::vGetCm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 97 of file ZombieCompartment.cpp.

References Eref::id().

98 {
99  return hsolve_->getCm( e.id() );
100 }
Id id() const
Definition: Eref.cpp:62
double getCm(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetEm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 86 of file ZombieCompartment.cpp.

References Eref::id().

87 {
88  return hsolve_->getEm( e.id() );
89 }
Id id() const
Definition: Eref.cpp:62
double getEm(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetIm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 129 of file ZombieCompartment.cpp.

References Eref::id().

130 {
131  return hsolve_->getIm( e.id() );
132 }
Id id() const
Definition: Eref.cpp:62
double getIm(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetInitVm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 149 of file ZombieCompartment.cpp.

References Eref::id().

150 {
151  return hsolve_->getInitVm( e.id() );
152 }
Id id() const
Definition: Eref.cpp:62
double getInitVm(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetInject ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 139 of file ZombieCompartment.cpp.

References Eref::id().

140 {
141  return hsolve_->getInject( e.id() );
142 }
Id id() const
Definition: Eref.cpp:62
double getInject(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetRa ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 119 of file ZombieCompartment.cpp.

References Eref::id().

120 {
121  return hsolve_->getRa( e.id() );
122 }
Id id() const
Definition: Eref.cpp:62
double getRa(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetRm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 108 of file ZombieCompartment.cpp.

References Eref::id().

109 {
110  return hsolve_->getRm( e.id() );
111 }
Id id() const
Definition: Eref.cpp:62
double getRm(Id id) const

+ Here is the call graph for this function:

double ZombieCompartment::vGetVm ( const Eref e) const
virtual

Implements moose::CompartmentBase.

Definition at line 75 of file ZombieCompartment.cpp.

References Eref::id().

76 {
77  assert(hsolve_);
78  return hsolve_->getVm( e.id() );
79 }
Id id() const
Definition: Eref.cpp:62
double getVm(Id id) const

+ Here is the call graph for this function:

void ZombieCompartment::vHandleAxial ( double  Vm)
virtual

handleAxial handles incoming axial message data.

Implements moose::CompartmentBase.

Definition at line 188 of file ZombieCompartment.cpp.

189 {
190  ;
191 }
void ZombieCompartment::vHandleChannel ( const Eref e,
double  Gk,
double  Ek 
)
virtual

handleChannel handles information coming from the channel to the compartment

Implements moose::CompartmentBase.

Definition at line 178 of file ZombieCompartment.cpp.

References Eref::id().

179 {
180  hsolve_->addGkEk( e.id(), Gk, Ek );
181 }
Id id() const
Definition: Eref.cpp:62
void addGkEk(Id id, double v1, double v2)
Interface to compartments.

+ Here is the call graph for this function:

void ZombieCompartment::vHandleRaxial ( double  Ra,
double  Vm 
)
virtual

handleRaxial handles incoming raxial message data.

Implements moose::CompartmentBase.

Definition at line 183 of file ZombieCompartment.cpp.

184 {
185  ;
186 }
void ZombieCompartment::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.

Implements moose::CompartmentBase.

Definition at line 168 of file ZombieCompartment.cpp.

169 {
170  ;
171 }
void ZombieCompartment::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.

Implements moose::CompartmentBase.

Definition at line 173 of file ZombieCompartment.cpp.

174 {
175  ;
176 }
void ZombieCompartment::vInjectMsg ( const Eref e,
double  current 
)
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.

Implements moose::CompartmentBase.

Definition at line 193 of file ZombieCompartment.cpp.

References Eref::id().

194 {
195  hsolve_->addInject( e.id(), current );
196 }
Id id() const
Definition: Eref.cpp:62
void addInject(Id id, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

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

Implements moose::CompartmentBase.

Definition at line 158 of file ZombieCompartment.cpp.

159 {
160  ;
161 }
void ZombieCompartment::vRandInject ( const Eref e,
double  prob,
double  current 
)
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.

Implements moose::CompartmentBase.

Definition at line 198 of file ZombieCompartment.cpp.

199 {
200  //~ if ( mtrand() < prob * dt_ ) {
201  //~ hsolve_->addInject( e.id(), current );
202  //~ }
203 }
void ZombieCompartment::vReinit ( const Eref e,
ProcPtr  p 
)
virtual

The reinit function reinitializes all fields.

Implements moose::CompartmentBase.

Definition at line 163 of file ZombieCompartment.cpp.

References moose::__rng_seed__, moose::rng, and moose::RNG< T >::setSeed().

164 {
166 }
moose::RNG< double > rng
void setSeed(const unsigned long seed)
If seed if 0 then set seed to a random number else set seed to the given number.
Definition: RNG.h:73
unsigned long __rng_seed__
A global seed for all RNGs in moose. When moose.seed( x ) is called, this variable is set...
Definition: global.cpp:45

+ Here is the call graph for this function:

void ZombieCompartment::vSetCm ( const Eref e,
double  Cm 
)
virtual

Implements moose::CompartmentBase.

Definition at line 91 of file ZombieCompartment.cpp.

References Eref::id().

92 {
93  if ( rangeWarning( "Cm", Cm ) ) return;
94  hsolve_->setCm( e.id(), Cm );
95 }
Id id() const
Definition: Eref.cpp:62
void setCm(Id id, double value)
bool rangeWarning(const string &field, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vSetEm ( const Eref e,
double  Em 
)
virtual

Implements moose::CompartmentBase.

Definition at line 81 of file ZombieCompartment.cpp.

References Eref::id().

82 {
83  hsolve_->setEm( e.id(), Em );
84 }
Id id() const
Definition: Eref.cpp:62
void setEm(Id id, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vSetInitVm ( const Eref e,
double  initVm 
)
virtual

Implements moose::CompartmentBase.

Definition at line 144 of file ZombieCompartment.cpp.

References Eref::id().

145 {
146  hsolve_->setInitVm( e.id(), initVm );
147 }
Id id() const
Definition: Eref.cpp:62
void setInitVm(Id id, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vSetInject ( const Eref e,
double  Inject 
)
virtual

Implements moose::CompartmentBase.

Definition at line 134 of file ZombieCompartment.cpp.

References Eref::id().

135 {
136  hsolve_->setInject( e.id(), Inject );
137 }
Id id() const
Definition: Eref.cpp:62
void setInject(Id id, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vSetRa ( const Eref e,
double  Ra 
)
virtual

Implements moose::CompartmentBase.

Definition at line 113 of file ZombieCompartment.cpp.

References Eref::id().

114 {
115  if ( rangeWarning( "Ra", Ra ) ) return;
116  hsolve_->setRa( e.id(), Ra );
117 }
Id id() const
Definition: Eref.cpp:62
void setRa(Id id, double value)
bool rangeWarning(const string &field, double value)

+ Here is the call graph for this function:

void ZombieCompartment::vSetRm ( const Eref e,
double  Rm 
)
virtual

Implements moose::CompartmentBase.

Definition at line 102 of file ZombieCompartment.cpp.

References Eref::id().

103 {
104  if ( rangeWarning( "Rm", Rm ) ) return;
105  hsolve_->setRm( e.id(), Rm );
106 }
Id id() const
Definition: Eref.cpp:62
bool rangeWarning(const string &field, double value)
void setRm(Id id, double value)

+ Here is the call graph for this function:

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

Assigns the solver to the zombie.

Reimplemented from moose::CompartmentBase.

Definition at line 206 of file ZombieCompartment.cpp.

References Element::cinfo(), Eref::data(), Id::element(), Id::eref(), Cinfo::isA(), and Id::path().

207 {
208  if ( !hsolve.element()->cinfo()->isA( "HSolve" ) ) {
209  cout << "Error: ZombieCompartment::vSetSolver: Object: " <<
210  hsolve.path() << " is not an HSolve. Aborted\n";
211  hsolve_ = 0;
212  return;
213  }
214  hsolve_ = reinterpret_cast< HSolve* >( hsolve.eref().data() );
215 }
char * data() const
Definition: Eref.cpp:41
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
Eref eref() const
Definition: Id.cpp:125
Definition: HSolve.h:16
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66

+ Here is the call graph for this function:

void ZombieCompartment::vSetVm ( const Eref e,
double  Vm 
)
virtual

Implements moose::CompartmentBase.

Definition at line 69 of file ZombieCompartment.cpp.

References Eref::id().

70 {
71  assert(hsolve_);
72  hsolve_->setVm( e.id(), Vm );
73 }
Id id() const
Definition: Eref.cpp:62
void setVm(Id id, double value)

+ Here is the call graph for this function:

Member Data Documentation

const double ZombieCompartment::EPSILON = 1.0e-15
staticprivate

Definition at line 143 of file ZombieCompartment.h.

HSolve* ZombieCompartment::hsolve_
private

Definition at line 141 of file ZombieCompartment.h.

moose::RNG<double> ZombieCompartment::rng
private

Definition at line 147 of file ZombieCompartment.h.


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