MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HHChannelBase.h
Go to the documentation of this file.
1 #ifndef _HHChannelBase_h
2 #define _HHChannelBase_h
3 /**********************************************************************
4 ** This program is part of 'MOOSE', the
5 ** Messaging Object Oriented Simulation Environment,
6 ** also known as GENESIS 3 base code.
7 ** copyright (C) 2014 Upinder S. Bhalla. and NCBS
8 ** It is made available under the terms of the
9 ** GNU Lesser General Public License version 2.1
10 ** See the file COPYING.LIB for the full notice.
11 *********************************************************************
12 */
13 
14 typedef double ( *PFDD )( double, double );
15 
24 class HHChannelBase: public virtual ChanBase
25 {
26  public:
27  HHChannelBase();
29 
31  // Value field access function definitions
33 
34  void setXpower( const Eref& e, double Xpower );
35  double getXpower( const Eref& e) const;
36  void setYpower( const Eref& e, double Ypower );
37  double getYpower( const Eref& e) const;
38  void setZpower( const Eref& e, double Zpower );
39  double getZpower( const Eref& e) const;
40  void setInstant( const Eref& e, int Instant );
41  int getInstant( const Eref& e ) const;
42  void setX( const Eref& e, double X );
43  double getX( const Eref& e ) const;
44  void setY( const Eref& e, double Y );
45  double getY( const Eref& e ) const;
46  void setZ( const Eref& e, double Z );
47  double getZ( const Eref& e ) const;
48  void setUseConcentration( const Eref& e, int value );
49  int getUseConcentration( const Eref& e ) const;
50  double vGetModulation( const Eref& e ) const;
52  // Dest function definitions
54 
60  void handleConc( const Eref& e, double conc );
61 
63  // Gate handling functions
65 
68  HHGate* getXgate( unsigned int i );
69 
73  HHGate* getYgate( unsigned int i );
74 
78  HHGate* getZgate( unsigned int i );
79 
83  void setNumGates( unsigned int num );
84 
89  unsigned int getNumXgates() const;
91  unsigned int getNumYgates() const;
93  unsigned int getNumZgates() const;
94 
102  void createGate( const Eref& e, string gateType );
104  // Virtual Value field access function definitions
106  virtual void vSetXpower( const Eref& e, double Xpower ) = 0;
107  virtual void vSetYpower( const Eref& e, double Ypower ) = 0;
108  virtual void vSetZpower( const Eref& e, double Zpower ) = 0;
109  // getXpower etc functions are implemented here in the baseclass.
110  virtual void vSetInstant( const Eref& e, int Instant ) = 0;
111  virtual int vGetInstant( const Eref& e ) const = 0;
112  virtual void vSetX( const Eref& e, double X ) = 0;
113  virtual double vGetX( const Eref& e ) const = 0;
114  virtual void vSetY( const Eref& e, double Y ) = 0;
115  virtual double vGetY( const Eref& e ) const = 0;
116  virtual void vSetZ( const Eref& e, double Z ) = 0;
117  virtual double vGetZ( const Eref& e ) const = 0;
118  virtual void vSetUseConcentration( const Eref& e, int value ) = 0;
119 
121  // Some more Virtual Value field functions from ChanBase,
122  // to be defined in derived classes. Listed here for clarity.
124  // void vSetGbar( double Gbar );
125  // double vGetGbar() const;
126  // void vSetEk( double Ek );
127  // double vGetEk() const;
128  // void vSetGk( double Gk );
129  // double vGetGk() const;
130  // void vSetIk( double Ic );
131  // double vGetIk() const;
132  // void vHandleVm( double Vm );
133 
135  // Virtual Dest function definitions
137  // void vProcess( const Eref& e, ProcPtr p ); // Listed for clarity
138  // void vReinit( const Eref& e, ProcPtr p ); // Listed for clarity
139 
140  virtual void vHandleConc( const Eref& e, double conc ) = 0;
141 
143  // Virtual Gate handling functions
145  virtual HHGate* vGetXgate( unsigned int i ) const = 0;
146  virtual HHGate* vGetYgate( unsigned int i ) const = 0;
147  virtual HHGate* vGetZgate( unsigned int i ) const = 0;
148  virtual void vCreateGate( const Eref& e, string gateType ) = 0;
149 
151  // Utility functions for taking integer powers.
153  static double power1( double x, double p ) {
154  return x;
155  }
156  static double power2( double x, double p ) {
157  return x * x;
158  }
159  static double power3( double x, double p ) {
160  return x * x * x;
161  }
162  static double power4( double x, double p ) {
163  return power2( x * x, p );
164  }
165  static double powerN( double x, double p );
166 
167  static PFDD selectPower( double power);
168 
170  // Zombification functions.
172  virtual void vSetSolver( const Eref& e, Id hsolve );
173  static void zombify( Element* orig, const Cinfo* zClass, Id hsolve);
174 
176  static const Cinfo* initCinfo();
177  protected:
179  double Xpower_;
181  double Ypower_;
183  double Zpower_;
186 
188  double modulation_;
189 };
190 
191 
192 #endif // _HHChannelBase_h
double getZpower(const Eref &e) const
uint32_t value
Definition: moosemodule.h:42
double getYpower(const Eref &e) const
Definition: HHGate.h:31
double modulation_
Value used to scale channel conductance up or down.
virtual void vSetY(const Eref &e, double Y)=0
virtual HHGate * vGetZgate(unsigned int i) const =0
virtual void vHandleConc(const Eref &e, double conc)=0
unsigned int getNumZgates() const
Returns 1 if Z gate present, otherwise 0.
virtual void vSetYpower(const Eref &e, double Ypower)=0
double Zpower_
Exponent for Z gate.
void setNumGates(unsigned int num)
void setInstant(const Eref &e, int Instant)
double vGetModulation(const Eref &e) const
static PFDD selectPower(double power)
void setY(const Eref &e, double Y)
unsigned int getNumYgates() const
Returns 1 if Y gate present, otherwise 0.
virtual void vCreateGate(const Eref &e, string gateType)=0
HHGate * getXgate(unsigned int i)
double getXpower(const Eref &e) const
void setUseConcentration(const Eref &e, int value)
HHGate * getZgate(unsigned int i)
unsigned int getNumXgates() const
virtual void vSetSolver(const Eref &e, Id hsolve)
virtual HHGate * vGetXgate(unsigned int i) const =0
double(* PFDD)(double, double)
Definition: HHChannelBase.h:14
virtual void vSetX(const Eref &e, double X)=0
double getY(const Eref &e) const
static double powerN(double x, double p)
void handleConc(const Eref &e, double conc)
static double power2(double x, double p)
void setZ(const Eref &e, double Z)
bool useConcentration_
Flag for use of conc for input to Z gate calculations.
static const Cinfo * initCinfo()
HHGate * getYgate(unsigned int i)
virtual double vGetX(const Eref &e) const =0
void createGate(const Eref &e, string gateType)
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
virtual void vSetZpower(const Eref &e, double Zpower)=0
void setYpower(const Eref &e, double Ypower)
virtual void vSetZ(const Eref &e, double Z)=0
Definition: Eref.h:26
virtual double vGetY(const Eref &e) const =0
virtual void vSetInstant(const Eref &e, int Instant)=0
void setX(const Eref &e, double X)
double Ypower_
Exponent for Y gate.
static double power4(double x, double p)
int getInstant(const Eref &e) const
int getUseConcentration(const Eref &e) const
static double power1(double x, double p)
virtual void vSetXpower(const Eref &e, double Xpower)=0
Definition: Id.h:17
double getX(const Eref &e) const
void setZpower(const Eref &e, double Zpower)
virtual int vGetInstant(const Eref &e) const =0
virtual double vGetZ(const Eref &e) const =0
virtual HHGate * vGetYgate(unsigned int i) const =0
void setXpower(const Eref &e, double Xpower)
double getZ(const Eref &e) const
virtual void vSetUseConcentration(const Eref &e, int value)=0
Definition: Cinfo.h:18
double Xpower_
Exponent for X gate.
static double power3(double x, double p)