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

#include <HHChannel.h>

+ Inheritance diagram for HHChannel:
+ Collaboration diagram for HHChannel:

Public Member Functions

bool checkOriginal (Id chanId) const
 Returns true if channel is original, false if copy. More...
 
void destroyGate (const Eref &e, string gateType)
 
 HHChannel ()
 
void innerCreateGate (const string &gateName, HHGate **gatePtr, Id chanId, Id gateId)
 Inner utility function for creating the gate. More...
 
void innerDestroyGate (const string &gateName, HHGate **gatePtr, Id chanId)
 
void innerSetXpower (double Xpower)
 
void innerSetYpower (double Ypower)
 
void innerSetZpower (double Zpower)
 
bool setGatePower (const Eref &e, double power, double *assignee, const string &gateType)
 
void vCreateGate (const Eref &e, string gateType)
 
int vGetInstant (const Eref &e) const
 
double vGetModulation (const Eref &e) const
 
double vGetX (const Eref &e) const
 
HHGatevGetXgate (unsigned int i) const
 
double vGetY (const Eref &e) const
 
HHGatevGetYgate (unsigned int i) const
 
double vGetZ (const Eref &e) const
 
HHGatevGetZgate (unsigned int i) const
 
void vHandleConc (const Eref &e, double conc)
 
void vProcess (const Eref &e, ProcPtr p)
 
void vReinit (const Eref &e, ProcPtr p)
 
void vSetInstant (const Eref &e, int Instant)
 
void vSetModulation (const Eref &e, double modulation)
 
void vSetUseConcentration (const Eref &e, int value)
 
void vSetX (const Eref &e, double X)
 
void vSetXpower (const Eref &e, double Xpower)
 
void vSetY (const Eref &e, double Y)
 
void vSetYpower (const Eref &e, double Ypower)
 
void vSetZ (const Eref &e, double Z)
 
void vSetZpower (const Eref &e, double Zpower)
 
 ~HHChannel ()
 
- Public Member Functions inherited from HHChannelBase
void createGate (const Eref &e, string gateType)
 
int getInstant (const Eref &e) const
 
unsigned int getNumXgates () const
 
unsigned int getNumYgates () const
 Returns 1 if Y gate present, otherwise 0. More...
 
unsigned int getNumZgates () const
 Returns 1 if Z gate present, otherwise 0. More...
 
int getUseConcentration (const Eref &e) const
 
double getX (const Eref &e) const
 
HHGategetXgate (unsigned int i)
 
double getXpower (const Eref &e) const
 
double getY (const Eref &e) const
 
HHGategetYgate (unsigned int i)
 
double getYpower (const Eref &e) const
 
double getZ (const Eref &e) const
 
HHGategetZgate (unsigned int i)
 
double getZpower (const Eref &e) const
 
void handleConc (const Eref &e, double conc)
 
 HHChannelBase ()
 
void setInstant (const Eref &e, int Instant)
 
void setNumGates (unsigned int num)
 
void setUseConcentration (const Eref &e, int value)
 
void setX (const Eref &e, double X)
 
void setXpower (const Eref &e, double Xpower)
 
void setY (const Eref &e, double Y)
 
void setYpower (const Eref &e, double Ypower)
 
void setZ (const Eref &e, double Z)
 
void setZpower (const Eref &e, double Zpower)
 
double vGetModulation (const Eref &e) const
 
virtual void vSetSolver (const Eref &e, Id hsolve)
 
 ~HHChannelBase ()
 
- Public Member Functions inherited from ChanBase
 ChanBase ()
 
double getEk (const Eref &e) const
 
double getGbar (const Eref &e) const
 
double getGk (const Eref &e) const
 
double getIk (const Eref &e) const
 
double getModulation (const Eref &e) const
 
void handleVm (double Vm)
 
void process (const Eref &e, const ProcPtr info)
 
void reinit (const Eref &e, const ProcPtr info)
 
void setEk (const Eref &e, double Ek)
 
void setGbar (const Eref &e, double Gbar)
 
void setGk (const Eref &e, double Gk)
 
void setIk (const Eref &e, double Ic)
 
void setModulation (const Eref &e, double modulation)
 
 ~ChanBase ()
 
- Public Member Functions inherited from ChanCommon
 ChanCommon ()
 
double getGbar () const
 Utility function to acces Gbar. More...
 
double getModulation () const
 
double getVm () const
 Utility function to access Vm. More...
 
void sendProcessMsgs (const Eref &e, const ProcPtr info)
 
void sendReinitMsgs (const Eref &e, const ProcPtr info)
 
void updateIk ()
 
double vGetEk (const Eref &e) const
 
double vGetGbar (const Eref &e) const
 
double vGetGk (const Eref &e) const
 
double vGetIk (const Eref &e) const
 
void vHandleVm (double Vm)
 
void vSetEk (const Eref &e, double Ek)
 
void vSetGbar (const Eref &e, double Gbar)
 
void vSetGk (const Eref &e, double Gk)
 
void vSetIk (const Eref &e, double Ic)
 
 ~ChanCommon ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from HHChannelBase
static const CinfoinitCinfo ()
 
static double power1 (double x, double p)
 
static double power2 (double x, double p)
 
static double power3 (double x, double p)
 
static double power4 (double x, double p)
 
static double powerN (double x, double p)
 
static PFDD selectPower (double power)
 
static void zombify (Element *orig, const Cinfo *zClass, Id hsolve)
 
- Static Public Member Functions inherited from ChanBase
static SrcFinfo2< double,
double > * 
channelOut ()
 
static SrcFinfo1< double > * IkOut ()
 
static const CinfoinitCinfo ()
 Specify the Class Info static variable for initialization. More...
 
static SrcFinfo1< double > * permeability ()
 
- Static Public Member Functions inherited from ChanCommon
static const CinfoinitCinfo ()
 Specify the Class Info static variable for initialization. More...
 

Private Member Functions

double integrate (double state, double dt, double A, double B)
 Internal variable used to calculate conductance. More...
 

Private Attributes

double conc_
 Conc_ is input variable for Ca-dependent channels. More...
 
double g_
 
int instant_
 bitmapped flag for X, Y, Z, to do equil calculation for gate More...
 
Id myId_
 
double(* takeXpower_ )(double, double)
 
double(* takeYpower_ )(double, double)
 
double(* takeZpower_ )(double, double)
 
double X_
 
HHGatexGate_
 
bool xInited_
 
double Y_
 State variable for Y gate. More...
 
HHGateyGate_
 HHGate data structure for the yGate. More...
 
bool yInited_
 
double Z_
 State variable for Z gate. More...
 
HHGatezGate_
 HHGate data structure for the yGate. More...
 
bool zInited_
 

Static Private Attributes

static const double EPSILON = 1.0e-10
 
static const int INSTANT_X = 1
 
static const int INSTANT_Y = 2
 
static const int INSTANT_Z = 4
 

Additional Inherited Members

- Protected Attributes inherited from HHChannelBase
double modulation_
 Value used to scale channel conductance up or down. More...
 
bool useConcentration_
 Flag for use of conc for input to Z gate calculations. More...
 
double Xpower_
 Exponent for X gate. More...
 
double Ypower_
 Exponent for Y gate. More...
 
double Zpower_
 Exponent for Z gate. More...
 
- Protected Attributes inherited from ChanCommon
double Vm_
 Vm_ is input variable from compartment, used for most rates. More...
 

Detailed Description

The HHChannel class sets up a Hodkin-Huxley type ion channel. The form used here is quite general and can handle up to 3 gates, named X, Y and Z. The Z gate can be a function of concentration as well as voltage. The gates are normally computed using the form

       alpha(V)

closed <---------—> open beta(V)

where the rates for the transition are alpha and beta, and both are functions of V. The state variables for each gate (X_, Y_, and Z_) are the fraction in the open state.

Gates can also be computed instantaneously, giving the instantaneous ratio of alpha to beta rather than solving the above conversion process. The actual functions alpha and beta are provided by an auxiliary class, the HHGate. The idea is that all copies of a channel share the same gate, thus saving a great deal of space. It also makes it possible to cleanly change the parameters of all the channels of a give class, all at once. Should one want to mutate a subset of channels, they just need to set up separate gates.

HHGates are implemented as a special category of FieldElement, so that they can be accessed as readonly pointers available to the HHChannel. The FieldElement containing the HHGate appears as a child Element of the HHChannel. The HHChannel Element can be an array; the associated HHGate is a singleton. So there has to be a local copy of the HHGate on each node.

Definition at line 48 of file HHChannel.h.

Constructor & Destructor Documentation

HHChannel::HHChannel ( )

Definition at line 58 of file HHChannel.cpp.

59  :
60  conc_( 0.0 ),
61  instant_( 0 ),
62  X_( 0.0 ), Y_( 0.0 ), Z_( 0.0 ),
63  xInited_( false ), yInited_( false ), zInited_( false ),
64  g_( 0.0 ),
65  xGate_( 0 ),
66  yGate_( 0 ),
67  zGate_( 0 ),
68  myId_()
69 {
70  ;
71 }
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
double conc_
Conc_ is input variable for Ca-dependent channels.
Definition: HHChannel.h:173
double X_
Definition: HHChannel.h:183
bool zInited_
Definition: HHChannel.h:189
double Z_
State variable for Z gate.
Definition: HHChannel.h:187
double g_
Definition: HHChannel.h:191
int instant_
bitmapped flag for X, Y, Z, to do equil calculation for gate
Definition: HHChannel.h:180
double Y_
State variable for Y gate.
Definition: HHChannel.h:185
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
bool yInited_
Definition: HHChannel.h:189
HHGate * xGate_
Definition: HHChannel.h:200
bool xInited_
Definition: HHChannel.h:189
HHChannel::~HHChannel ( )

Definition at line 73 of file HHChannel.cpp.

74 {
75  // if ( xGate_ && reinterpret_cast< char* >( this ) ==
76  // ObjId( xGate_->originalChannelId(), 0 ).data() )
77  // delete xGate_;
78  // if ( yGate_ && reinterpret_cast< char* >( this ) ==
79  // ObjId( yGate_->originalChannelId(), 0 ).data() )
80  // delete yGate_;
81  // if ( zGate_ && reinterpret_cast< char* >( this ) ==
82  // ObjId( zGate_->originalChannelId(), 0 ).data() )
83  // delete zGate_;
84 }

Member Function Documentation

bool HHChannel::checkOriginal ( Id  chanId) const

Returns true if channel is original, false if copy.

If the gate exists and has only this element for input, then change the gate power. If the gate exists and has multiple parents, then make a new gate, set its power. If the gate does not exist, make a new gate, set its power.

The function is designed with the idea that if copies of this channel are made, then they all point back to the original HHGate. (Unless they are cross-node copies). It is only if we subsequently alter the HHGate of this channel that we need to make our own variant of the HHGate, or disconnect from an existing one.

Definition at line 146 of file HHChannel.cpp.

References HHGate::isOriginalChannel(), xGate_, yGate_, and zGate_.

Referenced by destroyGate(), and vCreateGate().

147 {
148  bool isOriginal = 1;
149  if ( xGate_ ) {
150  isOriginal = xGate_->isOriginalChannel( chanId );
151  } else if ( yGate_ ) {
152  isOriginal = yGate_->isOriginalChannel( chanId );
153  } else if ( zGate_ ) {
154  isOriginal = zGate_->isOriginalChannel( chanId );
155  }
156  return isOriginal;
157 }
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
HHGate * xGate_
Definition: HHChannel.h:200
bool isOriginalChannel(Id id) const
Definition: HHGate.cpp:786

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HHChannel::destroyGate ( const Eref e,
string  gateType 
)

Utility function for destroying gate. Works only on original HHChannel. Somewhat dangerous, should never be used after a copy has been made as the pointer of the gate will be in use elsewhere.

Definition at line 202 of file HHChannel.cpp.

References checkOriginal(), Eref::id(), innerDestroyGate(), Id::path(), xGate_, yGate_, and zGate_.

204 {
205  if ( !checkOriginal( e.id() ) ) {
206  cout << "Warning: HHChannel::destroyGate: Not allowed from copied channel:\n" << e.id().path() << "\n";
207  return;
208  }
209 
210  if ( gateType == "X" )
211  innerDestroyGate( "xGate", &xGate_, e.id() );
212  else if ( gateType == "Y" )
213  innerDestroyGate( "yGate", &yGate_, e.id() );
214  else if ( gateType == "Z" )
215  innerDestroyGate( "zGate", &zGate_, e.id() );
216  else
217  cout << "Warning: HHChannel::destroyGate: Unknown gate type '" <<
218  gateType << "'. Ignored\n";
219 }
Id id() const
Definition: Eref.cpp:62
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
bool checkOriginal(Id chanId) const
Returns true if channel is original, false if copy.
Definition: HHChannel.cpp:146
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
HHGate * xGate_
Definition: HHChannel.h:200
void innerDestroyGate(const string &gateName, HHGate **gatePtr, Id chanId)
Definition: HHChannel.cpp:190

+ Here is the call graph for this function:

const Cinfo * HHChannel::initCinfo ( )
static

Definition at line 24 of file HHChannel.cpp.

References HHChannelBase::initCinfo().

Referenced by HSolve::unzombify().

25 {
27  static string doc[] =
28  {
29  "Name", "HHChannel",
30  "Author", "Upinder S. Bhalla, 2007, NCBS",
31  "Description", "HHChannel: Hodgkin-Huxley type voltage-gated Ion channel. Something "
32  "like the old tabchannel from GENESIS, but also presents "
33  "a similar interface as hhchan from GENESIS. ",
34  };
35 
36  static Dinfo< HHChannel > dinfo;
37 
38  static Cinfo HHChannelCinfo(
39  "HHChannel",
41  0,
42  0,
43  &dinfo,
44  doc,
45  sizeof(doc)/sizeof(string)
46  );
47 
48  return &HHChannelCinfo;
49 }
Definition: Dinfo.h:60
static const Cinfo * initCinfo()
Definition: Cinfo.h:18

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HHChannel::innerCreateGate ( const string &  gateName,
HHGate **  gatePtr,
Id  chanId,
Id  gateId 
)

Inner utility function for creating the gate.

Definition at line 159 of file HHChannel.cpp.

References Id::path().

Referenced by vCreateGate().

161 {
162  //Shell* shell = reinterpret_cast< Shell* >( ObjId( Id(), 0 ).data() );
163  if ( *gatePtr ) {
164  cout << "Warning: HHChannel::createGate: '" << gateName <<
165  "' on Element '" << chanId.path() << "' already present\n";
166  return;
167  }
168  *gatePtr = new HHGate( chanId, gateId );
169 }
Definition: HHGate.h:31
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HHChannel::innerDestroyGate ( const string &  gateName,
HHGate **  gatePtr,
Id  chanId 
)

Inner utility for destroying the gate

Definition at line 190 of file HHChannel.cpp.

References Id::path().

Referenced by destroyGate().

192 {
193  if ( *gatePtr == 0 ) {
194  cout << "Warning: HHChannel::destroyGate: '" << gateName <<
195  "' on Element '" << chanId.path() << "' not present\n";
196  return;
197  }
198  delete (*gatePtr);
199  *gatePtr = 0;
200 }
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HHChannel::innerSetXpower ( double  Xpower)
void HHChannel::innerSetYpower ( double  Ypower)
void HHChannel::innerSetZpower ( double  Zpower)
double HHChannel::integrate ( double  state,
double  dt,
double  A,
double  B 
)
private

Internal variable used to calculate conductance.

Returns the state variable for the new timestep based on the internal variables A_ and B_ which were passed in from the gate.

Definition at line 278 of file HHChannel.cpp.

References EPSILON.

Referenced by vProcess().

279 {
280  if ( B > EPSILON ) {
281  double x = exp( -B * dt );
282  return state * x + ( A / B ) * ( 1 - x );
283  }
284  return state + A * dt ;
285 }
static const double EPSILON
Definition: HHChannel.h:210

+ Here is the caller graph for this function:

bool HHChannel::setGatePower ( const Eref e,
double  power,
double *  assignee,
const string &  gateType 
)

Utility for altering gate powers

Definition at line 86 of file HHChannel.cpp.

References HHChannelBase::createGate(), and doubleEq().

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

88 {
89  if ( doubleEq( power, *assignee ) )
90  return false;
91 
92  if ( doubleEq( *assignee, 0.0 ) && power > 0 ) {
93  createGate( e, gateType );
94  } else if ( doubleEq( power, 0.0 ) ) {
95  // destroyGate( e, gateType );
96  }
97  *assignee = power;
98 
99  return true;
100 }
bool doubleEq(double x, double y)
Definition: doubleEq.cpp:16
void createGate(const Eref &e, string gateType)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void HHChannel::vCreateGate ( const Eref e,
string  gateType 
)
virtual

Implements HHChannelBase.

Definition at line 171 of file HHChannel.cpp.

References checkOriginal(), Eref::id(), innerCreateGate(), Id::path(), Id::value(), xGate_, yGate_, and zGate_.

173 {
174  if ( !checkOriginal( e.id() ) ) {
175  cout << "Warning: HHChannel::createGate: Not allowed from copied channel:\n" << e.id().path() << "\n";
176  return;
177  }
178 
179  if ( gateType == "X" )
180  innerCreateGate( "xGate", &xGate_, e.id(), Id(e.id().value() + 1) );
181  else if ( gateType == "Y" )
182  innerCreateGate( "yGate", &yGate_, e.id(), Id(e.id().value() + 2) );
183  else if ( gateType == "Z" )
184  innerCreateGate( "zGate", &zGate_, e.id(), Id(e.id().value() + 3) );
185  else
186  cout << "Warning: HHChannel::createGate: Unknown gate type '" <<
187  gateType << "'. Ignored\n";
188 }
Id id() const
Definition: Eref.cpp:62
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
unsigned int value() const
Definition: Id.cpp:197
bool checkOriginal(Id chanId) const
Returns true if channel is original, false if copy.
Definition: HHChannel.cpp:146
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
void innerCreateGate(const string &gateName, HHGate **gatePtr, Id chanId, Id gateId)
Inner utility function for creating the gate.
Definition: HHChannel.cpp:159
HHGate * xGate_
Definition: HHChannel.h:200
Definition: Id.h:17

+ Here is the call graph for this function:

int HHChannel::vGetInstant ( const Eref e) const
virtual

Implements HHChannelBase.

Definition at line 230 of file HHChannel.cpp.

References instant_.

231 {
232  return instant_;
233 }
int instant_
bitmapped flag for X, Y, Z, to do equil calculation for gate
Definition: HHChannel.h:180
double HHChannel::vGetModulation ( const Eref e) const
virtual

Reimplemented from ChanCommon.

Definition at line 411 of file HHChannel.cpp.

References HHChannelBase::modulation_.

412 {
414 }
double modulation_
Value used to scale channel conductance up or down.
double HHChannel::vGetX ( const Eref e) const
virtual

Implements HHChannelBase.

Definition at line 240 of file HHChannel.cpp.

References X_.

241 {
242  return X_;
243 }
double X_
Definition: HHChannel.h:183
HHGate * HHChannel::vGetXgate ( unsigned int  i) const
virtual

Access function used for the X gate. The index is ignored.

Implements HHChannelBase.

Definition at line 422 of file HHChannel.cpp.

References xGate_.

423 {
424  return xGate_;
425 }
HHGate * xGate_
Definition: HHChannel.h:200
double HHChannel::vGetY ( const Eref e) const
virtual

Implements HHChannelBase.

Definition at line 250 of file HHChannel.cpp.

References Y_.

251 {
252  return Y_;
253 }
double Y_
State variable for Y gate.
Definition: HHChannel.h:185
HHGate * HHChannel::vGetYgate ( unsigned int  i) const
virtual

Access function used for the Y gate. The index is ignored.

Implements HHChannelBase.

Definition at line 427 of file HHChannel.cpp.

References yGate_.

428 {
429  return yGate_;
430 }
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
double HHChannel::vGetZ ( const Eref e) const
virtual

Implements HHChannelBase.

Definition at line 260 of file HHChannel.cpp.

References Z_.

261 {
262  return Z_;
263 }
double Z_
State variable for Z gate.
Definition: HHChannel.h:187
HHGate * HHChannel::vGetZgate ( unsigned int  i) const
virtual

Access function used for the Z gate. The index is ignored.

Implements HHChannelBase.

Definition at line 432 of file HHChannel.cpp.

References zGate_.

433 {
434  return zGate_;
435 }
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
void HHChannel::vHandleConc ( const Eref e,
double  conc 
)
virtual

Assign the local Vm_ to the incoming Vm from the compartment void handleVm( double Vm ); Assign the local conc_ to the incoming conc from the concentration calculations for the compartment. Typically the message source will be a CaConc object, but there are other options for computing the conc.

Implements HHChannelBase.

Definition at line 400 of file HHChannel.cpp.

References conc_.

401 {
402  conc_ = conc;
403 }
double conc_
Conc_ is input variable for Ca-dependent channels.
Definition: HHChannel.h:173
void HHChannel::vProcess ( const Eref e,
ProcPtr  p 
)
virtual

processFunc handles the update and calculations every clock tick. It first sends the request for evaluation of the gate variables to the respective gate objects and recieves their response immediately through a return message. This is done so that many channel instances can share the same gate lookup tables, but do so cleanly. Such messages should never go to a remote node. Then the function does its own little calculations to send back to the parent compartment through regular messages.

Implements ChanBase.

Definition at line 287 of file HHChannel.cpp.

References conc_, ProcInfo::dt, g_, instant_, INSTANT_X, INSTANT_Y, INSTANT_Z, integrate(), HHGate::lookupBoth(), HHChannelBase::modulation_, ChanCommon::sendProcessMsgs(), takeXpower_, takeYpower_, takeZpower_, ChanCommon::updateIk(), HHChannelBase::useConcentration_, ChanCommon::vGetGbar(), ChanCommon::Vm_, ChanCommon::vSetGk(), X_, xGate_, HHChannelBase::Xpower_, Y_, yGate_, HHChannelBase::Ypower_, Z_, zGate_, and HHChannelBase::Zpower_.

288 {
289  g_ += ChanCommon::vGetGbar( e );
290  double A = 0;
291  double B = 0;
292  if ( Xpower_ > 0 ) {
293  xGate_->lookupBoth( Vm_, &A, &B );
294  if ( instant_ & INSTANT_X )
295  X_ = A/B;
296  else
297  X_ = integrate( X_, info->dt, A, B );
298  g_ *= takeXpower_( X_, Xpower_ );
299  }
300 
301  if ( Ypower_ > 0 ) {
302  yGate_->lookupBoth( Vm_, &A, &B );
303  if ( instant_ & INSTANT_Y )
304  Y_ = A/B;
305  else
306  Y_ = integrate( Y_, info->dt, A, B );
307 
308  g_ *= takeYpower_( Y_, Ypower_ );
309  }
310 
311  if ( Zpower_ > 0 ) {
312  if ( useConcentration_ )
313  zGate_->lookupBoth( conc_, &A, &B );
314  else
315  zGate_->lookupBoth( Vm_, &A, &B );
316  if ( instant_ & INSTANT_Z )
317  Z_ = A/B;
318  else
319  Z_ = integrate( Z_, info->dt, A, B );
320 
321  g_ *= takeZpower_( Z_, Zpower_ );
322  }
323 
326  // Gk_ = g_;
327  // Ik_ = ( Ek_ - Vm_ ) * g_;
328 
329  // Send out the relevant channel messages.
331 
332  g_ = 0.0;
333 }
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
double modulation_
Value used to scale channel conductance up or down.
static const int INSTANT_Y
Definition: HHChannel.h:212
double conc_
Conc_ is input variable for Ca-dependent channels.
Definition: HHChannel.h:173
double X_
Definition: HHChannel.h:183
double Zpower_
Exponent for Z gate.
double Z_
State variable for Z gate.
Definition: HHChannel.h:187
double(* takeXpower_)(double, double)
Definition: HHChannel.h:175
void updateIk()
Definition: ChanCommon.cpp:119
static const int INSTANT_Z
Definition: HHChannel.h:213
double g_
Definition: HHChannel.h:191
int instant_
bitmapped flag for X, Y, Z, to do equil calculation for gate
Definition: HHChannel.h:180
void lookupBoth(double v, double *A, double *B) const
Definition: HHGate.cpp:275
double(* takeZpower_)(double, double)
Definition: HHChannel.h:177
double Vm_
Vm_ is input variable from compartment, used for most rates.
Definition: ChanCommon.h:80
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
double Y_
State variable for Y gate.
Definition: HHChannel.h:185
void vSetGk(const Eref &e, double Gk)
Definition: ChanCommon.cpp:68
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
double vGetGbar(const Eref &e) const
Definition: ChanCommon.cpp:39
double integrate(double state, double dt, double A, double B)
Internal variable used to calculate conductance.
Definition: HHChannel.cpp:278
HHGate * xGate_
Definition: HHChannel.h:200
double Ypower_
Exponent for Y gate.
double(* takeYpower_)(double, double)
Definition: HHChannel.h:176
static const int INSTANT_X
Definition: HHChannel.h:211
void sendProcessMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:100
double Xpower_
Exponent for X gate.

+ Here is the call graph for this function:

void HHChannel::vReinit ( const Eref er,
ProcPtr  info 
)
virtual

Reinitializes the values for the channel. This involves computing the steady-state value for the channel gates using the provided Vm from the parent compartment. It involves a similar cycle through the gates and then updates to the parent compartment as for the processFunc.

Here we get the steady-state values for the gate (the 'instant' calculation) as A_/B_.

Implements ChanBase.

Definition at line 339 of file HHChannel.cpp.

References conc_, Eref::element(), EPSILON, g_, Element::getName(), HHGate::lookupBoth(), HHChannelBase::modulation_, ChanCommon::sendReinitMsgs(), takeXpower_, takeYpower_, takeZpower_, ChanCommon::updateIk(), HHChannelBase::useConcentration_, ChanCommon::vGetGbar(), ChanCommon::Vm_, ChanCommon::vSetGk(), X_, xGate_, xInited_, HHChannelBase::Xpower_, Y_, yGate_, yInited_, HHChannelBase::Ypower_, Z_, zGate_, zInited_, and HHChannelBase::Zpower_.

340 {
341  g_ = ChanCommon::vGetGbar( er );
342  Element* e = er.element();
343 
344  double A = 0.0;
345  double B = 0.0;
346  if ( Xpower_ > 0 ) {
347  assert( xGate_ );
348  xGate_->lookupBoth( Vm_, &A, &B );
349  if ( B < EPSILON ) {
350  cout << "Warning: B_ value for " << e->getName() <<
351  " is ~0. Check X table\n";
352  return;
353  }
354  if (!xInited_)
355  X_ = A/B;
356  g_ *= takeXpower_( X_, Xpower_ );
357  }
358 
359  if ( Ypower_ > 0 ) {
360  assert( yGate_ );
361  yGate_->lookupBoth( Vm_, &A, &B );
362  if ( B < EPSILON ) {
363  cout << "Warning: B value for " << e->getName() <<
364  " is ~0. Check Y table\n";
365  return;
366  }
367  if (!yInited_)
368  Y_ = A/B;
369  g_ *= takeYpower_( Y_, Ypower_ );
370  }
371 
372  if ( Zpower_ > 0 ) {
373  assert( zGate_ );
374  if ( useConcentration_ )
375  zGate_->lookupBoth( conc_, &A, &B );
376  else
377  zGate_->lookupBoth( Vm_, &A, &B );
378  if ( B < EPSILON ) {
379  cout << "Warning: B value for " << e->getName() <<
380  " is ~0. Check Z table\n";
381  return;
382  }
383  if (!zInited_)
384  Z_ = A/B;
385  g_ *= takeZpower_( Z_, Zpower_ );
386  }
387 
390  // Gk_ = g_;
391  // Ik_ = ( Ek_ - Vm_ ) * g_;
392 
393  // Send out the relevant channel messages.
394  // Same for reinit as for process.
395  ChanCommon::sendReinitMsgs( er, info );
396 
397  g_ = 0.0;
398 }
HHGate * zGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:206
double modulation_
Value used to scale channel conductance up or down.
double conc_
Conc_ is input variable for Ca-dependent channels.
Definition: HHChannel.h:173
double X_
Definition: HHChannel.h:183
bool zInited_
Definition: HHChannel.h:189
double Zpower_
Exponent for Z gate.
double Z_
State variable for Z gate.
Definition: HHChannel.h:187
Element * element() const
Definition: Eref.h:42
double(* takeXpower_)(double, double)
Definition: HHChannel.h:175
void updateIk()
Definition: ChanCommon.cpp:119
double g_
Definition: HHChannel.h:191
void lookupBoth(double v, double *A, double *B) const
Definition: HHGate.cpp:275
double(* takeZpower_)(double, double)
Definition: HHChannel.h:177
double Vm_
Vm_ is input variable from compartment, used for most rates.
Definition: ChanCommon.h:80
static const double EPSILON
Definition: HHChannel.h:210
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
double Y_
State variable for Y gate.
Definition: HHChannel.h:185
void vSetGk(const Eref &e, double Gk)
Definition: ChanCommon.cpp:68
HHGate * yGate_
HHGate data structure for the yGate.
Definition: HHChannel.h:203
bool yInited_
Definition: HHChannel.h:189
double vGetGbar(const Eref &e) const
Definition: ChanCommon.cpp:39
HHGate * xGate_
Definition: HHChannel.h:200
double Ypower_
Exponent for Y gate.
void sendReinitMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:111
double(* takeYpower_)(double, double)
Definition: HHChannel.h:176
bool xInited_
Definition: HHChannel.h:189
const string & getName() const
Definition: Element.cpp:56
double Xpower_
Exponent for X gate.

+ Here is the call graph for this function:

void HHChannel::vSetInstant ( const Eref e,
int  Instant 
)
virtual

Implements HHChannelBase.

Definition at line 225 of file HHChannel.cpp.

References instant_.

226 {
227  instant_ = instant;
228 }
int instant_
bitmapped flag for X, Y, Z, to do equil calculation for gate
Definition: HHChannel.h:180
void HHChannel::vSetModulation ( const Eref e,
double  modulation 
)
virtual

Reimplemented from ChanCommon.

Definition at line 405 of file HHChannel.cpp.

References HHChannelBase::modulation_.

406 {
407  if ( modulation > 0.0 )
408  HHChannelBase::modulation_ = modulation;
409 }
double modulation_
Value used to scale channel conductance up or down.
void HHChannel::vSetUseConcentration ( const Eref e,
int  value 
)
virtual

Implements HHChannelBase.

Definition at line 265 of file HHChannel.cpp.

References HHChannelBase::useConcentration_, and value.

266 {
268 }
uint32_t value
Definition: moosemodule.h:42
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
void HHChannel::vSetX ( const Eref e,
double  X 
)
virtual

Implements HHChannelBase.

Definition at line 235 of file HHChannel.cpp.

References X_, and xInited_.

236 {
237  X_ = X;
238  xInited_ = true;
239 }
double X_
Definition: HHChannel.h:183
bool xInited_
Definition: HHChannel.h:189
void HHChannel::vSetXpower ( const Eref e,
double  power 
)
virtual

Assigns the Xpower for this gate. If the gate exists and has only this element for input, then change the gate value. If the gate exists and has multiple parents, then make a new gate. If the gate does not exist, make a new gate

Implements HHChannelBase.

Definition at line 108 of file HHChannel.cpp.

References HHChannelBase::selectPower(), setGatePower(), takeXpower_, and HHChannelBase::Xpower_.

109 {
110  if ( setGatePower( e, power, &Xpower_, "X" ) )
111  takeXpower_ = selectPower( power );
112 }
static PFDD selectPower(double power)
double(* takeXpower_)(double, double)
Definition: HHChannel.h:175
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
Definition: HHChannel.cpp:86
double Xpower_
Exponent for X gate.

+ Here is the call graph for this function:

void HHChannel::vSetY ( const Eref e,
double  Y 
)
virtual

Implements HHChannelBase.

Definition at line 245 of file HHChannel.cpp.

References Y_, and yInited_.

246 {
247  Y_ = Y;
248  yInited_ = true;
249 }
double Y_
State variable for Y gate.
Definition: HHChannel.h:185
bool yInited_
Definition: HHChannel.h:189
void HHChannel::vSetYpower ( const Eref e,
double  Ypower 
)
virtual

Implements HHChannelBase.

Definition at line 114 of file HHChannel.cpp.

References HHChannelBase::selectPower(), setGatePower(), takeYpower_, and HHChannelBase::Ypower_.

115 {
116  if ( setGatePower( e, power, &Ypower_, "Y" ) )
117  takeYpower_ = selectPower( power );
118 }
static PFDD selectPower(double power)
double Ypower_
Exponent for Y gate.
double(* takeYpower_)(double, double)
Definition: HHChannel.h:176
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
Definition: HHChannel.cpp:86

+ Here is the call graph for this function:

void HHChannel::vSetZ ( const Eref e,
double  Z 
)
virtual

Implements HHChannelBase.

Definition at line 255 of file HHChannel.cpp.

References Z_, and zInited_.

256 {
257  Z_ = Z;
258  zInited_ = true;
259 }
bool zInited_
Definition: HHChannel.h:189
double Z_
State variable for Z gate.
Definition: HHChannel.h:187
void HHChannel::vSetZpower ( const Eref e,
double  Zpower 
)
virtual

Implements HHChannelBase.

Definition at line 120 of file HHChannel.cpp.

References HHChannelBase::selectPower(), setGatePower(), takeZpower_, HHChannelBase::useConcentration_, and HHChannelBase::Zpower_.

121 {
122  if ( setGatePower( e, power, &Zpower_, "Z" ) ) {
123  takeZpower_ = selectPower( power );
124  useConcentration_ = 1; // Not sure about this.
125  }
126 }
double Zpower_
Exponent for Z gate.
static PFDD selectPower(double power)
double(* takeZpower_)(double, double)
Definition: HHChannel.h:177
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
Definition: HHChannel.cpp:86

+ Here is the call graph for this function:

Member Data Documentation

double HHChannel::conc_
private

Conc_ is input variable for Ca-dependent channels.

Definition at line 173 of file HHChannel.h.

Referenced by vHandleConc(), vProcess(), and vReinit().

const double HHChannel::EPSILON = 1.0e-10
staticprivate

Definition at line 210 of file HHChannel.h.

Referenced by integrate(), and vReinit().

double HHChannel::g_
private

Definition at line 191 of file HHChannel.h.

Referenced by vProcess(), and vReinit().

int HHChannel::instant_
private

bitmapped flag for X, Y, Z, to do equil calculation for gate

Definition at line 180 of file HHChannel.h.

Referenced by vGetInstant(), vProcess(), and vSetInstant().

const int HHChannel::INSTANT_X = 1
staticprivate

Definition at line 211 of file HHChannel.h.

Referenced by vProcess().

const int HHChannel::INSTANT_Y = 2
staticprivate

Definition at line 212 of file HHChannel.h.

Referenced by vProcess().

const int HHChannel::INSTANT_Z = 4
staticprivate

Definition at line 213 of file HHChannel.h.

Referenced by vProcess().

Id HHChannel::myId_
private

Definition at line 208 of file HHChannel.h.

double( * HHChannel::takeXpower_)(double, double)
private

Definition at line 175 of file HHChannel.h.

Referenced by vProcess(), vReinit(), and vSetXpower().

double( * HHChannel::takeYpower_)(double, double)
private

Definition at line 176 of file HHChannel.h.

Referenced by vProcess(), vReinit(), and vSetYpower().

double( * HHChannel::takeZpower_)(double, double)
private

Definition at line 177 of file HHChannel.h.

Referenced by vProcess(), vReinit(), and vSetZpower().

double HHChannel::X_
private

Channel actual conductance depending on opening of gates. State variable for X gate

Definition at line 183 of file HHChannel.h.

Referenced by vGetX(), vProcess(), vReinit(), and vSetX().

HHGate* HHChannel::xGate_
private

HHGate data structure for the xGate. This is writable only on the HHChannel that originally created the HHGate, for others it must be treated as readonly.

Definition at line 200 of file HHChannel.h.

Referenced by checkOriginal(), destroyGate(), vCreateGate(), vGetXgate(), vProcess(), and vReinit().

bool HHChannel::xInited_
private

Definition at line 189 of file HHChannel.h.

Referenced by vReinit(), and vSetX().

double HHChannel::Y_
private

State variable for Y gate.

Definition at line 185 of file HHChannel.h.

Referenced by vGetY(), vProcess(), vReinit(), and vSetY().

HHGate* HHChannel::yGate_
private

HHGate data structure for the yGate.

Definition at line 203 of file HHChannel.h.

Referenced by checkOriginal(), destroyGate(), vCreateGate(), vGetYgate(), vProcess(), and vReinit().

bool HHChannel::yInited_
private

Definition at line 189 of file HHChannel.h.

Referenced by vReinit(), and vSetY().

double HHChannel::Z_
private

State variable for Z gate.

Definition at line 187 of file HHChannel.h.

Referenced by vGetZ(), vProcess(), vReinit(), and vSetZ().

HHGate* HHChannel::zGate_
private

HHGate data structure for the yGate.

Definition at line 206 of file HHChannel.h.

Referenced by checkOriginal(), destroyGate(), vCreateGate(), vGetZgate(), vProcess(), and vReinit().

bool HHChannel::zInited_
private

Definition at line 189 of file HHChannel.h.

Referenced by vReinit(), and vSetZ().


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