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

#include <MgBlock.h>

+ Inheritance diagram for MgBlock:
+ Collaboration diagram for MgBlock:

Public Member Functions

double getCMg () const
 
double getKMg_A () const
 
double getKMg_B () const
 
double getZk () const
 
 MgBlock ()
 
void origChannel (const Eref &e, double Gk, double Ek)
 
void setCMg (double CMg)
 
void setKMg_A (double Gbar)
 
void setKMg_B (double Ek)
 
void setZk (double Zk)
 
void vProcess (const Eref &e, ProcPtr p)
 
void vReinit (const Eref &e, ProcPtr p)
 
- 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
 
double vGetModulation (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)
 
void vSetModulation (const Eref &e, double modulation)
 
 ~ChanCommon ()
 
- 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 ()
 

Static Public Member Functions

static const CinfoinitCinfo ()
 
- Static Public Member Functions inherited from ChanCommon
static const CinfoinitCinfo ()
 Specify the Class Info static variable for initialization. More...
 
- 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 ()
 

Private Attributes

double CMg_
 [Mg] in mM More...
 
double KMg_A_
 1/eta More...
 
double KMg_B_
 1/gamma More...
 
double origGk_
 
double Zk_
 charge More...
 

Additional Inherited Members

- Protected Attributes inherited from ChanCommon
double Vm_
 Vm_ is input variable from compartment, used for most rates. More...
 

Detailed Description

Definition at line 16 of file MgBlock.h.

Constructor & Destructor Documentation

MgBlock::MgBlock ( )

Definition at line 89 of file MgBlock.cpp.

90  : Zk_( 0.0 ),
91  KMg_A_( 1.0 ), // These are NOT the same as the A, B state
92  KMg_B_( 1.0 ), // variables used for Exp Euler integration.
93  CMg_( 1.0 ), // Conc of Mg in mM
94  origGk_(0.0)
95 {;}
double Zk_
charge
Definition: MgBlock.h:69
double CMg_
[Mg] in mM
Definition: MgBlock.h:75
double origGk_
Definition: MgBlock.h:80
double KMg_A_
1/eta
Definition: MgBlock.h:71
double KMg_B_
1/gamma
Definition: MgBlock.h:73

Member Function Documentation

double MgBlock::getCMg ( ) const

Definition at line 133 of file MgBlock.cpp.

References CMg_.

Referenced by initCinfo().

134 {
135  return CMg_;
136 }
double CMg_
[Mg] in mM
Definition: MgBlock.h:75

+ Here is the caller graph for this function:

double MgBlock::getKMg_A ( ) const

Definition at line 109 of file MgBlock.cpp.

References KMg_A_.

Referenced by initCinfo().

110 {
111  return KMg_A_;
112 }
double KMg_A_
1/eta
Definition: MgBlock.h:71

+ Here is the caller graph for this function:

double MgBlock::getKMg_B ( ) const

Definition at line 121 of file MgBlock.cpp.

References KMg_B_.

Referenced by initCinfo().

122 {
123  return KMg_B_;
124 }
double KMg_B_
1/gamma
Definition: MgBlock.h:73

+ Here is the caller graph for this function:

double MgBlock::getZk ( ) const

Definition at line 137 of file MgBlock.cpp.

References Zk_.

Referenced by initCinfo().

138 {
139  return Zk_;
140 }
double Zk_
charge
Definition: MgBlock.h:69

+ Here is the caller graph for this function:

const Cinfo * MgBlock::initCinfo ( )
static

Definition at line 17 of file MgBlock.cpp.

References getCMg(), getKMg_A(), getKMg_B(), getZk(), ChanBase::initCinfo(), MgBlockCinfo, origChannel(), setCMg(), setKMg_A(), setKMg_B(), and setZk().

18 {
20  // Shared messages
23  // Dest definitions
25  static DestFinfo origChannel( "origChannel",
26  "",
28  );
30  // Field definitions
32  static ValueFinfo< MgBlock, double > KMg_A( "KMg_A",
33  "1/eta",
36  );
37  static ValueFinfo< MgBlock, double > KMg_B( "KMg_B",
38  "1/gamma",
41  );
42  static ValueFinfo< MgBlock, double > CMg( "CMg",
43  "[Mg] in mM",
46  );
47  static ValueFinfo< MgBlock, double > Zk( "Zk",
48  "Charge on ion",
51  );
53  static Finfo* MgBlockFinfos[] =
54  {
55  &origChannel, // Dest
56  &KMg_A, // Value
57  &KMg_B, // Value
58  &CMg, // Value
59  &Zk, // Value
60  };
61 
62  static string doc[] =
63  {
64  "Name", "MgBlock",
65  "Author", "Upinder S. Bhalla, 2007, NCBS",
66  "Description", "MgBlock: Hodgkin-Huxley type voltage-gated Ion channel. Something "
67  "like the old tabchannel from GENESIS, but also presents "
68  "a similar interface as hhchan from GENESIS. ",
69  };
70  static Dinfo< MgBlock > dinfo;
71  static Cinfo MgBlockCinfo(
72  "MgBlock",
74  MgBlockFinfos,
75  sizeof( MgBlockFinfos )/sizeof(Finfo *),
76  &dinfo,
77  doc,
78  sizeof( doc ) / sizeof( string )
79  );
80 
81  return &MgBlockCinfo;
82 }
void setKMg_B(double Ek)
Definition: MgBlock.cpp:113
static const Cinfo * MgBlockCinfo
Definition: MgBlock.cpp:84
void origChannel(const Eref &e, double Gk, double Ek)
Definition: MgBlock.cpp:178
Definition: Dinfo.h:60
double getKMg_B() const
Definition: MgBlock.cpp:121
double getKMg_A() const
Definition: MgBlock.cpp:109
double getCMg() const
Definition: MgBlock.cpp:133
void setCMg(double CMg)
Definition: MgBlock.cpp:125
void setKMg_A(double Gbar)
Definition: MgBlock.cpp:101
double getZk() const
Definition: MgBlock.cpp:137
void setZk(double Zk)
Definition: MgBlock.cpp:141
Definition: Cinfo.h:18
static const Cinfo * initCinfo()
Specify the Class Info static variable for initialization.
Definition: ChanBase.cpp:36
Definition: EpFunc.h:79
Definition: Finfo.h:12

+ Here is the call graph for this function:

void MgBlock::origChannel ( const Eref e,
double  Gk,
double  Ek 
)

Assign the local Vm_ to the incoming Vm from the compartment

Definition at line 178 of file MgBlock.cpp.

References origGk_, and ChanBase::setEk().

Referenced by initCinfo().

179 {
180  // setGk( Gk );
181  origGk_ = Gk;
182  setEk( e, Ek );
183 }
void setEk(const Eref &e, double Ek)
Definition: ChanBase.cpp:207
double origGk_
Definition: MgBlock.h:80

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MgBlock::setCMg ( double  CMg)

Definition at line 125 of file MgBlock.cpp.

References CMg_, and EPSILON.

Referenced by initCinfo().

126 {
127  if ( CMg < EPSILON ) {
128  cout << "Error: CMg = " << CMg << " must be > 0. Not set.\n";
129  } else {
130  CMg_ = CMg;
131  }
132 }
double CMg_
[Mg] in mM
Definition: MgBlock.h:75
const double EPSILON
Definition: MgBlock.cpp:15

+ Here is the caller graph for this function:

void MgBlock::setKMg_A ( double  Gbar)

Definition at line 101 of file MgBlock.cpp.

References EPSILON, and KMg_A_.

Referenced by initCinfo().

102 {
103  if ( KMg_A < EPSILON ) {
104  cout << "Error: KMg_A=" << KMg_A << " must be > 0. Not set.\n";
105  } else {
106  KMg_A_ = KMg_A;
107  }
108 }
const double EPSILON
Definition: MgBlock.cpp:15
double KMg_A_
1/eta
Definition: MgBlock.h:71

+ Here is the caller graph for this function:

void MgBlock::setKMg_B ( double  Ek)

Definition at line 113 of file MgBlock.cpp.

References EPSILON, and KMg_B_.

Referenced by initCinfo().

114 {
115  if ( KMg_B < EPSILON ) {
116  cout << "Error: KMg_B=" << KMg_B << " must be > 0. Not set.\n";
117  } else {
118  KMg_B_ = KMg_B;
119  }
120 }
const double EPSILON
Definition: MgBlock.cpp:15
double KMg_B_
1/gamma
Definition: MgBlock.h:73

+ Here is the caller graph for this function:

void MgBlock::setZk ( double  Zk)

Definition at line 141 of file MgBlock.cpp.

References Zk_.

Referenced by initCinfo().

142 {
143  Zk_ = Zk;
144 }
double Zk_
charge
Definition: MgBlock.h:69

+ Here is the caller graph for this function:

void MgBlock::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 150 of file MgBlock.cpp.

References CMg_, KMg_A_, KMg_B_, origGk_, ChanCommon::sendProcessMsgs(), ChanBase::setGk(), ChanCommon::updateIk(), and ChanCommon::Vm_.

151 {
152  double KMg = KMg_A_ * exp(Vm_/KMg_B_);
153  ChanBase::setGk( e, origGk_ * KMg / ( KMg + CMg_ ) );
154  // ChanBase::setGk( ChanBase::getGk() * KMg / ( KMg + CMg_ ) );
155  // Gk_ = Gk_ * KMg / (KMg + CMg_);
156 
157  updateIk();
158  // send2< double, double >( e, channelSlot, Gk_, Ek_ );
159  // Ik_ = Gk_ * (Ek_ - Vm_);
160  sendProcessMsgs( e, info );
161 }
double CMg_
[Mg] in mM
Definition: MgBlock.h:75
void updateIk()
Definition: ChanCommon.cpp:119
double origGk_
Definition: MgBlock.h:80
double KMg_A_
1/eta
Definition: MgBlock.h:71
void setGk(const Eref &e, double Gk)
Definition: ChanBase.cpp:216
double Vm_
Vm_ is input variable from compartment, used for most rates.
Definition: ChanCommon.h:80
void sendProcessMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:100
double KMg_B_
1/gamma
Definition: MgBlock.h:73

+ Here is the call graph for this function:

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

Implements ChanBase.

Definition at line 163 of file MgBlock.cpp.

References CMg_, EPSILON, KMg_A_, KMg_B_, ChanCommon::sendReinitMsgs(), and Zk_.

164 {
165  Zk_ = 0;
166  if ( CMg_ < EPSILON || KMg_B_ < EPSILON || KMg_A_ < EPSILON ) {
167  cout << "Error: MgBlock::innerReinitFunc: fields KMg_A, KMg_B, CMg\nmust be greater than zero. Resetting to 1 to avoid numerical errors\n";
168  if ( CMg_ < EPSILON ) CMg_ = 1.0;
169  if ( KMg_B_ < EPSILON ) KMg_B_ = 1.0;
170  if ( KMg_A_ < EPSILON ) KMg_A_ = 1.0;
171  }
172  sendReinitMsgs( e, info );
173 }
double Zk_
charge
Definition: MgBlock.h:69
double CMg_
[Mg] in mM
Definition: MgBlock.h:75
const double EPSILON
Definition: MgBlock.cpp:15
double KMg_A_
1/eta
Definition: MgBlock.h:71
void sendReinitMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:111
double KMg_B_
1/gamma
Definition: MgBlock.h:73

+ Here is the call graph for this function:

Member Data Documentation

double MgBlock::CMg_
private

[Mg] in mM

Definition at line 75 of file MgBlock.h.

Referenced by getCMg(), setCMg(), vProcess(), and vReinit().

double MgBlock::KMg_A_
private

1/eta

Definition at line 71 of file MgBlock.h.

Referenced by getKMg_A(), setKMg_A(), vProcess(), and vReinit().

double MgBlock::KMg_B_
private

1/gamma

Definition at line 73 of file MgBlock.h.

Referenced by getKMg_B(), setKMg_B(), vProcess(), and vReinit().

double MgBlock::origGk_
private

Original Gk passed by NMDA channel, we keep this separate from Gk so that the computed Gk can be recorded without being overwritten by origChannel message.

Definition at line 80 of file MgBlock.h.

Referenced by origChannel(), and vProcess().

double MgBlock::Zk_
private

charge

Definition at line 69 of file MgBlock.h.

Referenced by getZk(), setZk(), and vReinit().


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