12 #include "../mesh/VoxelJunction.h"
43 S_.resize( totNumPools, 0.0 );
44 Sinit_.resize( totNumPools, 0.0);
99 for ( vector< double >::iterator
103 for ( vector< double >::iterator i =
S_.begin(); i !=
S_.end(); ++i )
112 double ratio,
const Stoich* stoichPtr )
115 for ( vector< double >::iterator
121 assert( end ==
Sinit_.size() );
122 for (
unsigned int i = start; i < end; ++i )
130 for (
unsigned int i = 0; i <
rates_.size(); ++i )
134 const vector< RateTerm* >& rates = stoichPtr->
getRateTerms();
135 rates_.resize( rates.size() );
136 for (
unsigned int i = 0; i < numCoreRates; ++i )
138 for (
unsigned int i = numCoreRates; i < rates.size(); ++i )
188 const vector< unsigned int >& poolIndex,
189 const vector< double >& values,
190 const vector< double >& lastValues,
191 unsigned int voxelIndex )
193 unsigned int offset = voxelIndex * poolIndex.size();
194 vector< double >::const_iterator i = values.begin() + offset;
195 vector< double >::const_iterator j = lastValues.begin() + offset;
196 for ( vector< unsigned int >::const_iterator
197 k = poolIndex.begin(); k != poolIndex.end(); ++k )
199 S_[*k] += *i++ - *j++;
204 const vector< unsigned int >& poolIndex,
205 const vector< double >& values,
206 unsigned int numProxyPools,
207 unsigned int voxelIndex )
209 unsigned int offset = voxelIndex * poolIndex.size();
210 vector< double >::const_iterator i = values.begin() + offset;
213 for ( vector< unsigned int >::const_iterator
214 k = poolIndex.begin(); k != poolIndex.end(); ++k )
228 unsigned int voxelIndex,
229 vector< double >& values,
230 const vector< unsigned int >& poolIndex)
232 unsigned int offset = voxelIndex * poolIndex.size();
233 vector< double >::iterator i = values.begin() + offset;
234 for ( vector< unsigned int >::const_iterator
235 k = poolIndex.begin(); k != poolIndex.end(); ++k )
242 unsigned int comptIndex,
Id otherComptId,
unsigned int voxel )
254 unsigned int comptIndex,
unsigned int transferIndex )
321 const vector< Id >& offSolverReacs,
322 const vector< pair< Id, Id > >& offSolverReacCompts )
324 assert (offSolverReacs.size() == offSolverReacCompts.size() );
326 for (
unsigned int i = 0; i < offSolverReacCompts.size(); ++i )
328 const pair< Id, Id >& p = offSolverReacCompts[i];
331 Id reacId = offSolverReacs[i];
341 assert( k <
rates_.size() );
342 if ( reacCinfo->
isA(
"ReacBase" ) )
348 if ( reacCinfo->
isA(
"CplxEnzBase" ) )
354 assert( k <
rates_.size() );
362 if ( reacCinfo->
isA(
"CplxEnzBase" ) )
365 assert( k <
rates_.size() );
378 cout <<
"S_.size=" <<
S_.size() <<
", volume = " <<
volume_ << endl;
385 cout <<
"ppv[" << i <<
"]=";
387 for (
unsigned int j = 0; j < ppv.size(); ++j )
389 cout <<
" " << ppv[j];
395 cout <<
"pti[" << i <<
"]=";
397 for (
unsigned int j = 0; j < pti.size(); ++j )
399 cout <<
" " << pti[j];
413 cout <<
"############## RATES ######################\n";
414 for (
unsigned int i = 0; i <
rates_.size(); ++i )
416 cout << i <<
" : " <<
rates_[i]->getR1() <<
", " <<
417 rates_[i]->getR2() << endl;
double getXreacScaleProducts(unsigned int i) const
const Stoich * stoichPtr_
double getDiffConst(unsigned int) const
void print() const
Debugging utility.
void addProxyTransferIndex(unsigned int comptIndex, unsigned int transferIndex)
Element * element() const
Synonym for Id::operator()()
vector< double > xReacScaleProducts_
double getNinit(unsigned int) const
double getVolume() const
Return the volume of the voxel.
vector< vector< unsigned int > > proxyTransferIndex_
void xferIn(const vector< unsigned int > &poolIndex, const vector< double > &values, const vector< double > &lastValues, unsigned int voxelIndex)
virtual ~VoxelPoolsBase()
bool isVoxelJunctionPresent(Id i1, Id i2) const
bool hasXfer(unsigned int comptIndex) const
True when this voxel has data to be transferred.
double getN(unsigned int) const
vector< double > & Svec()
Returns a handle to the mol # vector.
void setN(unsigned int i, double v)
void setDiffConst(unsigned int, double v)
void filterCrossRateTerms(const vector< Id > &offSolverReacs, const vector< pair< Id, Id > > &offSolverReacCompts)
double getXreacScaleSubstrates(unsigned int i) const
void resizeArrays(unsigned int totNumPools)
Allocate # of pools.
void xferOut(unsigned int voxelIndex, vector< double > &values, const vector< unsigned int > &poolIndex)
Assembles data values for sending out for x-compt reacs.
void xferInOnlyProxies(const vector< unsigned int > &poolIndex, const vector< double > &values, unsigned int numProxyPools, unsigned int voxelIndex)
unsigned int size() const
const double * Sinit() const
bool isA(const string &ancestor) const
void scaleVolsBufsRates(double ratio, const Stoich *stoichPtr)
const Cinfo * cinfo() const
void resetXreacScale(unsigned int size)
vector< double > xReacScaleSubstrates_
unsigned int getNumBufPools() const
Returns number of local buffered pools.
unsigned int getNumVarPools() const
Returns number of local pools that are updated by solver.
void setVolume(double vol)
Just assigns the volume without any cascading to other values.
bool isFuncTarget(unsigned int poolIndex) const
Returns true if the specified pool is controlled by a func.
void setNinit(unsigned int, double v)
unsigned int convertIdToReacIndex(Id id) const
static const Cinfo * reacCinfo
unsigned int getNumCoreRates() const
Number of rate terms for reactions purely on this compartment.
const vector< RateTerm * > & getRateTerms() const
Returns a reference to the entire rates_ vector.
virtual void setVolumeAndDependencies(double vol)
vector< vector< unsigned int > > proxyPoolVoxels_
void forwardReacVolumeFactor(unsigned int i, double volume)
unsigned int getNumProxyPools() const
map< Id, unsigned int > proxyComptMap_
vector< RateTerm * > rates_
void addProxyVoxy(unsigned int comptIndex, Id comptId, unsigned int voxel)
Adds the index of a voxel to which proxy data should go.
void backwardReacVolumeFactor(unsigned int i, double volume)