MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CompartmentBase.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment,
4 ** also known as GENESIS 3 base code.
5 ** copyright (C) 2003-2006 Upinder S. Bhalla. and NCBS
6 ** It is made available under the terms of the
7 ** GNU Lesser General Public License version 2.1
8 ** See the file COPYING.LIB for the full notice.
9 **********************************************************************/
10 
11 #ifndef _COMPARTMENT_BASE_H
12 #define _COMPARTMENT_BASE_H
13 
14 #ifdef CYMOOSE
15 
16 template<typename A>
17 class SrcFinfo1;
18 
19 
20 #endif /* ----- CYMOOSE ----- */
21 
28 namespace moose
29 {
31 {
32  public:
34  virtual ~CompartmentBase();
35 
36  // Value Field access function definitions.
37  void setVm( const Eref& e, double Vm );
38  double getVm( const Eref& e ) const;
39  void setEm( const Eref& e, double Em );
40  double getEm( const Eref& e ) const;
41  void setCm( const Eref& e, double Cm );
42  double getCm( const Eref& e ) const;
43  void setRm( const Eref& e, double Rm );
44  double getRm( const Eref& e ) const;
45  void setRa( const Eref& e, double Ra );
46  double getRa( const Eref& e ) const;
47  double getIm( const Eref& e ) const;
48  void setInject( const Eref& e, double Inject );
49  double getInject( const Eref& e ) const;
50  void setInitVm( const Eref& e, double initVm );
51  double getInitVm( const Eref& e ) const;
52  void setDiameter( double diameter );
53  double getDiameter() const;
54  void setLength( double length );
55  double getLength() const;
56  void setX0( double value );
57  double getX0() const;
58  void setY0( double value );
59  double getY0() const;
60  void setZ0( double value );
61  double getZ0() const;
62  void setX( double value );
63  double getX() const;
64  void setY( double value );
65  double getY() const;
66  void setZ( double value );
67  double getZ() const;
68 
69  // Dest function definitions.
74  void process( const Eref& e, ProcPtr p );
75 
79  void reinit( const Eref& e, ProcPtr p );
80 
89  void initProc( const Eref& e, ProcPtr p );
90 
95  void initReinit( const Eref& e, ProcPtr p );
96 
101  void handleChannel( const Eref& e, double Gk, double Ek);
102 
106  void handleRaxial( double Ra, double Vm);
107 
111  void handleAxial( double Vm);
112 
120  void injectMsg( const Eref& e, double current);
121 
128  void randInject( const Eref& e, double prob, double current);
129 
134  void cable();
135 
137  void displace( double dx, double dy, double dz );
138 
140  void setGeomAndElec( const Eref& e,
141  double length, double dia );
143  // Here we define the virtual functions for each of the above
144  // wrappers.
146  // Value Field access function definitions.
147  virtual void vSetVm( const Eref& e, double Vm ) = 0;
148  virtual double vGetVm( const Eref& e ) const = 0;
149  virtual void vSetEm( const Eref& e, double Em ) = 0;
150  virtual double vGetEm( const Eref& e ) const = 0;
151  virtual void vSetCm( const Eref& e, double Cm ) = 0;
152  virtual double vGetCm( const Eref& e ) const = 0;
153  virtual void vSetRm( const Eref& e, double Rm ) = 0;
154  virtual double vGetRm( const Eref& e ) const = 0;
155  virtual void vSetRa( const Eref& e, double Ra ) = 0;
156  virtual double vGetRa( const Eref& e ) const = 0;
157  virtual double vGetIm( const Eref& e ) const = 0;
158  virtual void vSetInject( const Eref& e, double Inject ) = 0;
159  virtual double vGetInject( const Eref& e ) const = 0;
160  virtual void vSetInitVm( const Eref& e, double initVm ) = 0;
161  virtual double vGetInitVm( const Eref& e ) const = 0;
162 
163  // Dest function definitions.
168  virtual void vProcess( const Eref& e, ProcPtr p ) = 0;
169 
173  virtual void vReinit( const Eref& e, ProcPtr p ) = 0;
174 
183  virtual void vInitProc( const Eref& e, ProcPtr p ) = 0;
184 
189  virtual void vInitReinit( const Eref& e, ProcPtr p ) = 0;
190 
195  virtual void vHandleChannel( const Eref& e, double Gk, double Ek) = 0;
196 
200  virtual void vHandleRaxial( double Ra, double Vm) = 0;
201 
205  virtual void vHandleAxial( double Vm) = 0;
206 
214  virtual void vInjectMsg( const Eref& e, double current) = 0;
215 
222  virtual void vRandInject( const Eref& e, double prob, double current) = 0;
223 
225  // Required for solver setup
227 
228  virtual void vSetSolver( const Eref& e, Id hsolve );
229 
231 
235  bool rangeWarning( const string& field, double value );
236 
240  void updateLength();
241 
245  static const Cinfo* initCinfo();
246 
253  static SrcFinfo1< double >* VmOut();
254 
259  static void zombify( Element* orig, const Cinfo* zClass,
260  Id hsolve );
261  private:
262  double diameter_;
263  double length_;
264  double x0_;
265  double y0_;
266  double z0_;
267  double x_;
268  double y_;
269  double z_;
270 };
271 }
272 
273 // Used by solver, readcell, etc.
274 
275 #endif // _COMPARTMENT_BASE_H
virtual void vInitProc(const Eref &e, ProcPtr p)=0
void setX(double value)
virtual void vHandleAxial(double Vm)=0
uint32_t value
Definition: moosemodule.h:42
double getVm(const Eref &e) const
void setVm(const Eref &e, double Vm)
void process(const Eref &e, ProcPtr p)
double getInject(const Eref &e) const
void setZ(double value)
double getEm(const Eref &e) const
virtual void vRandInject(const Eref &e, double prob, double current)=0
virtual void vSetInject(const Eref &e, double Inject)=0
void handleRaxial(double Ra, double Vm)
double getDiameter() const
void setLength(double length)
virtual void vSetCm(const Eref &e, double Cm)=0
virtual double vGetRm(const Eref &e) const =0
virtual double vGetInject(const Eref &e) const =0
virtual void vSetEm(const Eref &e, double Em)=0
virtual double vGetRa(const Eref &e) const =0
virtual void vSetVm(const Eref &e, double Vm)=0
bool rangeWarning(const string &field, double value)
void randInject(const Eref &e, double prob, double current)
virtual void vSetRm(const Eref &e, double Rm)=0
virtual double vGetCm(const Eref &e) const =0
virtual void vProcess(const Eref &e, ProcPtr p)=0
double getCm(const Eref &e) const
void setInitVm(const Eref &e, double initVm)
void setEm(const Eref &e, double Em)
virtual double vGetVm(const Eref &e) const =0
void setGeomAndElec(const Eref &e, double length, double dia)
Scales electrical values along with setting length, dia.
double getInitVm(const Eref &e) const
void handleChannel(const Eref &e, double Gk, double Ek)
void initReinit(const Eref &e, ProcPtr p)
virtual void vSetRa(const Eref &e, double Ra)=0
void initProc(const Eref &e, ProcPtr p)
void setCm(const Eref &e, double Cm)
double getIm(const Eref &e) const
virtual double vGetEm(const Eref &e) const =0
virtual void vHandleChannel(const Eref &e, double Gk, double Ek)=0
Definition: Eref.h:26
void displace(double dx, double dy, double dz)
Displaces compartment by specified distance vector.
void setInject(const Eref &e, double Inject)
virtual void vReinit(const Eref &e, ProcPtr p)=0
virtual double vGetIm(const Eref &e) const =0
void handleAxial(double Vm)
static void zombify(Element *orig, const Cinfo *zClass, Id hsolve)
void setZ0(double value)
static SrcFinfo1< double > * VmOut()
double getRa(const Eref &e) const
virtual void vInjectMsg(const Eref &e, double current)=0
virtual void vSetInitVm(const Eref &e, double initVm)=0
void setDiameter(double diameter)
Definition: Id.h:17
virtual void vInitReinit(const Eref &e, ProcPtr p)=0
void reinit(const Eref &e, ProcPtr p)
virtual void vHandleRaxial(double Ra, double Vm)=0
void injectMsg(const Eref &e, double current)
virtual double vGetInitVm(const Eref &e) const =0
void setRa(const Eref &e, double Ra)
void setX0(double value)
double getRm(const Eref &e) const
Definition: Cinfo.h:18
static const Cinfo * initCinfo()
void setRm(const Eref &e, double Rm)
virtual void vSetSolver(const Eref &e, Id hsolve)
void setY0(double value)
void setY(double value)