MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
HHChannel2D.h
Go to the documentation of this file.
1 #ifndef _HHChannel2D_h
2 #define _HHChannel2D_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) 2003-2005 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 
21 // Ported to asyn13 on 2014-05-30 by Subhasis Ray
22 
23 typedef double ( *PFDD )( double, double );
24 class HHChannel2D: public ChanCommon
25 {
26 #ifdef DO_UNIT_TESTS
27  friend void testHHChannel2D();
28 #endif // DO_UNIT_TESTS
29 
30  public:
31  HHChannel2D();
32 
34  // Value field access function definitions
36  void setUseConcentration( int value );
37  int getUseConcentration( );
38  void setXindex( string index );
39  string getXindex() const;
40  void setYindex( string index );
41  string getYindex() const;
42  void setZindex( string index );
43  string getZindex() const;
44 
45  void setXpower( const Eref& e, double Xpower );
46  double getXpower( const Eref& e) const;
47  void setYpower( const Eref& e, double Ypower );
48  double getYpower( const Eref& e ) const;
49  void setZpower( const Eref& e, double Zpower );
50  double getZpower( const Eref& e ) const;
51  void setInstant( int Instant );
52  int getInstant() const;
53  void setX( double X );
54  double getX() const;
55  void setY( double Y );
56  double getY() const;
57  void setZ( double Z );
58  double getZ() const;
59 
61  HHGate2D* getXgate( unsigned int i );
63  HHGate2D* getYgate( unsigned int i );
65  HHGate2D* getZgate( unsigned int i );
67  void setNumGates( unsigned int num );
68 
73  unsigned int getNumXgates() const;
75  unsigned int getNumYgates() const;
77  unsigned int getNumZgates() const;
78 
80  // Dest function definitions
82 
94  void vProcess( const Eref& e, ProcPtr p );
95 
103  void vReinit( const Eref& e, ProcPtr p );
110  void conc1( double conc );
111  void conc2( double conc );
112 
113  double ( *takeXpower_ )( double, double );
114  double ( *takeYpower_ )( double, double );
115  double ( *takeZpower_ )( double, double );
116 
124  void createGate( const Eref& e, string gateType );
125 
127  void innerCreateGate(
128  const string& gateName,
129  HHGate2D** gatePtr, Id chanId, Id gateId );
130 
132  bool checkOriginal( Id chanId ) const;
133 
140  void destroyGate( const Eref& e, string gateType );
141 
145  void innerDestroyGate( const string& gateName,
146  HHGate2D** gatePtr, Id chanId );
147 
151  bool setGatePower( const Eref& e, double power,
152  double* assignee, const string& gateType );
153 
154  static PFDD selectPower( double power);
155 
156  static const Cinfo* initCinfo();
157 
158  private:
159  int dependency( string index, unsigned int dim );
160  double depValue( int dependency );
161  double integrate( double state, double dt, double A, double B );
162 
163  double Xpower_;
164  double Ypower_;
165  double Zpower_;
166 
168  int instant_;
169  double X_;
170  double Y_;
171  double Z_;
172 
177 
178  double g_;
179 
180  double conc1_;
181  double conc2_;
182 
183  string Xindex_;
184  string Yindex_;
185  string Zindex_;
186 
187  int Xdep0_;
188  int Xdep1_;
189  int Ydep0_;
190  int Ydep1_;
191  int Zdep0_;
192  int Zdep1_;
193 
202 
203  static const double EPSILON;
204  static const int INSTANT_X;
205  static const int INSTANT_Y;
206  static const int INSTANT_Z;
207 
208  static double power1( double x, double p ) {
209  return x;
210  }
211  static double power2( double x, double p ) {
212  return x * x;
213  }
214  static double power3( double x, double p ) {
215  return x * x * x;
216  }
217  static double power4( double x, double p ) {
218  return power2( x * x, p );
219  }
220  static double powerN( double x, double p );
221 };
222 
223 
224 #endif // _HHChannel2D_h
static const double EPSILON
HHGate2D for the zGate.
Definition: HHChannel2D.h:203
void setZindex(string index)
uint32_t value
Definition: moosemodule.h:42
static const int INSTANT_X
Definition: HHChannel2D.h:204
bool xInited_
State variable for Z gate.
Definition: HHChannel2D.h:176
double getZpower(const Eref &e) const
double depValue(int dependency)
string getYindex() const
HHGate2D * yGate_
Definition: HHChannel2D.h:200
static double power1(double x, double p)
Definition: HHChannel2D.h:208
bool setGatePower(const Eref &e, double power, double *assignee, const string &gateType)
void setX(double X)
double(* PFDD)(double, double)
Definition: HHChannel2D.h:23
void setYpower(const Eref &e, double Ypower)
int instant_
Exponent for Z gate.
Definition: HHChannel2D.h:168
double Y_
State variable for X gate.
Definition: HHChannel2D.h:170
void setInstant(int Instant)
double Ypower_
Exponent for X gate.
Definition: HHChannel2D.h:164
HHGate2D * xGate_
Definition: HHChannel2D.h:199
double(* takeZpower_)(double, double)
Definition: HHChannel2D.h:115
unsigned int getNumZgates() const
Returns 1 if Z gate present, otherwise 0.
void setZpower(const Eref &e, double Zpower)
void setXpower(const Eref &e, double Xpower)
void innerDestroyGate(const string &gateName, HHGate2D **gatePtr, Id chanId)
double getYpower(const Eref &e) const
HHGate2D * zGate_
HHGate2D for the yGate.
Definition: HHChannel2D.h:201
double Z_
State variable for Y gate.
Definition: HHChannel2D.h:171
static double power4(double x, double p)
Definition: HHChannel2D.h:217
void setXindex(string index)
int dependency(string index, unsigned int dim)
string Zindex_
Definition: HHChannel2D.h:185
void setY(double Y)
void vReinit(const Eref &e, ProcPtr p)
void innerCreateGate(const string &gateName, HHGate2D **gatePtr, Id chanId, Id gateId)
Inner utility function for creating the gate.
int getInstant() const
void setYindex(string index)
void conc1(double conc)
static double power2(double x, double p)
Definition: HHChannel2D.h:211
double getZ() const
void setZ(double Z)
static const Cinfo * initCinfo()
Definition: HHChannel2D.cpp:23
string Xindex_
Definition: HHChannel2D.h:183
double(* takeYpower_)(double, double)
Definition: HHChannel2D.h:114
double conc1_
Internal variable used to calculate conductance.
Definition: HHChannel2D.h:180
static PFDD selectPower(double power)
bool checkOriginal(Id chanId) const
Returns true if channel is original, false if copy.
HHGate2D * getYgate(unsigned int i)
Access function used for the Y gate. The index is ignored.
static const int INSTANT_Z
Definition: HHChannel2D.h:206
void createGate(const Eref &e, string gateType)
Definition: Eref.h:26
unsigned int getNumXgates() const
string getZindex() const
unsigned int getNumYgates() const
Returns 1 if Y gate present, otherwise 0.
void setNumGates(unsigned int num)
Dummy assignment function for the number of gates.
static double power3(double x, double p)
Definition: HHChannel2D.h:214
void conc2(double conc)
HHGate2D * getZgate(unsigned int i)
Access function used for the Z gate. The index is ignored.
void setUseConcentration(int value)
string Yindex_
Definition: HHChannel2D.h:184
double integrate(double state, double dt, double A, double B)
double getXpower(const Eref &e) const
HHGate2D * getXgate(unsigned int i)
Access function used for the X gate. The index is ignored.
Definition: Id.h:17
double Zpower_
Exponent for Y gate.
Definition: HHChannel2D.h:165
static const int INSTANT_Y
Definition: HHChannel2D.h:205
double conc2_
Definition: HHChannel2D.h:181
double getY() const
void vProcess(const Eref &e, ProcPtr p)
double Xpower_
Definition: HHChannel2D.h:163
string getXindex() const
static double powerN(double x, double p)
Definition: Cinfo.h:18
double(* takeXpower_)(double, double)
Definition: HHChannel2D.h:113
void destroyGate(const Eref &e, string gateType)
int getUseConcentration()
double getX() const