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

#include <HSolve.h>

+ Inheritance diagram for HSolve:
+ Collaboration diagram for HSolve:

Public Member Functions

void addConc (Id id, double conc)
 
void addGkEk (Id id, double v1, double v2)
 Interface to compartments. More...
 
void addInject (Id id, double value)
 
double getCa (Id id) const
 Interface to CaConc. More...
 
int getCaAdvance () const
 
double getCaBasal (Id id) const
 
double getCaCeiling (Id id) const
 
int getCaDiv () const
 
double getCaFloor (Id id) const
 
double getCaMax () const
 
double getCaMin () const
 
double getCm (Id id) const
 
double getDt () const
 
double getEk (Id id) const
 
double getEm (Id id) const
 
double getGk (Id id) const
 
double getHHChannelGbar (Id id) const
 
double getIa (Id id) const
 
double getIk (Id id) const
 
double getIm (Id id) const
 
double getInitVm (Id id) const
 
double getInject (Id id) const
 
int getInstant (Id id) const
 
string getPath (const Eref &e) const
 
double getRa (Id id) const
 
double getRm (Id id) const
 
Id getSeed () const
 
int getVDiv () const
 
double getVm (Id id) const
 
double getVMax () const
 
double getVMin () const
 
double getX (Id id) const
 
double getY (Id id) const
 
double getZ (Id id) const
 
 HSolve ()
 
void iCa (Id id, double iCa)
 
void process (const Eref &hsolve, ProcPtr p)
 
void reinit (const Eref &hsolve, ProcPtr p)
 
void setCa (Id id, double Ca)
 
void setCaAdvance (int caAdvance)
 
void setCaBasal (Id id, double CaBasal)
 
void setCaCeiling (Id id, double floor)
 
void setCaDiv (int caDiv)
 
void setCaFloor (Id id, double floor)
 
void setCaMax (double caMax)
 
void setCaMin (double caMin)
 
void setCm (Id id, double value)
 
void setDt (double dt)
 
void setEk (Id id, double value)
 
void setEm (Id id, double value)
 
void setGk (Id id, double value)
 
void setHHChannelGbar (Id id, double value)
 
void setHHmodulation (Id id, double value)
 Assign scale factor for HH channel conductance. More...
 
void setInitVm (Id id, double value)
 
void setInject (Id id, double value)
 
void setInstant (Id id, int instant)
 
void setPath (const Eref &e, string path)
 
void setPowers (Id id, double Xpower, double Ypower, double Zpower)
 Interface to channels. More...
 
void setRa (Id id, double value)
 
void setRm (Id id, double value)
 
void setSeed (Id seed)
 
void setTauB (Id id, double tau, double B)
 
void setVDiv (int vDiv)
 
void setVm (Id id, double value)
 
void setVMax (double vMax)
 
void setVMin (double vMin)
 
void setX (Id id, double value)
 
void setY (Id id, double value)
 
void setZ (Id id, double value)
 
 ~HSolve ()
 
- Public Member Functions inherited from HSolveActive
 HSolveActive ()
 
void reinit (ProcPtr info)
 
void setup (Id seed, double dt)
 
void step (ProcPtr info)
 Equivalent to process. More...
 
- Public Member Functions inherited from HSolvePassive
void setup (Id seed, double dt)
 
void solve ()
 
- Public Member Functions inherited from HinesMatrix
double getA (unsigned int row, unsigned int col) const
 
double getB (unsigned int row) const
 
unsigned int getSize () const
 
double getVMid (unsigned int row) const
 
 HinesMatrix ()
 
void setup (const vector< TreeNodeStruct > &tree, double dt)
 

Static Public Member Functions

static void deleteIncomingMessages (Element *orig, const string finfo)
 
static const std::set< string > & handledClasses ()
 
static const CinfoinitCinfo ()
 Interface to external channels. More...
 

Private Member Functions

unsigned int localIndex (Id id) const
 
void mapIds ()
 
void mapIds (vector< Id > id)
 
void setup (Eref hsolve)
 
void unzombify () const
 
void zombify (Eref hsolve) const
 

Static Private Member Functions

static vector< Idchildren (Id obj)
 
static Id deepSearchForCompartment (Id base)
 

Private Attributes

double dt_
 
map< Id, unsigned int > localIndex_
 
string path_
 
Id seed_
 

Additional Inherited Members

- Protected Types inherited from HinesMatrix
typedef vector< double >::iterator vdIterator
 
- Protected Member Functions inherited from HSolvePassive
void backwardSubstitute ()
 
void forwardEliminate ()
 
void updateMatrix ()
 
- Protected Attributes inherited from HSolveActive
vector< double > ca_
 Ca conc in each pool. More...
 
vector< double > caActivation_
 calcium pool More...
 
int caAdvance_
 
vector< CaConcStructcaConc_
 Ca pool info. More...
 
vector< IdcaConcId_
 calcium from difshells More...
 
vector< unsigned int > caCount_
 each compartment More...
 
vector< int > caDependIndex_
 depdt channel depend upon? More...
 
int caDiv_
 
double caMax_
 
double caMin_
 
vector< LookupRow * > caRow_
 
vector< LookupRowcaRowCompt_
 
LookupTable caTable_
 
vector< double * > caTarget_
 
vector< unsigned int > chan2compt_
 
vector< unsigned int > chan2state_
 a state index More...
 
vector< ChannelStructchannel_
 to compartment: chan2compt More...
 
vector< int > channelCount_
 compartment More...
 
vector< IdchannelId_
 Used for localIndex-ing. More...
 
vector< LookupColumncolumn_
 to lookup for this species More...
 
vector< CurrentStructcurrent_
 Channel current. More...
 
vector< currentVecItercurrentBoundary_
 
vector< double > externalCalcium_
 
vector< double > externalCurrent_
 
vector< IdgateId_
 Used for localIndex-ing. More...
 
vector< bool > gCaDepend_
 depend on Ca conc? More...
 
vector< unsigned int > outCa_
 
vector< unsigned int > outIk_
 
vector< unsigned int > outVm_
 
vector< SpikeGenStructspikegen_
 
vector< double > state_
 Fraction of gates open. More...
 
vector< SynChanStructsynchan_
 
int vDiv_
 
double vMax_
 
double vMin_
 
LookupTable vTable_
 
- Protected Attributes inherited from HSolvePassive
vector< CompartmentStructcompartment_
 
vector< IdcompartmentId_
 
map< unsigned int, InjectStructinject_
 
vector< TreeNodeStructtree_
 
vector< double > V_
 
- Protected Attributes inherited from HinesMatrix
vector< vdIteratorbackOperand_
 
double dt_
 
vector< double > HJ_
 
vector< double > HJCopy_
 
vector< double > HS_
 
vector< JunctionStructjunction_
 
unsigned int nCompt_
 
vector< vdIteratoroperand_
 
int stage_
 reached. Used in getA. More...
 
vector< double > VMid_
 middle of a time step. More...
 

Detailed Description

HSolve adapts the integrator HSolveActive into a MOOSE class.

Definition at line 16 of file HSolve.h.

Constructor & Destructor Documentation

HSolve::HSolve ( )

Definition at line 190 of file HSolve.cpp.

191  : dt_( 50e-6 )
192 {
193  ;
194 }
double dt_
Definition: HSolve.h:169
HSolve::~HSolve ( )

Definition at line 196 of file HSolve.cpp.

References unzombify().

197 {
198  unzombify();
199 }
void unzombify() const
Definition: HSolve.cpp:246

+ Here is the call graph for this function:

Member Function Documentation

void HSolve::addConc ( Id  id,
double  conc 
)

Definition at line 246 of file HSolveInterface.cpp.

References HSolveActive::externalCalcium_, and localIndex().

Referenced by ZombieHHChannel::vHandleConc().

247 {
248  unsigned int index = localIndex( id );
249  assert( index < externalCalcium_.size() );
250  externalCalcium_[ index ] = conc;
251 }
unsigned int localIndex(Id id) const
vector< double > externalCalcium_
Definition: HSolveActive.h:122

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::addGkEk ( Id  id,
double  v1,
double  v2 
)

Interface to compartments.

Definition at line 238 of file HSolveInterface.cpp.

References HSolveActive::externalCurrent_, and localIndex().

239 {
240  unsigned int index = localIndex( id );
241  assert( 2 * index + 1 < externalCurrent_.size() );
242  externalCurrent_[ 2 * index ] += Gk;
243  externalCurrent_[ 2 * index + 1 ] += Gk * Ek;
244 }
unsigned int localIndex(Id id) const
vector< double > externalCurrent_
Definition: HSolveActive.h:119

+ Here is the call graph for this function:

void HSolve::addInject ( Id  id,
double  value 
)

Definition at line 205 of file HSolveInterface.cpp.

References HSolvePassive::inject_, localIndex(), HinesMatrix::nCompt_, and value.

206 {
207  unsigned int index = localIndex( id );
208  // Not assert( index < inject_.size() ), because inject_ is a map.
209  assert( index < nCompt_ );
210  inject_[ index ].injectVarying += value;
211 }
uint32_t value
Definition: moosemodule.h:42
unsigned int nCompt_
Definition: HinesMatrix.h:70
unsigned int localIndex(Id id) const
map< unsigned int, InjectStruct > inject_
Definition: HSolvePassive.h:45

+ Here is the call graph for this function:

vector< Id > HSolve::children ( Id  obj)
staticprivate

Definition at line 381 of file HSolve.cpp.

References Neutral::children(), and Id::eref().

Referenced by deepSearchForCompartment().

382 {
383  //~ return Field< vector< Id > >::get( obj, "children" );
384  //~ return Field< vector< Id > >::fastGet( obj.eref(), "children" );
385  //~ return localGet< Neutral, vector< Id > >( obj.eref(), "children" );
386 
387  vector< Id > c;
388  Neutral::children( obj.eref(), c );
389  return c;
390 }
Eref eref() const
Definition: Id.cpp:125
static void children(const Eref &e, vector< Id > &ret)
Definition: Neutral.cpp:342

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Id HSolve::deepSearchForCompartment ( Id  base)
staticprivate

This function performs a depth-first search (for a compartment) in the tree with its root at 'base'. Returns (Id of) a compartment if found, else a blank Id.

Definition at line 329 of file HSolve.cpp.

References children(), Element::cinfo(), Id::element(), and Cinfo::isA().

Referenced by setPath().

330 {
331  /*
332  * 'cstack' is a stack-of-stacks used to perform the depth-first search.
333  * The 0th entry in 'cstack' is a stack containing simply the base.
334  * The i-th entry in 'cstack' contains children of the node at the top
335  * of the stack at position ( i - 1 ).
336  * Hence, at any time, the top of the i-th stack is the i-th node on
337  * the ancestral path from the 'base' node to the 'current' node
338  * (more below) which is being examined. Also, the remaining nodes in
339  * the i-th stack are the siblings of this ancestor.
340  *
341  * 'current' is the node at the top of the top of 'cstack'. If this node is
342  * a Compartment, then the search is completed, returning 'current'.
343  * Otherwise, the children of 'current' are pushed onto 'cstack' for a
344  * deeper search. If the deeper search yields nothing, then this
345  * 'current' node is discarded. When an entire stack of siblings is
346  * exhausted in this way, then this empty stack is discarded, and
347  * the search moves 1 level up.
348  *
349  * 'result' is a blank Id (moose root element) if the search failed.
350  * Otherwise, it is a compartment that was found under 'base'.
351  */
352  vector< vector< Id > > cstack( 1, vector< Id >( 1, base ) );
353  Id current;
354  Id result;
355 
356  while ( !cstack.empty() )
357  if ( cstack.back().empty() )
358  {
359  cstack.pop_back();
360 
361  if ( !cstack.empty() )
362  cstack.back().pop_back();
363  }
364  else
365  {
366  current = cstack.back().back();
367 
368  // if ( current()->cinfo() == moose::Compartment::initCinfo() )
369  // Compartment is base class for SymCompartment.
370  if ( current.element()->cinfo()->isA( "Compartment" ) )
371  {
372  result = current;
373  break;
374  }
375  cstack.push_back( children( current ) );
376  }
377 
378  return result;
379 }
static vector< Id > children(Id obj)
Definition: HSolve.cpp:381
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66
Definition: Id.h:17

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::deleteIncomingMessages ( Element orig,
const string  finfo 
)
static

Delete messages coming into this particular element if its class that is handled by HSolve

Utility function to delete incoming messages on orig. To be used in zombifying elements.

Definition at line 504 of file HSolve.cpp.

References ObjId::bad(), Element::cinfo(), Msg::deleteMsg(), Id::element(), Element::findCaller(), Cinfo::findFinfo(), Msg::findOtherEnd(), DestFinfo::getFid(), Msg::getMsg(), handledClasses(), Element::id(), ObjId::id, and Cinfo::name().

505 {
506  const DestFinfo * concenDest = dynamic_cast<const DestFinfo*>(orig->cinfo()->findFinfo(finfo));
507  assert(concenDest);
508  ObjId mid = orig->findCaller(concenDest->getFid());
509  while (! mid.bad())
510  {
511  const Msg * msg = Msg::getMsg(mid);
512  assert(msg);
513  ObjId other = msg->findOtherEnd(orig->id());
514  Element * otherEl = other.id.element();
515  if (otherEl && HSolve::handledClasses().find(otherEl->cinfo()->name()) != HSolve::handledClasses().end())
516  {
517  Msg::deleteMsg(mid);
518  }
519  else
520  {
521  break; // Have to do this otherwise it is an infinite loop
522  }
523  mid = orig->findCaller(concenDest->getFid());
524  }
525 }
virtual ObjId findOtherEnd(ObjId) const =0
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
bool bad() const
Definition: ObjId.cpp:18
static const std::set< string > & handledClasses()
Definition: HSolve.cpp:484
Id id
Definition: ObjId.h:98
Definition: ObjId.h:20
Id id() const
Definition: Element.cpp:71
const std::string & name() const
Definition: Cinfo.cpp:260
static void deleteMsg(ObjId mid)
Definition: Msg.cpp:52
ObjId findCaller(FuncId fid) const
Definition: Element.cpp:350
FuncId getFid() const
Definition: DestFinfo.cpp:45
const Cinfo * cinfo() const
Definition: Element.cpp:66
Definition: Msg.h:18
static const Msg * getMsg(ObjId m)
Definition: Msg.cpp:59
const Finfo * findFinfo(const string &name) const
Definition: Cinfo.cpp:224

+ Here is the call graph for this function:

double HSolve::getCa ( Id  id) const

Interface to CaConc.

Definition at line 445 of file HSolveInterface.cpp.

References HSolveActive::ca_, HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vGetCa().

446 {
447  unsigned int index = localIndex( id );
448  assert( index < caConc_.size() );
449  return ca_[ index ];
450 }
vector< double > ca_
Ca conc in each pool.
Definition: HSolveActive.h:81
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HSolve::getCaAdvance ( ) const

Definition at line 419 of file HSolve.cpp.

References HSolveActive::caAdvance_.

Referenced by initCinfo().

420 {
421  return caAdvance_;
422 }

+ Here is the caller graph for this function:

double HSolve::getCaBasal ( Id  id) const

Definition at line 474 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vGetCaBasal().

475 {
476  unsigned int index = localIndex( id );
477  assert( index < caConc_.size() );
478  return caConc_[ index ].CaBasal_;
479 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getCaCeiling ( Id  id) const

Definition at line 497 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vGetCeiling().

498 {
499  unsigned int index = localIndex( id );
500  assert( index < caConc_.size() );
501  return caConc_[ index ].ceiling_;
502 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int HSolve::getCaDiv ( ) const

Definition at line 459 of file HSolve.cpp.

References HSolveActive::caDiv_.

Referenced by initCinfo().

460 {
461  return caDiv_;
462 }

+ Here is the caller graph for this function:

double HSolve::getCaFloor ( Id  id) const

Definition at line 512 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vGetFloor().

513 {
514  unsigned int index = localIndex( id );
515  assert( index < caConc_.size() );
516  return caConc_[ index ].floor_;
517 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getCaMax ( ) const

Definition at line 479 of file HSolve.cpp.

References HSolveActive::caMax_.

Referenced by initCinfo().

480 {
481  return caMax_;
482 }
double caMax_
Definition: HSolveActive.h:67

+ Here is the caller graph for this function:

double HSolve::getCaMin ( ) const

Definition at line 469 of file HSolve.cpp.

References HSolveActive::caMin_.

Referenced by initCinfo().

470 {
471  return caMin_;
472 }
double caMin_
Definition: HSolveActive.h:66

+ Here is the caller graph for this function:

double HSolve::getCm ( Id  id) const

Definition at line 81 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::tree_.

82 {
83  unsigned int index = localIndex( id );
84  assert( index < tree_.size() );
85  return tree_[ index ].Cm;
86 }
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

double HSolve::getDt ( void  ) const

Definition at line 403 of file HSolve.cpp.

References dt_.

Referenced by initCinfo().

404 {
405  return dt_;
406 }
double dt_
Definition: HSolve.h:169

+ Here is the caller graph for this function:

double HSolve::getEk ( Id  id) const

Definition at line 294 of file HSolveInterface.cpp.

References HSolveActive::current_, and localIndex().

Referenced by ZombieHHChannel::vGetEk().

295 {
296  unsigned int index = localIndex( id );
297  assert( index < current_.size() );
298  return current_[ index ].Ek;
299 }
unsigned int localIndex(Id id) const
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getEm ( Id  id) const

Definition at line 96 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::tree_.

97 {
98  unsigned int index = localIndex( id );
99  assert( index < tree_.size() );
100  return tree_[ index ].Em;
101 }
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

double HSolve::getGk ( Id  id) const

Definition at line 308 of file HSolveInterface.cpp.

References HSolveActive::current_, and localIndex().

Referenced by ZombieHHChannel::vGetGk().

309 {
310  unsigned int index = localIndex( id );
311  assert( index < current_.size() );
312  return current_[ index ].Gk;
313 }
unsigned int localIndex(Id id) const
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getHHChannelGbar ( Id  id) const

Definition at line 279 of file HSolveInterface.cpp.

References HSolveActive::channel_, and localIndex().

Referenced by ZombieHHChannel::vGetGbar().

280 {
281  unsigned int index = localIndex( id );
282  assert( index < channel_.size() );
283  return channel_[ index ].Gbar_;
284 }
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getIa ( Id  id) const

Definition at line 177 of file HSolveInterface.cpp.

178 {
179  return 0;
180 }
double HSolve::getIk ( Id  id) const

Definition at line 322 of file HSolveInterface.cpp.

References HSolveActive::chan2compt_, HSolveActive::current_, localIndex(), and HSolvePassive::V_.

Referenced by ZombieHHChannel::vGetIk().

323 {
324  unsigned int index = localIndex( id );
325  assert( index < current_.size() );
326 
327  unsigned int comptIndex = chan2compt_[ index ];
328  assert( comptIndex < V_.size() );
329 
330  return ( current_[ index ].Ek - V_[ comptIndex ] ) * current_[ index ].Gk;
331 }
vector< double > V_
Definition: HSolvePassive.h:38
unsigned int localIndex(Id id) const
vector< unsigned int > chan2compt_
Definition: HSolveActive.h:114
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getIm ( Id  id) const

Definition at line 155 of file HSolveInterface.cpp.

References HSolvePassive::compartment_, HSolveActive::current_, HSolveActive::currentBoundary_, localIndex(), HinesMatrix::nCompt_, HSolvePassive::tree_, and HSolvePassive::V_.

156 {
157  unsigned int index = localIndex( id );
158  assert( index < nCompt_ );
159 
160  double Im =
161  compartment_[ index ].EmByRm - V_[ index ] / tree_[ index ].Rm;
162 
163  vector< CurrentStruct >::const_iterator icurrent;
164 
165  if ( index == 0 )
166  icurrent = current_.begin();
167  else
168  icurrent = currentBoundary_[ index - 1 ];
169 
170  for ( ; icurrent < currentBoundary_[ index ]; ++icurrent )
171  Im += ( icurrent->Ek - V_[ index ] ) * icurrent->Gk;
172 
173  return Im;
174 }
unsigned int nCompt_
Definition: HinesMatrix.h:70
vector< double > V_
Definition: HSolvePassive.h:38
vector< CompartmentStruct > compartment_
Definition: HSolvePassive.h:36
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41
vector< currentVecIter > currentBoundary_
Definition: HSolveActive.h:111
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

double HSolve::getInitVm ( Id  id) const

Definition at line 140 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::tree_.

141 {
142  unsigned int index = localIndex( id );
143  assert( index < tree_.size() );
144  return tree_[ index ].initVm;
145 }
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

double HSolve::getInject ( Id  id) const

Definition at line 182 of file HSolveInterface.cpp.

References HSolvePassive::inject_, localIndex(), and HinesMatrix::nCompt_.

183 {
184  unsigned int index = localIndex( id );
185  // Not assert( index < inject_.size() ), because inject_ is a map.
186  assert( index < nCompt_ );
187 
188  map< unsigned int, InjectStruct >::const_iterator i;
189 
190  i = inject_.find( index );
191  if ( i != inject_.end() )
192  return i->second.injectBasal;
193 
194  return 0.0;
195 }
unsigned int nCompt_
Definition: HinesMatrix.h:70
unsigned int localIndex(Id id) const
map< unsigned int, InjectStruct > inject_
Definition: HSolvePassive.h:45

+ Here is the call graph for this function:

int HSolve::getInstant ( Id  id) const

Definition at line 265 of file HSolveInterface.cpp.

References HSolveActive::channel_, and localIndex().

Referenced by ZombieHHChannel::vGetInstant().

266 {
267  unsigned int index = localIndex( id );
268  assert( index < channel_.size() );
269  return channel_[ index ].instant_;
270 }
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string HSolve::getPath ( const Eref e) const

Path to the compartments

Definition at line 319 of file HSolve.cpp.

References path_.

Referenced by initCinfo().

320 {
321  return path_;
322 }
string path_
Definition: HSolve.h:170

+ Here is the caller graph for this function:

double HSolve::getRa ( Id  id) const

Definition at line 126 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::tree_.

127 {
128  unsigned int index = localIndex( id );
129  assert( index < tree_.size() );
130  return tree_[ index ].Ra;
131 }
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

double HSolve::getRm ( Id  id) const

Definition at line 111 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::tree_.

112 {
113  unsigned int index = localIndex( id );
114  assert( index < tree_.size() );
115  return tree_[ index ].Rm;
116 }
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

Id HSolve::getSeed ( ) const

For searching for compartments: seed is the starting compt.

Definition at line 293 of file HSolve.cpp.

References seed_.

Referenced by initCinfo().

294 {
295  return seed_;
296 }
Id seed_
Definition: HSolve.h:171

+ Here is the caller graph for this function:

int HSolve::getVDiv ( ) const

Definition at line 429 of file HSolve.cpp.

References HSolveActive::vDiv_.

Referenced by initCinfo().

430 {
431  return vDiv_;
432 }

+ Here is the caller graph for this function:

double HSolve::getVm ( Id  id) const

Definition at line 66 of file HSolveInterface.cpp.

References localIndex(), and HSolvePassive::V_.

67 {
68  assert(this);
69  unsigned int index = localIndex( id );
70  assert( index < V_.size() );
71  return V_[ index ];
72 }
vector< double > V_
Definition: HSolvePassive.h:38
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

double HSolve::getVMax ( ) const

Definition at line 449 of file HSolve.cpp.

References HSolveActive::vMax_.

Referenced by initCinfo().

450 {
451  return vMax_;
452 }
double vMax_
Definition: HSolveActive.h:64

+ Here is the caller graph for this function:

double HSolve::getVMin ( ) const

Definition at line 439 of file HSolve.cpp.

References HSolveActive::vMin_.

Referenced by initCinfo().

440 {
441  return vMin_;
442 }
double vMin_
Definition: HSolveActive.h:63

+ Here is the caller graph for this function:

double HSolve::getX ( Id  id) const

Definition at line 333 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), and HSolveActive::state_.

Referenced by ZombieHHChannel::vGetX().

334 {
335  unsigned int index = localIndex( id );
336  assert( index < channel_.size() );
337 
338  if ( channel_[ index ].Xpower_ == 0.0 )
339  return 0.0;
340 
341  unsigned int stateIndex = chan2state_[ index ];
342  assert( stateIndex < state_.size() );
343 
344  return state_[ stateIndex ];
345 }
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getY ( Id  id) const

Definition at line 361 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), and HSolveActive::state_.

Referenced by ZombieHHChannel::vGetY().

362 {
363  unsigned int index = localIndex( id );
364  assert( index < channel_.size() );
365 
366  if ( channel_[ index ].Ypower_ == 0.0 )
367  return 0.0;
368 
369  unsigned int stateIndex = chan2state_[ index ];
370 
371  if ( channel_[ index ].Xpower_ > 0.0 )
372  ++stateIndex;
373 
374  assert( stateIndex < state_.size() );
375 
376  return state_[ stateIndex ];
377 }
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double HSolve::getZ ( Id  id) const

Definition at line 397 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), and HSolveActive::state_.

Referenced by ZombieHHChannel::vGetZ().

398 {
399  unsigned int index = localIndex( id );
400  assert( index < channel_.size() );
401 
402  if ( channel_[ index ].Zpower_ == 0.0 )
403  return 0.0;
404 
405  unsigned int stateIndex = chan2state_[ index ];
406 
407  if ( channel_[ index ].Xpower_ > 0.0 )
408  ++stateIndex;
409  if ( channel_[ index ].Ypower_ > 0.0 )
410  ++stateIndex;
411 
412  assert( stateIndex < state_.size() );
413 
414  return state_[ stateIndex ];
415 }
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const set< string > & HSolve::handledClasses ( )
static

Returns the set of classes "handled" by HSolve

Definition at line 484 of file HSolve.cpp.

Referenced by deleteIncomingMessages().

485 {
486  static set<string> classes;
487  if (classes.empty())
488  {
489  classes.insert("CaConc");
490  classes.insert("ZombieCaConc");
491  classes.insert("HHChannel");
492  classes.insert("ZombieHHChannel");
493  classes.insert("Compartment");
494  classes.insert("SymCompartment");
495  classes.insert("ZombieCompartment");
496  }
497  return classes;
498 }

+ Here is the caller graph for this function:

void HSolve::iCa ( Id  id,
double  iCa 
)

Definition at line 461 of file HSolveInterface.cpp.

References HSolveActive::caActivation_, HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vCurrent().

462 {
463  unsigned int index = localIndex( id );
464  assert( index < caConc_.size() );
465 
466  caActivation_[index] += iCa;
467 
468  /*
469  ca_[ index ] = Ca;
470  caConc_[ index ].setCa( Ca );
471  */
472 }
vector< double > caActivation_
calcium pool
Definition: HSolveActive.h:82
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const
void iCa(Id id, double iCa)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * HSolve::initCinfo ( )
static

Interface to external channels.

Definition at line 30 of file HSolve.cpp.

References getCaAdvance(), getCaDiv(), getCaMax(), getCaMin(), getDt(), getPath(), getSeed(), getVDiv(), getVMax(), getVMin(), hsolveCinfo, Neutral::initCinfo(), process(), reinit(), setCaAdvance(), setCaDiv(), setCaMax(), setCaMin(), setDt(), setPath(), setSeed(), setVDiv(), setVMax(), and setVMin().

31 {
32  static DestFinfo process(
33  "process",
34  "Handles 'process' call: Solver advances by one time-step.",
36  );
37 
38  static DestFinfo reinit(
39  "reinit",
40  "Handles 'reinit' call: Solver reads in model.",
42  );
43 
44  static Finfo* processShared[] =
45  {
46  &process,
47  &reinit
48  };
49 
50  static SharedFinfo proc(
51  "proc",
52  "Handles 'reinit' and 'process' calls from a clock.",
53  processShared,
54  sizeof( processShared ) / sizeof( Finfo* )
55  );
56 
57  static ValueFinfo< HSolve, Id > seed(
58  "seed",
59  "Use this field to specify path to a 'seed' compartment, that is, "
60  "any compartment within a neuron. The HSolve object uses this seed as "
61  "a handle to discover the rest of the neuronal model, which means all "
62  "the remaining compartments, channels, synapses, etc.",
65  );
66 
68  "target",
69  "Specifies the path to a compartmental model to be taken over. "
70  "This can be the path to any container object that has the model "
71  "under it (found by performing a deep search). Alternatively, this "
72  "can also be the path to any compartment within the neuron. This "
73  "compartment will be used as a handle to discover the rest of the "
74  "model, which means all the remaining compartments, channels, "
75  "synapses, etc.",
78  );
79 
81  "dt",
82  "The time-step for this solver.",
85  );
86 
87  static ValueFinfo< HSolve, int > caAdvance(
88  "caAdvance",
89  "This flag determines how current flowing into a calcium pool "
90  "is computed. A value of 0 means that the membrane potential at the "
91  "beginning of the time-step is used for the calculation. This is how "
92  "GENESIS does its computations. A value of 1 means the membrane "
93  "potential at the middle of the time-step is used. This is the "
94  "correct way of integration, and is the default way.",
97  );
98 
99  static ValueFinfo< HSolve, int > vDiv(
100  "vDiv",
101  "Specifies number of divisions for lookup tables of voltage-sensitive "
102  "channels.",
105  );
106 
107  static ValueFinfo< HSolve, double > vMin(
108  "vMin",
109  "Specifies the lower bound for lookup tables of voltage-sensitive "
110  "channels. Default is to automatically decide based on the tables of "
111  "the channels that the solver reads in.",
114  );
115 
116  static ValueFinfo< HSolve, double > vMax(
117  "vMax",
118  "Specifies the upper bound for lookup tables of voltage-sensitive "
119  "channels. Default is to automatically decide based on the tables of "
120  "the channels that the solver reads in.",
123  );
124 
125  static ValueFinfo< HSolve, int > caDiv(
126  "caDiv",
127  "Specifies number of divisions for lookup tables of calcium-sensitive "
128  "channels.",
131  );
132 
133  static ValueFinfo< HSolve, double > caMin(
134  "caMin",
135  "Specifies the lower bound for lookup tables of calcium-sensitive "
136  "channels. Default is to automatically decide based on the tables of "
137  "the channels that the solver reads in.",
140  );
141 
142  static ValueFinfo< HSolve, double > caMax(
143  "caMax",
144  "Specifies the upper bound for lookup tables of calcium-sensitive "
145  "channels. Default is to automatically decide based on the tables of "
146  "the channels that the solver reads in.",
149  );
150 
151  static Finfo* hsolveFinfos[] =
152  {
153  &seed, // Value
154  &target, // Value
155  &dt, // Value
156  &caAdvance, // Value
157  &vDiv, // Value
158  &vMin, // Value
159  &vMax, // Value
160  &caDiv, // Value
161  &caMin, // Value
162  &caMax, // Value
163  &proc, // Shared
164  };
165 
166  static string doc[] =
167  {
168  "Name", "HSolve",
169  "Author", "Niraj Dudani, 2007, NCBS",
170  "Description", "HSolve: Hines solver, for solving "
171  "branching neuron models.",
172  };
173 
174  static Dinfo< HSolve > dinfo;
175  static Cinfo hsolveCinfo(
176  "HSolve",
178  hsolveFinfos,
179  sizeof( hsolveFinfos ) / sizeof( Finfo* ),
180  &dinfo,
181  doc,
182  sizeof(doc)/sizeof(string)
183  );
184 
185  return &hsolveCinfo;
186 }
void setCaAdvance(int caAdvance)
Definition: HSolve.cpp:408
void process(const Eref &hsolve, ProcPtr p)
Definition: HSolve.cpp:206
Definition: Dinfo.h:60
void reinit(const Eref &hsolve, ProcPtr p)
Definition: HSolve.cpp:211
void setVMin(double vMin)
Definition: HSolve.cpp:434
string getPath(const Eref &e) const
Definition: HSolve.cpp:319
void setDt(double dt)
Definition: HSolve.cpp:392
double getCaMax() const
Definition: HSolve.cpp:479
void setCaMax(double caMax)
Definition: HSolve.cpp:474
int getCaDiv() const
Definition: HSolve.cpp:459
double getDt() const
Definition: HSolve.cpp:403
double getCaMin() const
Definition: HSolve.cpp:469
int getCaAdvance() const
Definition: HSolve.cpp:419
Id getSeed() const
Definition: HSolve.cpp:293
double getVMax() const
Definition: HSolve.cpp:449
void setVDiv(int vDiv)
Definition: HSolve.cpp:424
void setPath(const Eref &e, string path)
Definition: HSolve.cpp:298
void setSeed(Id seed)
Definition: HSolve.cpp:281
double getVMin() const
Definition: HSolve.cpp:439
int getVDiv() const
Definition: HSolve.cpp:429
void setCaMin(double caMin)
Definition: HSolve.cpp:464
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
void setCaDiv(int caDiv)
Definition: HSolve.cpp:454
static const Cinfo * hsolveCinfo
Definition: HSolve.cpp:188
Definition: Cinfo.h:18
void setVMax(double vMax)
Definition: HSolve.cpp:444
Definition: Finfo.h:12

+ Here is the call graph for this function:

unsigned int HSolve::localIndex ( Id  id) const
private

Definition at line 23 of file HSolveInterface.cpp.

References localIndex_.

Referenced by addConc(), addGkEk(), addInject(), getCa(), getCaBasal(), getCaCeiling(), getCaFloor(), getCm(), getEk(), getEm(), getGk(), getHHChannelGbar(), getIk(), getIm(), getInitVm(), getInject(), getInstant(), getRa(), getRm(), getVm(), getX(), getY(), getZ(), iCa(), setCa(), setCaBasal(), setCaCeiling(), setCaFloor(), setCm(), setEk(), setEm(), setGk(), setHHChannelGbar(), setHHmodulation(), setInitVm(), setInject(), setInstant(), setPowers(), setRa(), setRm(), setTauB(), setVm(), setX(), setY(), and setZ().

24 {
25  /* can easily replace with an array lookup with some holes, as
26  * done in the Stoich class. */
27  map< Id, unsigned int >::const_iterator i;
28 
29  i = localIndex_.find( id );
30  if ( i != localIndex_.end() )
31  return i->second;
32 
33  assert( 0 );
34 
35  return ~0;
36 }
map< Id, unsigned int > localIndex_
Definition: HSolve.h:167

+ Here is the caller graph for this function:

void HSolve::mapIds ( )
private

Definition at line 49 of file HSolveInterface.cpp.

References HSolveActive::caConcId_, HSolveActive::channelId_, and HSolvePassive::compartmentId_.

Referenced by setup().

50 {
52  mapIds( caConcId_ );
53  mapIds( channelId_ );
54  //~ mapIds( gateId_ );
55 
56  // Doesn't seem to be needed. Perhaps even the externalChannelId_ vector
57  // is not needed.
58  //~ for ( unsigned int ic = 0; ic < compartmentId_.size(); ++ic )
59  //~ mapIds( externalChannelId_[ ic ] );
60 }
vector< Id > compartmentId_
Definition: HSolvePassive.h:37
void mapIds()
vector< Id > channelId_
Used for localIndex-ing.
Definition: HSolveActive.h:124
vector< Id > caConcId_
calcium from difshells
Definition: HSolveActive.h:123

+ Here is the caller graph for this function:

void HSolve::mapIds ( vector< Id id)
private

Definition at line 38 of file HSolveInterface.cpp.

References localIndex_.

39 {
40  for ( unsigned int i = 0; i < id.size(); ++i )
41  {
42  // We don't expect these Id's to have been registered already.
43  assert( localIndex_.find( id[ i ] ) == localIndex_.end() );
44 
45  localIndex_[ id[ i ] ] = i;
46  }
47 }
map< Id, unsigned int > localIndex_
Definition: HSolve.h:167
void HSolve::process ( const Eref hsolve,
ProcPtr  p 
)

Definition at line 206 of file HSolve.cpp.

References HSolveActive::step().

Referenced by initCinfo().

207 {
208  this->HSolveActive::step( p );
209 }
void step(ProcPtr info)
Equivalent to process.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::reinit ( const Eref hsolve,
ProcPtr  p 
)

Definition at line 211 of file HSolve.cpp.

References ProcInfo::dt, dt_, and HSolveActive::reinit().

Referenced by initCinfo().

212 {
213  dt_ = p->dt;
214  this->HSolveActive::reinit( p );
215 }
void reinit(ProcPtr info)
double dt
Definition: ProcInfo.h:18
double dt_
Definition: HSolve.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setCa ( Id  id,
double  Ca 
)

Definition at line 452 of file HSolveInterface.cpp.

References HSolveActive::ca_, HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vSetCa(), and ZombieCaConc::vSetCaBasal().

453 {
454  unsigned int index = localIndex( id );
455  assert( index < caConc_.size() );
456 
457  ca_[ index ] = Ca;
458  caConc_[ index ].setCa( Ca );
459 }
vector< double > ca_
Ca conc in each pool.
Definition: HSolveActive.h:81
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setCaAdvance ( int  caAdvance)

Definition at line 408 of file HSolve.cpp.

References HSolveActive::caAdvance_.

Referenced by initCinfo().

409 {
410  if ( caAdvance != 0 && caAdvance != 1 )
411  {
412  cerr << "Error: HSolve: caAdvance should be either 0 or 1.\n";
413  return;
414  }
415 
416  caAdvance_ = caAdvance;
417 }

+ Here is the caller graph for this function:

void HSolve::setCaBasal ( Id  id,
double  CaBasal 
)

Definition at line 481 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

482 {
483  unsigned int index = localIndex( id );
484  assert( index < caConc_.size() );
485 
486  caConc_[ index ].setCaBasal( CaBasal );
487 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

void HSolve::setCaCeiling ( Id  id,
double  floor 
)

Definition at line 504 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vSetCeiling().

505 {
506  unsigned int index = localIndex( id );
507  assert( index < caConc_.size() );
508 
509  caConc_[ index ].ceiling_ = ceiling;
510 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setCaDiv ( int  caDiv)

Definition at line 454 of file HSolve.cpp.

References HSolveActive::caDiv_.

Referenced by initCinfo().

455 {
456  caDiv_ = caDiv;
457 }

+ Here is the caller graph for this function:

void HSolve::setCaFloor ( Id  id,
double  floor 
)

Definition at line 519 of file HSolveInterface.cpp.

References HSolveActive::caConc_, and localIndex().

Referenced by ZombieCaConc::vSetFloor().

520 {
521  unsigned int index = localIndex( id );
522  assert( index < caConc_.size() );
523 
524  caConc_[ index ].floor_ = floor;
525 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setCaMax ( double  caMax)

Definition at line 474 of file HSolve.cpp.

References HSolveActive::caMax_.

Referenced by initCinfo().

475 {
476  caMax_ = caMax;
477 }
double caMax_
Definition: HSolveActive.h:67

+ Here is the caller graph for this function:

void HSolve::setCaMin ( double  caMin)

Definition at line 464 of file HSolve.cpp.

References HSolveActive::caMin_.

Referenced by initCinfo().

465 {
466  caMin_ = caMin;
467 }
double caMin_
Definition: HSolveActive.h:66

+ Here is the caller graph for this function:

void HSolve::setCm ( Id  id,
double  value 
)

Definition at line 88 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::tree_, and value.

89 {
90  unsigned int index = localIndex( id );
91  assert( index < tree_.size() );
92  // Also update data structures used for calculations.
93  tree_[ index ].Cm = value;
94 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

void HSolve::setDt ( double  dt)

Definition at line 392 of file HSolve.cpp.

References dt_.

Referenced by initCinfo().

393 {
394  if ( dt < 0.0 )
395  {
396  cerr << "Error: HSolve: 'dt' must be positive.\n";
397  return;
398  }
399 
400  dt_ = dt;
401 }
double dt_
Definition: HSolve.h:169

+ Here is the caller graph for this function:

void HSolve::setEk ( Id  id,
double  value 
)

Definition at line 301 of file HSolveInterface.cpp.

References HSolveActive::current_, localIndex(), and value.

Referenced by ZombieHHChannel::vSetEk().

302 {
303  unsigned int index = localIndex( id );
304  assert( index < current_.size() );
305  current_[ index ].Ek = value;
306 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setEm ( Id  id,
double  value 
)

Definition at line 103 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::tree_, and value.

104 {
105  unsigned int index = localIndex( id );
106  assert( index < tree_.size() );
107  // Also update data structures used for calculations.
108  tree_[ index ].Em = value;
109 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

void HSolve::setGk ( Id  id,
double  value 
)

Definition at line 315 of file HSolveInterface.cpp.

References HSolveActive::current_, localIndex(), and value.

Referenced by ZombieHHChannel::vSetGk().

316 {
317  unsigned int index = localIndex( id );
318  assert( index < current_.size() );
319  current_[ index ].Gk = value;
320 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< CurrentStruct > current_
Channel current.
Definition: HSolveActive.h:73

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setHHChannelGbar ( Id  id,
double  value 
)

Definition at line 286 of file HSolveInterface.cpp.

References HSolveActive::channel_, localIndex(), and value.

Referenced by ZombieHHChannel::vSetGbar().

287 {
288  unsigned int index = localIndex( id );
289  assert( index < channel_.size() );
290  channel_[ index ].Gbar_ = value;
291 
292 }
uint32_t value
Definition: moosemodule.h:42
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setHHmodulation ( Id  id,
double  value 
)

Assign scale factor for HH channel conductance.

Definition at line 437 of file HSolveInterface.cpp.

References HSolveActive::channel_, localIndex(), and value.

Referenced by ZombieHHChannel::vSetModulation().

438 {
439  unsigned int index = localIndex( id );
440  assert( index < channel_.size() );
441  if ( value > 0.0 )
442  channel_[index].modulation_ = value;
443 }
uint32_t value
Definition: moosemodule.h:42
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setInitVm ( Id  id,
double  value 
)

Definition at line 147 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::tree_, and value.

148 {
149  unsigned int index = localIndex( id );
150  assert( index < tree_.size() );
151  tree_[ index ].initVm = value;
152 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

void HSolve::setInject ( Id  id,
double  value 
)

Definition at line 197 of file HSolveInterface.cpp.

References HSolvePassive::inject_, localIndex(), HinesMatrix::nCompt_, and value.

198 {
199  unsigned int index = localIndex( id );
200  // Not assert( index < inject_.size() ), because inject_ is a map.
201  assert( index < nCompt_ );
202  inject_[ index ].injectBasal = value;
203 }
uint32_t value
Definition: moosemodule.h:42
unsigned int nCompt_
Definition: HinesMatrix.h:70
unsigned int localIndex(Id id) const
map< unsigned int, InjectStruct > inject_
Definition: HSolvePassive.h:45

+ Here is the call graph for this function:

void HSolve::setInstant ( Id  id,
int  instant 
)

Definition at line 272 of file HSolveInterface.cpp.

References HSolveActive::channel_, and localIndex().

Referenced by ZombieHHChannel::vSetInstant().

273 {
274  unsigned int index = localIndex( id );
275  assert( index < channel_.size() );
276  channel_[ index ].instant_ = instant;
277 }
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setPath ( const Eref e,
string  path 
)

Definition at line 298 of file HSolve.cpp.

References deepSearchForCompartment(), dt_, path, path_, seed_, and setup().

Referenced by initCinfo().

299 {
300  if ( dt_ == 0.0 )
301  {
302  cerr << "Error: HSolve::setPath(): Must set 'dt' first.\n";
303  return;
304  }
305 
307 
308  if ( seed_ == Id() )
309  cerr << "Warning: HSolve::setPath(): No compartments found at or below '"
310  << path << "'.\n";
311  else
312  {
313  // cout << "HSolve: Seed compartment found at '" << seed_.path() << "'.\n";
314  path_ = path;
315  setup( hsolve );
316  }
317 }
Id seed_
Definition: HSolve.h:171
string path_
Definition: HSolve.h:170
void setup(Eref hsolve)
Definition: HSolve.cpp:268
Definition: Id.h:17
static Id deepSearchForCompartment(Id base)
Definition: HSolve.cpp:329
static char path[]
Definition: mfield.cpp:403
double dt_
Definition: HSolve.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setPowers ( Id  id,
double  Xpower,
double  Ypower,
double  Zpower 
)

Interface to channels.

Definition at line 254 of file HSolveInterface.cpp.

References HSolveActive::channel_, and localIndex().

Referenced by ZombieHHChannel::vSetXpower(), ZombieHHChannel::vSetYpower(), and ZombieHHChannel::vSetZpower().

259 {
260  unsigned int index = localIndex( id );
261  assert( index < channel_.size() );
262  channel_[ index ].setPowers( Xpower, Ypower, Zpower );
263 }
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setRa ( Id  id,
double  value 
)

Definition at line 133 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::tree_, and value.

134 {
135  unsigned int index = localIndex( id );
136  assert( index < tree_.size() );
137  tree_[ index ].Ra = value;
138 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

void HSolve::setRm ( Id  id,
double  value 
)

Definition at line 118 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::tree_, and value.

119 {
120  unsigned int index = localIndex( id );
121  assert( index < tree_.size() );
122  // Also update data structures used for calculations.
123  tree_[ index ].Rm = value;
124 }
uint32_t value
Definition: moosemodule.h:42
unsigned int localIndex(Id id) const
vector< TreeNodeStruct > tree_
Definition: HSolvePassive.h:41

+ Here is the call graph for this function:

void HSolve::setSeed ( Id  seed)

Definition at line 281 of file HSolve.cpp.

References Element::cinfo(), Id::element(), Cinfo::isA(), Id::path(), and seed_.

Referenced by initCinfo(), and Cell::setupSolver().

282 {
283  if ( !seed.element()->cinfo()->isA( "Compartment" ) )
284  {
285  cerr << "Error: HSolve::setSeed(): Seed object '" << seed.path()
286  << "' is not derived from type 'Compartment'." << endl;
287  return;
288  }
289 
290  seed_ = seed;
291 }
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
Id seed_
Definition: HSolve.h:171
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
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:

+ Here is the caller graph for this function:

void HSolve::setTauB ( Id  id,
double  tau,
double  B 
)

Definition at line 489 of file HSolveInterface.cpp.

References HSolveActive::caConc_, dt_, and localIndex().

Referenced by ZombieCaConc::vSetB(), and ZombieCaConc::vSetTau().

490 {
491  unsigned int index = localIndex( id );
492  assert( index < caConc_.size() );
493 
494  caConc_[ index ].setTauB( tau, B, dt_ );
495 }
vector< CaConcStruct > caConc_
Ca pool info.
Definition: HSolveActive.h:80
unsigned int localIndex(Id id) const
double dt_
Definition: HSolve.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setup ( Eref  hsolve)
private

Definition at line 268 of file HSolve.cpp.

References dt_, mapIds(), seed_, HSolveActive::setup(), and zombify().

Referenced by setPath().

269 {
270  // Setup solver.
271  this->HSolveActive::setup( seed_, dt_ );
272 
273  mapIds();
274  zombify( hsolve );
275 }
Id seed_
Definition: HSolve.h:171
void zombify(Eref hsolve) const
Definition: HSolve.cpp:217
void setup(Id seed, double dt)
void mapIds()
double dt_
Definition: HSolve.h:169

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setVDiv ( int  vDiv)

Definition at line 424 of file HSolve.cpp.

References HSolveActive::vDiv_.

Referenced by initCinfo().

425 {
426  vDiv_ = vDiv;
427 }

+ Here is the caller graph for this function:

void HSolve::setVm ( Id  id,
double  value 
)

Definition at line 74 of file HSolveInterface.cpp.

References localIndex(), HSolvePassive::V_, and value.

75 {
76  unsigned int index = localIndex( id );
77  assert( index < V_.size() );
78  V_[ index ] = value;
79 }
uint32_t value
Definition: moosemodule.h:42
vector< double > V_
Definition: HSolvePassive.h:38
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

void HSolve::setVMax ( double  vMax)

Definition at line 444 of file HSolve.cpp.

References HSolveActive::vMax_.

Referenced by initCinfo().

445 {
446  vMax_ = vMax;
447 }
double vMax_
Definition: HSolveActive.h:64

+ Here is the caller graph for this function:

void HSolve::setVMin ( double  vMin)

Definition at line 434 of file HSolve.cpp.

References HSolveActive::vMin_.

Referenced by initCinfo().

435 {
436  vMin_ = vMin;
437 }
double vMin_
Definition: HSolveActive.h:63

+ Here is the caller graph for this function:

void HSolve::setX ( Id  id,
double  value 
)

Definition at line 347 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), HSolveActive::state_, and value.

Referenced by ZombieHHChannel::vSetX().

348 {
349  unsigned int index = localIndex( id );
350  assert( index < channel_.size() );
351 
352  if ( channel_[ index ].Xpower_ == 0.0 )
353  return;
354 
355  unsigned int stateIndex = chan2state_[ index ];
356  assert( stateIndex < state_.size() );
357 
358  state_[ stateIndex ] = value;
359 }
uint32_t value
Definition: moosemodule.h:42
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setY ( Id  id,
double  value 
)

Definition at line 379 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), HSolveActive::state_, and value.

Referenced by ZombieHHChannel::vSetY().

380 {
381  unsigned int index = localIndex( id );
382  assert( index < channel_.size() );
383 
384  if ( channel_[ index ].Ypower_ == 0.0 )
385  return;
386 
387  unsigned int stateIndex = chan2state_[ index ];
388 
389  if ( channel_[ index ].Xpower_ > 0.0 )
390  ++stateIndex;
391 
392  assert( stateIndex < state_.size() );
393 
394  state_[ stateIndex ] = value;
395 }
uint32_t value
Definition: moosemodule.h:42
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::setZ ( Id  id,
double  value 
)

Definition at line 417 of file HSolveInterface.cpp.

References HSolveActive::chan2state_, HSolveActive::channel_, localIndex(), HSolveActive::state_, and value.

Referenced by ZombieHHChannel::vSetZ().

418 {
419  unsigned int index = localIndex( id );
420  assert( index < channel_.size() );
421 
422  if ( channel_[ index ].Zpower_ == 0.0 )
423  return;
424 
425  unsigned int stateIndex = chan2state_[ index ];
426 
427  if ( channel_[ index ].Xpower_ > 0.0 )
428  ++stateIndex;
429  if ( channel_[ index ].Ypower_ > 0.0 )
430  ++stateIndex;
431 
432  assert( stateIndex < state_.size() );
433 
434  state_[ stateIndex ] = value;
435 }
uint32_t value
Definition: moosemodule.h:42
vector< double > state_
Fraction of gates open.
Definition: HSolveActive.h:74
vector< unsigned int > chan2state_
a state index
Definition: HSolveActive.h:117
vector< ChannelStruct > channel_
to compartment: chan2compt
Definition: HSolveActive.h:76
unsigned int localIndex(Id id) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::unzombify ( ) const
private

Definition at line 246 of file HSolve.cpp.

References HSolveActive::caConcId_, HSolveActive::channelId_, HSolvePassive::compartmentId_, CaConc::initCinfo(), HHChannel::initCinfo(), CaConcBase::zombify(), and HHChannelBase::zombify().

Referenced by ~HSolve().

247 {
248  vector< Id >::const_iterator i;
249 
250  for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i )
251  if ( i->element() ) {
252  CompartmentBase::zombify( i->eref().element(),
253  Compartment::initCinfo(), Id() );
254  }
255 
256  for ( i = caConcId_.begin(); i != caConcId_.end(); ++i )
257  if ( i->element() ) {
258  CaConcBase::zombify( i->eref().element(), CaConc::initCinfo(), Id() );
259  }
260 
261  for ( i = channelId_.begin(); i != channelId_.end(); ++i )
262  if ( i->element() ) {
263  HHChannelBase::zombify( i->eref().element(),
264  HHChannel::initCinfo(), Id() );
265  }
266 }
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
Definition: CaConcBase.cpp:343
vector< Id > compartmentId_
Definition: HSolvePassive.h:37
static const Cinfo * initCinfo()
Definition: HHChannel.cpp:24
static const Cinfo * initCinfo()
Definition: CaConc.cpp:16
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
Definition: Id.h:17
vector< Id > channelId_
Used for localIndex-ing.
Definition: HSolveActive.h:124
vector< Id > caConcId_
calcium from difshells
Definition: HSolveActive.h:123

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HSolve::zombify ( Eref  hsolve) const
private

Definition at line 217 of file HSolve.cpp.

References HSolveActive::caConcId_, HSolveActive::channelId_, HSolvePassive::compartmentId_, Eref::id(), ZombieCaConc::initCinfo(), ZombieHHChannel::initCinfo(), ZombieCompartment::initCinfo(), CaConcBase::zombify(), and HHChannelBase::zombify().

Referenced by setup().

218 {
219  vector< Id >::const_iterator i;
220  vector< ObjId > temp;
221 
222  for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i )
223  temp.push_back( ObjId( *i, 0 ) );
224  for ( i = compartmentId_.begin(); i != compartmentId_.end(); ++i ) {
225  CompartmentBase::zombify( i->eref().element(),
226  ZombieCompartment::initCinfo(), hsolve.id() );
227  }
228 
229  temp.clear();
230  for ( i = caConcId_.begin(); i != caConcId_.end(); ++i )
231  temp.push_back( ObjId( *i, 0 ) );
232  // Shell::dropClockMsgs( temp, "process" );
233  for ( i = caConcId_.begin(); i != caConcId_.end(); ++i ) {
234  CaConcBase::zombify( i->eref().element(), ZombieCaConc::initCinfo(), hsolve.id() );
235  }
236 
237  temp.clear();
238  for ( i = channelId_.begin(); i != channelId_.end(); ++i )
239  temp.push_back( ObjId( *i, 0 ) );
240  for ( i = channelId_.begin(); i != channelId_.end(); ++i ) {
241  HHChannelBase::zombify( i->eref().element(),
242  ZombieHHChannel::initCinfo(), hsolve.id() );
243  }
244 }
Id id() const
Definition: Eref.cpp:62
static const Cinfo * initCinfo()
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
Definition: CaConcBase.cpp:343
static const Cinfo * initCinfo()
Definition: ObjId.h:20
vector< Id > compartmentId_
Definition: HSolvePassive.h:37
static const Cinfo * initCinfo()
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
vector< Id > channelId_
Used for localIndex-ing.
Definition: HSolveActive.h:124
vector< Id > caConcId_
calcium from difshells
Definition: HSolveActive.h:123

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

double HSolve::dt_
private

Definition at line 169 of file HSolve.h.

Referenced by getDt(), reinit(), setDt(), setPath(), setTauB(), and setup().

map< Id, unsigned int > HSolve::localIndex_
private

Definition at line 167 of file HSolve.h.

Referenced by localIndex(), and mapIds().

string HSolve::path_
private

Definition at line 170 of file HSolve.h.

Referenced by getPath(), and setPath().

Id HSolve::seed_
private

Definition at line 171 of file HSolve.h.

Referenced by getSeed(), setPath(), setSeed(), and setup().


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