MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ChanCommon.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2007 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "ChanBase.h"
12 #include "ChanCommon.h"
13 
15 // Constructor
18  :
19  Vm_( 0.0 ),
20  Gbar_( 0.0 ), modulation_( 1.0 ),
21  Ek_( 0.0 ),
22  Gk_( 0.0 ), Ik_( 0.0 )
23 {
24  ;
25 }
26 
28 {;}
29 
31 // Field function definitions
33 
34 void ChanCommon::vSetGbar( const Eref& e, double Gbar )
35 {
36  Gbar_ = Gbar;
37 }
38 
39 double ChanCommon::vGetGbar( const Eref& e ) const
40 {
41  return Gbar_;
42 }
43 
44 void ChanCommon::vSetModulation( const Eref& e, double modulation )
45 {
46  modulation_ = modulation;
47 }
48 
49 double ChanCommon::vGetModulation( const Eref& e ) const
50 {
51  return modulation_;
52 }
53 
55 {
56  return modulation_;
57 }
58 
59 void ChanCommon::vSetEk( const Eref& e, double Ek )
60 {
61  Ek_ = Ek;
62 }
63 double ChanCommon::vGetEk( const Eref& e ) const
64 {
65  return Ek_;
66 }
67 
68 void ChanCommon::vSetGk( const Eref& e, double Gk )
69 {
70  Gk_ = Gk;
71 }
72 double ChanCommon::vGetGk( const Eref& e ) const
73 {
74  return Gk_;
75 }
76 
77 void ChanCommon::vSetIk( const Eref& e, double Ik )
78 {
79  Ik_ = Ik;
80 }
81 double ChanCommon::vGetIk( const Eref& e ) const
82 {
83  return Ik_;
84 }
85 
87 // Dest function definitions
89 
90 void ChanCommon::vHandleVm( double Vm )
91 {
92  Vm_ = Vm;
93 }
94 
96 // Looks like a dest function, but it is only called
97 // from the child class. Sends out various messages.
99 
101 {
102  ChanBase::channelOut()->send( e, Gk_, Ek_ );
103  // This is used if the channel connects up to a conc pool and
104  // handles influx of ions giving rise to a concentration change.
105  ChanBase::IkOut()->send( e, Ik_ );
106  // Needed by GHK-type objects
107  ChanBase::permeability()->send( e, Gk_ );
108 }
109 
110 
112 {
113  ChanBase::channelOut()->send( e, Gk_, Ek_ );
114  ChanBase::IkOut()->send( e, Ik_ );
115  // Needed by GHK-type objects
116  ChanBase::permeability()->send( e, Gk_ );
117 }
118 
120 {
121  Ik_ = ( Ek_ - Vm_ ) * Gk_;
122 }
123 
124 double ChanCommon::getVm() const
125 {
126  return Vm_;
127 }
128 
129 double ChanCommon::getGbar() const
130 {
131  return Gbar_;
132 }
double getVm() const
Utility function to access Vm.
Definition: ChanCommon.cpp:124
void vSetEk(const Eref &e, double Ek)
Definition: ChanCommon.cpp:59
double modulation_
Channel modulation. Scales conductance.
Definition: ChanCommon.h:86
double vGetModulation(const Eref &e) const
Definition: ChanCommon.cpp:49
void vHandleVm(double Vm)
Definition: ChanCommon.cpp:90
void vSetIk(const Eref &e, double Ic)
Definition: ChanCommon.cpp:77
void updateIk()
Definition: ChanCommon.cpp:119
static SrcFinfo1< double > * permeability()
Definition: ChanBase.cpp:14
double Vm_
Vm_ is input variable from compartment, used for most rates.
Definition: ChanCommon.h:80
double vGetEk(const Eref &e) const
Definition: ChanCommon.cpp:63
static SrcFinfo1< double > * IkOut()
Definition: ChanBase.cpp:28
double vGetIk(const Eref &e) const
Definition: ChanCommon.cpp:81
void vSetGk(const Eref &e, double Gk)
Definition: ChanCommon.cpp:68
Definition: Eref.h:26
double getGbar() const
Utility function to acces Gbar.
Definition: ChanCommon.cpp:129
double vGetGbar(const Eref &e) const
Definition: ChanCommon.cpp:39
void vSetModulation(const Eref &e, double modulation)
Definition: ChanCommon.cpp:44
double Gbar_
Channel maximal conductance.
Definition: ChanCommon.h:84
void sendReinitMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:111
double Gk_
Channel actual conductance depending on opening of gates.
Definition: ChanCommon.h:91
double getModulation() const
Definition: ChanCommon.cpp:54
double vGetGk(const Eref &e) const
Definition: ChanCommon.cpp:72
double Ek_
Reversal potential of channel.
Definition: ChanCommon.h:88
static SrcFinfo2< double, double > * channelOut()
Definition: ChanBase.cpp:21
double Ik_
Channel current.
Definition: ChanCommon.h:93
void vSetGbar(const Eref &e, double Gbar)
Definition: ChanCommon.cpp:34
void sendProcessMsgs(const Eref &e, const ProcPtr info)
Definition: ChanCommon.cpp:100