00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _KSOLVE_H
00011 #define _KSOLVE_H
00012
00013 class Stoich;
00014
00015 class Ksolve: public ZombiePoolInterface
00016 {
00017 public:
00018 Ksolve();
00019 ~Ksolve();
00020
00022
00025 string getMethod() const;
00026 void setMethod( string method );
00027
00029 double getEpsAbs() const;
00030 void setEpsAbs( double val );
00031
00033 double getEpsRel() const;
00034 void setEpsRel( double val );
00035
00037 Id getStoich() const;
00038 void setStoich( Id stoich );
00039
00041 Id getDsolve() const;
00042 void setDsolve( Id dsolve );
00043
00044 unsigned int getNumLocalVoxels() const;
00045 unsigned int getNumAllVoxels() const;
00050 void setNumAllVoxels( unsigned int num );
00051
00053 vector< double > getNvec( unsigned int voxel) const;
00054 void setNvec( unsigned int voxel, vector< double > vec );
00055
00060 double getEstimatedDt() const;
00061
00063
00065 void process( const Eref& e, ProcPtr p );
00066 void reinit( const Eref& e, ProcPtr p );
00067 void initProc( const Eref& e, ProcPtr p );
00068 void initReinit( const Eref& e, ProcPtr p );
00074 void updateVoxelVol( vector< double > vols );
00076
00078
00080
00082 unsigned int getPoolIndex( const Eref& e ) const;
00083 unsigned int getVoxelIndex( const Eref& e ) const;
00084
00086
00088
00089 void setN( const Eref& e, double v );
00090 double getN( const Eref& e ) const;
00091 void setNinit( const Eref& e, double v );
00092 double getNinit( const Eref& e ) const;
00093 void setDiffConst( const Eref& e, double v );
00094 double getDiffConst( const Eref& e ) const;
00095
00101 void setNumPools( unsigned int num );
00102 unsigned int getNumPools() const;
00103 VoxelPoolsBase* pools( unsigned int i );
00104 double volume( unsigned int i ) const;
00105
00106 void getBlock( vector< double >& values ) const;
00107 void setBlock( const vector< double >& values );
00108
00109 void matchJunctionVols( vector< double >& vols, Id otherCompt )
00110 const;
00111
00116 void updateRateTerms( unsigned int index );
00117
00119
00121 void setupXfer( Id myKsolve, Id otherKsolve,
00122 unsigned int numProxyMols,
00123 const vector< VoxelJunction >& vj );
00124
00125 void assignXferIndex( unsigned int numProxyMols,
00126 unsigned int xferCompt,
00127 const vector< vector< unsigned int > >& voxy );
00128
00129 void assignXferVoxels( unsigned int xferCompt );
00130
00131 unsigned int assignProxyPools( const map< Id, vector< Id > >& xr,
00132 Id myKsolve, Id otherKsolve, Id otherComptId );
00133
00134 void buildCrossReacVolScaling( Id otherKsolve,
00135 const vector< VoxelJunction >& vj );
00137
00138 void print() const;
00139
00141 static SrcFinfo2< Id, vector< double > >* xComptOut();
00142 static const Cinfo* initCinfo();
00143 private:
00144 string method_;
00145 double epsAbs_;
00146 double epsRel_;
00154 vector< VoxelPools > pools_;
00155
00157 unsigned int startVoxel_;
00158
00160 Stoich* stoichPtr_;
00161
00165 Id dsolve_;
00166
00168 ZombiePoolInterface* dsolvePtr_;
00169 };
00170
00171 #endif // _KSOLVE_H