MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <GssaVoxelPools.h>
Public Member Functions | |
void | advance (const ProcInfo *p) |
void | advance (const ProcInfo *p, const GssaSystem *g) |
double | getReacVelocity (unsigned int r, const double *s) const |
GssaVoxelPools () | |
vector< unsigned int > | numFire () const |
unsigned int | pickReac () |
void | recalcTime (const GssaSystem *g, double currTime) |
bool | refreshAtot (const GssaSystem *g) |
void | reinit (const GssaSystem *g) |
void | setNumReac (unsigned int n) |
void | setStoich (const Stoich *stoichPtr) |
void | setVolumeAndDependencies (double vol) |
void | updateAllRateTerms (const vector< RateTerm * > &rates, unsigned int numCoreRates) |
void | updateDependentMathExpn (const GssaSystem *g, unsigned int rindex, double time) |
void | updateDependentRates (const vector< unsigned int > &deps, const Stoich *stoich) |
void | updateRateTerms (const vector< RateTerm * > &rates, unsigned int numCoreRates, unsigned int index) |
void | updateReacVelocities (const GssaSystem *g, const double *s, vector< double > &v) const |
void | xferIn (XferInfo &xf, unsigned int voxelIndex, const GssaSystem *g) |
virtual | ~GssaVoxelPools () |
![]() | |
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... | |
const double * | Sinit () const |
unsigned int | size () const |
vector< double > & | Svec () |
Returns a handle to the mol # vector. More... | |
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 () |
Private Attributes | |
double | atot_ |
vector< unsigned int > | numFire_ |
moose::RNG< double > | rng_ |
RNG. More... | |
double | t_ |
Time at which next event will occur. More... | |
vector< double > | v_ |
Additional Inherited Members | |
![]() | |
vector< RateTerm * > | rates_ |
const Stoich * | stoichPtr_ |
Definition at line 15 of file GssaVoxelPools.h.
GssaVoxelPools::GssaVoxelPools | ( | ) |
Definition at line 50 of file GssaVoxelPools.cpp.
|
virtual |
void GssaVoxelPools::advance | ( | const ProcInfo * | p | ) |
void GssaVoxelPools::advance | ( | const ProcInfo * | p, |
const GssaSystem * | g | ||
) |
Definition at line 173 of file GssaVoxelPools.cpp.
References atot_, ProcInfo::currTime, GssaSystem::dependency, KinSparseMatrix::fireReac(), Stoich::getNumRates(), moose::log(), numFire_, pickReac(), refreshAtot(), rng_, GssaSystem::stoich, VoxelPoolsBase::Svec(), t_, GssaSystem::transposeN, moose::RNG< T >::uniform(), updateDependentRates(), Stoich::updateFuncs(), v_, and VoxelPoolsBase::varS().
double GssaVoxelPools::getReacVelocity | ( | unsigned int | r, |
const double * | s | ||
) | const |
Definition at line 362 of file GssaVoxelPools.cpp.
References VoxelPoolsBase::rates_.
Referenced by updateDependentRates().
vector< unsigned int > GssaVoxelPools::numFire | ( | ) | const |
Definition at line 298 of file GssaVoxelPools.cpp.
References numFire_.
Referenced by Gsolve::getNumFire().
unsigned int GssaVoxelPools::pickReac | ( | ) |
Definition at line 104 of file GssaVoxelPools.cpp.
References atot_, rng_, moose::RNG< T >::uniform(), and v_.
Referenced by advance().
void GssaVoxelPools::recalcTime | ( | const GssaSystem * | g, |
double | currTime | ||
) |
Recalculates the time for the next event. Used when we have a clocked update of rates due to timed functions. In such cases the propensities may change invisibly, so we need to update time estimates
Definition at line 162 of file GssaVoxelPools.cpp.
References atot_, moose::log(), refreshAtot(), rng_, t_, and moose::RNG< T >::uniform().
bool GssaVoxelPools::refreshAtot | ( | const GssaSystem * | g | ) |
Cleans out all reac rates and recalculates atot. Needed whenever a mol conc changes, or if there is a roundoff error. Returns true if OK, returns false if it is in a stuck state and atot<=0
Definition at line 140 of file GssaVoxelPools.cpp.
References atot_, VoxelPoolsBase::S(), SAFETY_FACTOR, GssaSystem::stoich, t_, Stoich::updateFuncs(), updateReacVelocities(), v_, and VoxelPoolsBase::varS().
Referenced by advance(), recalcTime(), reinit(), and xferIn().
void GssaVoxelPools::reinit | ( | const GssaSystem * | g | ) |
Builds the gssa system as needed.
Definition at line 232 of file GssaVoxelPools.cpp.
References moose::__rng_seed__, moose::error, Stoich::getNumVarPools(), numFire_, refreshAtot(), VoxelPoolsBase::reinit(), rng_, moose::RNG< T >::setSeed(), GssaSystem::stoich, t_, moose::RNG< T >::uniform(), Stoich::updateFuncs(), GssaSystem::useRandInit, v_, and VoxelPoolsBase::varS().
void GssaVoxelPools::setNumReac | ( | unsigned int | n | ) |
Definition at line 128 of file GssaVoxelPools.cpp.
void GssaVoxelPools::setStoich | ( | const Stoich * | stoichPtr | ) |
|
virtual |
Assign the volume, and handle the cascading effects by scaling all the dependent values of nInit and rates if applicable.
Reimplemented from VoxelPoolsBase.
Definition at line 378 of file GssaVoxelPools.cpp.
References Stoich::getNumCoreRates(), Stoich::getRateTerms(), VoxelPoolsBase::setVolumeAndDependencies(), VoxelPoolsBase::stoichPtr_, and updateAllRateTerms().
|
virtual |
Reassign entire rate vector.
Implements VoxelPoolsBase.
Definition at line 307 of file GssaVoxelPools.cpp.
References VoxelPoolsBase::getVolume(), VoxelPoolsBase::getXreacScaleProducts(), VoxelPoolsBase::getXreacScaleSubstrates(), and VoxelPoolsBase::rates_.
Referenced by setVolumeAndDependencies().
void GssaVoxelPools::updateDependentMathExpn | ( | const GssaSystem * | g, |
unsigned int | rindex, | ||
double | time | ||
) |
Definition at line 64 of file GssaVoxelPools.cpp.
References GssaSystem::stoich, Stoich::updateFuncs(), and VoxelPoolsBase::varS().
void GssaVoxelPools::updateDependentRates | ( | const vector< unsigned int > & | deps, |
const Stoich * | stoich | ||
) |
Definition at line 92 of file GssaVoxelPools.cpp.
References atot_, getReacVelocity(), VoxelPoolsBase::S(), and v_.
Referenced by advance().
|
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.
Implements VoxelPoolsBase.
Definition at line 322 of file GssaVoxelPools.cpp.
References VoxelPoolsBase::getVolume(), VoxelPoolsBase::getXreacScaleProducts(), VoxelPoolsBase::getXreacScaleSubstrates(), and VoxelPoolsBase::rates_.
void GssaVoxelPools::updateReacVelocities | ( | const GssaSystem * | g, |
const double * | s, | ||
vector< double > & | v | ||
) | const |
updateReacVelocities computes the velocity v of each reaction. This is a utility function for programs like SteadyState that need to analyze velocity.
Definition at line 344 of file GssaVoxelPools.cpp.
References Stoich::getStoichiometryMatrix(), SparseMatrix< T >::nColumns(), VoxelPoolsBase::rates_, and GssaSystem::stoich.
Referenced by refreshAtot().
void GssaVoxelPools::xferIn | ( | XferInfo & | xf, |
unsigned int | voxelIndex, | ||
const GssaSystem * | g | ||
) |
Digests incoming data values for cross-compt reactions. Sums the changes in the values onto the specified pools.
Definition at line 400 of file GssaVoxelPools.cpp.
References XferInfo::lastValues, refreshAtot(), rng_, XferInfo::subzero, moose::RNG< T >::uniform(), XferInfo::values, VoxelPoolsBase::varS(), and XferInfo::xferPoolIdx.
|
private |
Total propensity of all the reactions in the system
Definition at line 82 of file GssaVoxelPools.h.
Referenced by advance(), pickReac(), recalcTime(), refreshAtot(), and updateDependentRates().
|
private |
Definition at line 92 of file GssaVoxelPools.h.
Referenced by advance(), numFire(), reinit(), and setNumReac().
|
private |
RNG.
Definition at line 97 of file GssaVoxelPools.h.
Referenced by advance(), pickReac(), recalcTime(), reinit(), and xferIn().
|
private |
Time at which next event will occur.
Definition at line 77 of file GssaVoxelPools.h.
Referenced by advance(), recalcTime(), refreshAtot(), and reinit().
|
private |
State vector of reaction velocities. Only a subset are recalculated on each step.
Definition at line 88 of file GssaVoxelPools.h.
Referenced by advance(), pickReac(), refreshAtot(), reinit(), setNumReac(), and updateDependentRates().