39 if ( compt ==
ObjId() )
59 vector< double >& vols )
61 static const unsigned int meshIndex = 0;
63 const vector< MsgFuncBinding >* mfb =
65 unsigned int smallIndex = 0;
69 for (
unsigned int i = 0; i < mfb->size(); ++i ) {
74 assert( pool != reac.
element() );
75 Eref pooler( pool, meshIndex );
76 if ( pool->
cinfo()->
isA(
"PoolBase" ) ) {
79 cout <<
"Error: getReactantVols: pool is of unknown type\n";
115 bool doPartialConversion )
117 vector< double > vols;
121 if ( vols.size() == 0 ) {
125 for (
unsigned int i = 0; i < vols.size(); ++i ) {
126 conv *= vols[i] *
NA;
128 if ( !doPartialConversion ) {
129 if ( pools->
name() ==
"subOut" ) {
130 conv /= vols[0] *
NA;
136 vector< double > subVols;
138 if ( subVols.size() == 0 )
140 conv /= subVols[0] *
NA;
161 double volume,
double scale,
bool doPartialConversion )
163 const vector< MsgFuncBinding >* mfb =
165 double conversion = 1.0;
166 if ( mfb && mfb->size() > 0 ) {
167 if ( doPartialConversion || mfb->size() > 1 ) {
168 conversion = scale *
NA * volume;
169 double power = doPartialConversion + mfb->size() - 1;
171 conversion = pow( conversion, power );
174 if ( conversion <= 0 )
188 double v2,
unsigned int n2,
double scale )
190 double conversion = 1.0;
192 for (
unsigned int i = 1; i < n1; ++i )
193 conversion *= scale *
NA * v1;
194 for (
unsigned int i = 0; i < n2; ++i )
195 conversion *= scale *
NA * v2;
197 if ( conversion <= 0 )
static ObjId parent(const Eref &e)
static A get(const ObjId &dest, const string &field, L index)
BindIndex getBindIndex() const
unsigned int dataIndex() const
unsigned int getReactantVols(const Eref &reac, const SrcFinfo *pools, vector< double > &vols)
const string & name() const
Element * element() const
double convertConcToNumRateUsingVol(const Eref &e, const SrcFinfo *pools, double volume, double scale, bool doPartialConversion)
bool isA(const string &ancestor) const
double convertConcToNumRateInTwoCompts(double v1, unsigned int n1, double v2, unsigned int n2, double scale)
const vector< MsgFuncBinding > * getMsgAndFunc(BindIndex b) const
const Cinfo * cinfo() const
double convertConcToNumRateUsingMesh(const Eref &e, const SrcFinfo *pools, bool doPartialConversion)
Element * element() const
static const Msg * getMsg(ObjId m)
const Finfo * findFinfo(const string &name) const
double lookupVolumeFromMesh(const Eref &e)