unsigned int getReactantVols( const Eref& reac, const SrcFinfo* pools, vector< double >& vols ) { static const unsigned int meshIndex = 0; const vector< MsgFuncBinding >* mfb = reac.element()->getMsgAndFunc( pools->getBindIndex() ); unsigned int smallIndex = 0; vols.resize( 0 ); if ( mfb ) { for ( unsigned int i = 0; i < mfb->size(); ++i ) { double v = 1; Element* pool = Msg::getMsg( (*mfb)[i].mid )->e2(); if ( pool == reac.element() ) pool = Msg::getMsg( (*mfb)[i].mid )->e1(); assert( pool != reac.element() ); Eref pooler( pool, meshIndex ); if ( pool->cinfo()->isA( "PoolBase" ) ) { v = lookupVolumeFromMesh( pooler ); } else { cout << "Error: getReactantVols: pool is of unknown type\n"; assert( 0 ); } vols.push_back( v ); if ( v < vols[0] ) smallIndex = i; } } return smallIndex; }
void PoolBase::setNinit( const Eref& e, double v ) { concInit_ = v / ( NA * lookupVolumeFromMesh( e ) ); vSetNinit( e, v ); }
void Pool::vSetConcInit( const Eref& e, double c ) { nInit_ = NA * c * lookupVolumeFromMesh( e ); }
double Pool::vGetVolume( const Eref& e ) const { return lookupVolumeFromMesh( e ); }
// Returns conc in millimolar. double Pool::vGetConc( const Eref& e ) const { return (n_ / NA) / lookupVolumeFromMesh( e ); }
// Do not get concInit from ZombiePool, the PoolBase handles it. // Reconsider this, since for arrays of ZombiePools we end up with problems // in that there is just a single PoolBase so all the concInits are // the same. Here is a reimplementation. double ZombiePool::vGetConcInit( const Eref& e ) const { return vGetNinit( e ) / (NA * lookupVolumeFromMesh( e ) ); }
void ZombiePool::vSetConcInit( const Eref& e, double conc ) { double n = NA * conc * lookupVolumeFromMesh( e ); vSetNinit( e, n ); }
void ZombiePool::vSetConc( const Eref& e, double conc ) { // unsigned int pool = convertIdToPoolIndex( e.id() ); double n = NA * conc * lookupVolumeFromMesh( e ); vSetN( e, n ); }
void BufPool::vSetConc( const Eref& e, double conc ) { double n = NA * conc * lookupVolumeFromMesh( e ); vSetN( e, n ); }