Example #1
0
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;
}
Example #2
0
void PoolBase::setNinit( const Eref& e, double v )
{
    concInit_ =  v / ( NA * lookupVolumeFromMesh( e ) );
    vSetNinit( e, v );
}
Example #3
0
void Pool::vSetConcInit( const Eref& e, double c )
{
	nInit_ = NA * c * lookupVolumeFromMesh( e );
}
Example #4
0
double Pool::vGetVolume( const Eref& e ) const
{
	return lookupVolumeFromMesh( e );
}
Example #5
0
// Returns conc in millimolar.
double Pool::vGetConc( const Eref& e ) const
{
	return (n_ / NA) / lookupVolumeFromMesh( e );
}
Example #6
0
// 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 ) );
}
Example #7
0
void ZombiePool::vSetConcInit( const Eref& e, double conc )
{
	double n = NA * conc * lookupVolumeFromMesh( e );
	vSetNinit( e, n );
}
Example #8
0
void ZombiePool::vSetConc( const Eref& e, double conc )
{
	// unsigned int pool = convertIdToPoolIndex( e.id() );
	double n = NA * conc * lookupVolumeFromMesh( e );
	vSetN( e, n );
}
Example #9
0
void BufPool::vSetConc( const Eref& e, double conc )
{
	double n = NA * conc * lookupVolumeFromMesh( e );
	vSetN( e, n );
}