MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <VoxelPoolsBase.h>
Public Member Functions | |
void | addProxyTransferIndex (unsigned int comptIndex, unsigned int transferIndex) |
void | addProxyVoxy (unsigned int comptIndex, Id comptId, unsigned int voxel) |
Adds the index of a voxel to which proxy data should go. More... | |
void | backwardReacVolumeFactor (unsigned int i, double volume) |
void | filterCrossRateTerms (const vector< Id > &offSolverReacs, const vector< pair< Id, Id > > &offSolverReacCompts) |
void | forwardReacVolumeFactor (unsigned int i, double volume) |
double | getDiffConst (unsigned int) const |
double | getN (unsigned int) const |
double | getNinit (unsigned int) const |
double | getVolume () const |
Return the volume of the voxel. More... | |
double | getXreacScaleProducts (unsigned int i) const |
double | getXreacScaleSubstrates (unsigned int i) const |
bool | hasXfer (unsigned int comptIndex) const |
True when this voxel has data to be transferred. More... | |
bool | isVoxelJunctionPresent (Id i1, Id i2) const |
void | print () const |
Debugging utility. More... | |
void | reinit () |
void | resetXreacScale (unsigned int size) |
void | resizeArrays (unsigned int totNumPools) |
Allocate # of pools. More... | |
const double * | S () const |
void | scaleVolsBufsRates (double ratio, const Stoich *stoichPtr) |
void | setDiffConst (unsigned int, double v) |
void | setN (unsigned int i, double v) |
void | setNinit (unsigned int, double v) |
void | setVolume (double vol) |
Just assigns the volume without any cascading to other values. More... | |
virtual void | setVolumeAndDependencies (double vol) |
const double * | Sinit () const |
unsigned int | size () const |
vector< double > & | Svec () |
Returns a handle to the mol # vector. More... | |
virtual void | updateAllRateTerms (const vector< RateTerm * > &rates, unsigned int numCoreRates)=0 |
virtual void | updateRateTerms (const vector< RateTerm * > &rates, unsigned int numCoreRates, unsigned int index)=0 |
double * | varS () |
double * | varSinit () |
VoxelPoolsBase () | |
void | xferIn (const vector< unsigned int > &poolIndex, const vector< double > &values, const vector< double > &lastValues, unsigned int voxelIndex) |
void | xferInOnlyProxies (const vector< unsigned int > &poolIndex, const vector< double > &values, unsigned int numProxyPools, unsigned int voxelIndex) |
void | xferOut (unsigned int voxelIndex, vector< double > &values, const vector< unsigned int > &poolIndex) |
Assembles data values for sending out for x-compt reacs. More... | |
virtual | ~VoxelPoolsBase () |
Protected Attributes | |
vector< RateTerm * > | rates_ |
const Stoich * | stoichPtr_ |
Private Attributes | |
map< Id, unsigned int > | proxyComptMap_ |
vector< vector< unsigned int > > | proxyPoolVoxels_ |
vector< vector< unsigned int > > | proxyTransferIndex_ |
vector< double > | S_ |
vector< double > | Sinit_ |
double | volume_ |
vector< double > | xReacScaleProducts_ |
vector< double > | xReacScaleSubstrates_ |
This is the base class for voxels used in reac-diffusion systems. Each voxel manages all the molecular pools that live in it. This is the S_ and Sinit_ vectors. Additionally, the last set of entries in S_ and Sinit_ refer to the proxy pools that participate in cross-node reactions, but are really located on other compartments.
Definition at line 31 of file VoxelPoolsBase.h.
VoxelPoolsBase::VoxelPoolsBase | ( | ) |
Definition at line 25 of file VoxelPoolsBase.cpp.
|
virtual |
Definition at line 34 of file VoxelPoolsBase.cpp.
void VoxelPoolsBase::addProxyTransferIndex | ( | unsigned int | comptIndex, |
unsigned int | transferIndex | ||
) |
Definition at line 253 of file VoxelPoolsBase.cpp.
References proxyTransferIndex_.
void VoxelPoolsBase::addProxyVoxy | ( | unsigned int | comptIndex, |
Id | comptId, | ||
unsigned int | voxel | ||
) |
Adds the index of a voxel to which proxy data should go.
Definition at line 241 of file VoxelPoolsBase.cpp.
References proxyComptMap_, and proxyPoolVoxels_.
void VoxelPoolsBase::backwardReacVolumeFactor | ( | unsigned int | i, |
double | volume | ||
) |
Multiply in scale factor for different cross-reac volumes, to be applied to specified RateTerm in the rates_ vector. Applies to backward reaction terms
Definition at line 299 of file VoxelPoolsBase.cpp.
References getVolume(), and xReacScaleProducts_.
void VoxelPoolsBase::filterCrossRateTerms | ( | const vector< Id > & | offSolverReacs, |
const vector< pair< Id, Id > > & | offSolverReacCompts | ||
) |
Changes cross rate terms to zero if there is no junction
Zeroes out rate terms that are involved in cross-reactions that are not present on current voxel.
Definition at line 320 of file VoxelPoolsBase.cpp.
References Element::cinfo(), Stoich::convertIdToReacIndex(), Id::element(), Stoich::getOneWay(), Cinfo::isA(), isVoxelJunctionPresent(), rates_, reacCinfo, and stoichPtr_.
void VoxelPoolsBase::forwardReacVolumeFactor | ( | unsigned int | i, |
double | volume | ||
) |
Multiply in scale factor for different cross-reac volumes, to be applied to specified RateTerm in the rates_ vector. Applies to forward reaction terms
Definition at line 292 of file VoxelPoolsBase.cpp.
References getVolume(), and xReacScaleSubstrates_.
double VoxelPoolsBase::getDiffConst | ( | unsigned int | i | ) | const |
Definition at line 179 of file VoxelPoolsBase.cpp.
double VoxelPoolsBase::getN | ( | unsigned int | i | ) | const |
Definition at line 157 of file VoxelPoolsBase.cpp.
References S_.
double VoxelPoolsBase::getNinit | ( | unsigned int | i | ) | const |
double VoxelPoolsBase::getVolume | ( | ) | const |
Return the volume of the voxel.
Definition at line 90 of file VoxelPoolsBase.cpp.
References volume_.
Referenced by backwardReacVolumeFactor(), forwardReacVolumeFactor(), scaleVolsBufsRates(), GssaVoxelPools::updateAllRateTerms(), and GssaVoxelPools::updateRateTerms().
double VoxelPoolsBase::getXreacScaleProducts | ( | unsigned int | i | ) | const |
Return scale factor for specified entry on rate terms. Index is # of cross-compartment rate term.
Definition at line 311 of file VoxelPoolsBase.cpp.
References xReacScaleProducts_.
Referenced by scaleVolsBufsRates(), GssaVoxelPools::updateAllRateTerms(), and GssaVoxelPools::updateRateTerms().
double VoxelPoolsBase::getXreacScaleSubstrates | ( | unsigned int | i | ) | const |
Return scale factor for specified entry on rate terms. Index is # of cross-compartment rate term.
Definition at line 306 of file VoxelPoolsBase.cpp.
References xReacScaleSubstrates_.
Referenced by scaleVolsBufsRates(), GssaVoxelPools::updateAllRateTerms(), and GssaVoxelPools::updateRateTerms().
bool VoxelPoolsBase::hasXfer | ( | unsigned int | comptIndex | ) | const |
True when this voxel has data to be transferred.
Assigns the Id and volume of the specified x-reac coupled compartment void setComptVolume( unsigned int comptIndex, Id id, double vol );
Definition at line 261 of file VoxelPoolsBase.cpp.
References proxyPoolVoxels_, and size().
True when there is a junction. i1 must match, and if i2 is non-zero then it too must match.
Definition at line 268 of file VoxelPoolsBase.cpp.
References proxyComptMap_.
Referenced by filterCrossRateTerms().
void VoxelPoolsBase::print | ( | ) | const |
Debugging utility.
Definition at line 376 of file VoxelPoolsBase.cpp.
References proxyPoolVoxels_, proxyTransferIndex_, rates_, S_, volume_, xReacScaleProducts_, and xReacScaleSubstrates_.
Referenced by VoxelPools::print().
void VoxelPoolsBase::reinit | ( | ) |
Assigns S = Sinit and sets up initial dt.
Definition at line 47 of file VoxelPoolsBase.cpp.
Referenced by VoxelPools::reinit(), GssaVoxelPools::reinit(), and VoxelPools::setStoich().
void VoxelPoolsBase::resetXreacScale | ( | unsigned int | size | ) |
Initialize/reset the vector xReacScaling_ for scale factors for each cross reaction in this voxel.
Definition at line 286 of file VoxelPoolsBase.cpp.
References xReacScaleProducts_, and xReacScaleSubstrates_.
void VoxelPoolsBase::resizeArrays | ( | unsigned int | totNumPools | ) |
Allocate # of pools.
Using the computed array sizes, now allocate space for them.
Definition at line 41 of file VoxelPoolsBase.cpp.
const double * VoxelPoolsBase::S | ( | ) | const |
Returns the array of doubles of current mol #s at the specified mesh index
Definition at line 55 of file VoxelPoolsBase.cpp.
References S_.
Referenced by GssaVoxelPools::refreshAtot(), and GssaVoxelPools::updateDependentRates().
void VoxelPoolsBase::scaleVolsBufsRates | ( | double | ratio, |
const Stoich * | stoichPtr | ||
) |
Definition at line 111 of file VoxelPoolsBase.cpp.
References Stoich::getNumBufPools(), Stoich::getNumCoreRates(), Stoich::getNumVarPools(), Stoich::getRateTerms(), getVolume(), getXreacScaleProducts(), getXreacScaleSubstrates(), Stoich::isFuncTarget(), rates_, S_, Sinit_, stoichPtr_, and volume_.
Referenced by Stoich::scaleBufsAndRates().
void VoxelPoolsBase::setDiffConst | ( | unsigned int | i, |
double | v | ||
) |
Definition at line 174 of file VoxelPoolsBase.cpp.
void VoxelPoolsBase::setN | ( | unsigned int | i, |
double | v | ||
) |
void VoxelPoolsBase::setNinit | ( | unsigned int | i, |
double | v | ||
) |
void VoxelPoolsBase::setVolume | ( | double | vol | ) |
Just assigns the volume without any cascading to other values.
Definition at line 85 of file VoxelPoolsBase.cpp.
References volume_.
Referenced by ZombiePoolInterface::setCompartment(), and SteadyState::setStoich().
|
virtual |
Assign the volume, and handle the cascading effects by scaling all the dependent values of nInit and rates if applicable.
Reimplemented in VoxelPools, and GssaVoxelPools.
Definition at line 95 of file VoxelPoolsBase.cpp.
References S_, Sinit_, and volume_.
Referenced by GssaVoxelPools::setVolumeAndDependencies(), and VoxelPools::setVolumeAndDependencies().
const double * VoxelPoolsBase::Sinit | ( | ) | const |
Returns the array of doubles of initial mol #s at the specified mesh index
Definition at line 70 of file VoxelPoolsBase.cpp.
References Sinit_.
unsigned int VoxelPoolsBase::size | ( | ) | const |
Returns # of pools
Definition at line 80 of file VoxelPoolsBase.cpp.
References Sinit_.
Referenced by hasXfer().
vector< double > & VoxelPoolsBase::Svec | ( | ) |
Returns a handle to the mol # vector.
Definition at line 60 of file VoxelPoolsBase.cpp.
References S_.
Referenced by GssaVoxelPools::advance(), Gsolve::getNvec(), and Ksolve::getNvec().
|
pure virtual |
Reassign entire rate vector.
Implemented in VoxelPools, and GssaVoxelPools.
|
pure virtual |
Update specified index on rate terms. The entire rates vector is passed in for the source values, the index specifies which entry on the local rate vector is to be updated.
Implemented in VoxelPools, and GssaVoxelPools.
double * VoxelPoolsBase::varS | ( | ) |
Returns the array of doubles of current mol #s at the specified mesh index. Dangerous, allows one to modify the values.
Definition at line 65 of file VoxelPoolsBase.cpp.
References S_.
Referenced by GssaVoxelPools::advance(), GssaVoxelPools::refreshAtot(), GssaVoxelPools::reinit(), GssaVoxelPools::updateDependentMathExpn(), and GssaVoxelPools::xferIn().
double * VoxelPoolsBase::varSinit | ( | ) |
Returns the array of doubles of initial mol #s at the specified mesh index, as a writable array.
Definition at line 75 of file VoxelPoolsBase.cpp.
References Sinit_.
void VoxelPoolsBase::xferIn | ( | const vector< unsigned int > & | poolIndex, |
const vector< double > & | values, | ||
const vector< double > & | lastValues, | ||
unsigned int | voxelIndex | ||
) |
Digests incoming data values for cross-compt reactions. Sums the changes in the values onto the specified pools.
Definition at line 187 of file VoxelPoolsBase.cpp.
References S_.
void VoxelPoolsBase::xferInOnlyProxies | ( | const vector< unsigned int > & | poolIndex, |
const vector< double > & | values, | ||
unsigned int | numProxyPools, | ||
unsigned int | voxelIndex | ||
) |
Used during initialization: Takes only the proxy pool values from the incoming transfer data, and assigns it to the proxy pools on current solver
Definition at line 203 of file VoxelPoolsBase.cpp.
References Stoich::getNumProxyPools(), Stoich::getNumVarPools(), S_, Sinit_, and stoichPtr_.
void VoxelPoolsBase::xferOut | ( | unsigned int | voxelIndex, |
vector< double > & | values, | ||
const vector< unsigned int > & | poolIndex | ||
) |
Assembles data values for sending out for x-compt reacs.
Definition at line 227 of file VoxelPoolsBase.cpp.
References S_.
|
private |
Looks up comptIndex from compt. Actually just a set would do.
Definition at line 263 of file VoxelPoolsBase.h.
Referenced by addProxyVoxy(), and isVoxelJunctionPresent().
|
private |
The number of pools (at the end of S and Sinit) that are here just as proxies for some off-compartment pools that participate in cross-compartment reactions. unsigned int numProxyPools_; proxyPoolVoxels_[comptIndex][#] Used to build the transfer vector. Stores the voxels of proxy pools in specified compartment,
Definition at line 251 of file VoxelPoolsBase.h.
Referenced by addProxyVoxy(), hasXfer(), and print().
|
private |
proxyTransferIndex_[comptIndex][#] Stores the index in the transfer vector for proxy pools that live on this voxel. The poolIndex and # of pools is known from the xferPoolIdx_ vector stored on the Ksolve.
Definition at line 258 of file VoxelPoolsBase.h.
Referenced by addProxyTransferIndex(), and print().
|
protected |
Definition at line 212 of file VoxelPoolsBase.h.
Referenced by filterCrossRateTerms(), GssaVoxelPools::getReacVelocity(), print(), scaleVolsBufsRates(), GssaVoxelPools::updateAllRateTerms(), GssaVoxelPools::updateRateTerms(), GssaVoxelPools::updateReacVelocities(), and GssaVoxelPools::~GssaVoxelPools().
|
private |
S_ is the array of molecules. Stored as n, number of molecules per mesh entry. The poolIndex specifies which molecular species pool to use.
The first numVarPools_ in the poolIndex are state variables and are integrated using the ODE solver or the GSSA solver. The next numBufPools_ are fixed but can be changed by the script. The next numFuncPools_ are computed using arbitrary functions of any of the molecule levels, and the time. The functions evaluate before the solver. The functions should not cascade as there is no guarantee of execution order.
Definition at line 229 of file VoxelPoolsBase.h.
Referenced by getN(), print(), reinit(), resizeArrays(), S(), scaleVolsBufsRates(), setN(), setVolumeAndDependencies(), Svec(), varS(), xferIn(), xferInOnlyProxies(), and xferOut().
|
private |
Sinit_ specifies initial conditions at t = 0. Whenever the reac system is rebuilt or reinited, all S_ values become set to Sinit. Also used for buffered molecules as the fixed values of these molecules.
Definition at line 237 of file VoxelPoolsBase.h.
Referenced by getNinit(), reinit(), resizeArrays(), scaleVolsBufsRates(), setNinit(), setVolumeAndDependencies(), Sinit(), size(), varSinit(), and xferInOnlyProxies().
|
protected |
Definition at line 211 of file VoxelPoolsBase.h.
Referenced by VoxelPools::advance(), filterCrossRateTerms(), scaleVolsBufsRates(), GssaVoxelPools::setStoich(), GssaVoxelPools::setVolumeAndDependencies(), and xferInOnlyProxies().
|
private |
This is what I would need to fully identify proxy compts and voxels for each proxy reac. vector< Id, Id, unsigned int, unsigned int> proxyComptVoxel Volume of voxel.
Definition at line 273 of file VoxelPoolsBase.h.
Referenced by getVolume(), print(), scaleVolsBufsRates(), setVolume(), and setVolumeAndDependencies().
|
private |
xReacScaleProducts_[crossRateTermIndex] Product of productVol/voxelVol for each of the products, for reverse reacs. Applied to R2 of the RateTerm. Used only for cross reactions.
Definition at line 289 of file VoxelPoolsBase.h.
Referenced by backwardReacVolumeFactor(), getXreacScaleProducts(), print(), and resetXreacScale().
|
private |
xReacScaleSubstrates_[crossRateTermIndex] Product of substrateVol/voxelVol for each of the substrates, for forward reacs. Applied to R1 of the RateTerm. Used only for cross reactions.
Definition at line 281 of file VoxelPoolsBase.h.
Referenced by forwardReacVolumeFactor(), getXreacScaleSubstrates(), print(), and resetXreacScale().