00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _COMPARTMENT_BASE_H
00012 #define _COMPARTMENT_BASE_H
00013
00014 #ifdef CYMOOSE
00015
00016 template<typename A>
00017 class SrcFinfo1;
00018
00019
00020 #endif
00021
00028 namespace moose
00029 {
00030 class CompartmentBase
00031 {
00032 public:
00033 CompartmentBase();
00034 virtual ~CompartmentBase();
00035
00036
00037 void setVm( const Eref& e, double Vm );
00038 double getVm( const Eref& e ) const;
00039 void setEm( const Eref& e, double Em );
00040 double getEm( const Eref& e ) const;
00041 void setCm( const Eref& e, double Cm );
00042 double getCm( const Eref& e ) const;
00043 void setRm( const Eref& e, double Rm );
00044 double getRm( const Eref& e ) const;
00045 void setRa( const Eref& e, double Ra );
00046 double getRa( const Eref& e ) const;
00047 double getIm( const Eref& e ) const;
00048 void setInject( const Eref& e, double Inject );
00049 double getInject( const Eref& e ) const;
00050 void setInitVm( const Eref& e, double initVm );
00051 double getInitVm( const Eref& e ) const;
00052 void setDiameter( double diameter );
00053 double getDiameter() const;
00054 void setLength( double length );
00055 double getLength() const;
00056 void setX0( double value );
00057 double getX0() const;
00058 void setY0( double value );
00059 double getY0() const;
00060 void setZ0( double value );
00061 double getZ0() const;
00062 void setX( double value );
00063 double getX() const;
00064 void setY( double value );
00065 double getY() const;
00066 void setZ( double value );
00067 double getZ() const;
00068
00069
00074 void process( const Eref& e, ProcPtr p );
00075
00079 void reinit( const Eref& e, ProcPtr p );
00080
00089 void initProc( const Eref& e, ProcPtr p );
00090
00095 void initReinit( const Eref& e, ProcPtr p );
00096
00101 void handleChannel( const Eref& e, double Gk, double Ek);
00102
00106 void handleRaxial( double Ra, double Vm);
00107
00111 void handleAxial( double Vm);
00112
00120 void injectMsg( const Eref& e, double current);
00121
00128 void randInject( const Eref& e, double prob, double current);
00129
00134 void cable();
00135
00137 void displace( double dx, double dy, double dz );
00138
00140 void setGeomAndElec( const Eref& e,
00141 double length, double dia );
00143
00144
00146
00147 virtual void vSetVm( const Eref& e, double Vm ) = 0;
00148 virtual double vGetVm( const Eref& e ) const = 0;
00149 virtual void vSetEm( const Eref& e, double Em ) = 0;
00150 virtual double vGetEm( const Eref& e ) const = 0;
00151 virtual void vSetCm( const Eref& e, double Cm ) = 0;
00152 virtual double vGetCm( const Eref& e ) const = 0;
00153 virtual void vSetRm( const Eref& e, double Rm ) = 0;
00154 virtual double vGetRm( const Eref& e ) const = 0;
00155 virtual void vSetRa( const Eref& e, double Ra ) = 0;
00156 virtual double vGetRa( const Eref& e ) const = 0;
00157 virtual double vGetIm( const Eref& e ) const = 0;
00158 virtual void vSetInject( const Eref& e, double Inject ) = 0;
00159 virtual double vGetInject( const Eref& e ) const = 0;
00160 virtual void vSetInitVm( const Eref& e, double initVm ) = 0;
00161 virtual double vGetInitVm( const Eref& e ) const = 0;
00162
00163
00168 virtual void vProcess( const Eref& e, ProcPtr p ) = 0;
00169
00173 virtual void vReinit( const Eref& e, ProcPtr p ) = 0;
00174
00183 virtual void vInitProc( const Eref& e, ProcPtr p ) = 0;
00184
00189 virtual void vInitReinit( const Eref& e, ProcPtr p ) = 0;
00190
00195 virtual void vHandleChannel( const Eref& e, double Gk, double Ek) = 0;
00196
00200 virtual void vHandleRaxial( double Ra, double Vm) = 0;
00201
00205 virtual void vHandleAxial( double Vm) = 0;
00206
00214 virtual void vInjectMsg( const Eref& e, double current) = 0;
00215
00222 virtual void vRandInject( const Eref& e, double prob, double current) = 0;
00223
00225
00227
00228 virtual void vSetSolver( const Eref& e, Id hsolve );
00229
00231
00235 bool rangeWarning( const string& field, double value );
00236
00240 void updateLength();
00241
00245 static const Cinfo* initCinfo();
00246
00253 static SrcFinfo1< double >* VmOut();
00254
00259 static void zombify( Element* orig, const Cinfo* zClass,
00260 Id hsolve );
00261 private:
00262 double diameter_;
00263 double length_;
00264 double x0_;
00265 double y0_;
00266 double z0_;
00267 double x_;
00268 double y_;
00269 double z_;
00270 };
00271 }
00272
00273
00274
00275 #endif // _COMPARTMENT_BASE_H