MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Gsolve.h>
Public Member Functions | |
void | fillIncrementFuncDep () |
void | fillMmEnzDep () |
void | fillPoolFuncDep () |
void | getBlock (vector< double > &values) const |
bool | getClockedUpdate () const |
Flag: returns true if randomized round to integers is done. More... | |
Id | getCompartment () const |
Inherited from ZombiePoolInterface. More... | |
double | getDiffConst (const Eref &e) const |
Diffusion constant: Only one per pool, voxel number is ignored. More... | |
double | getN (const Eref &e) const |
Get # of molecules in given pool and voxel. Varies with time. More... | |
double | getNinit (const Eref &e) const |
get initial # of molecules in given pool and voxel. Bdry cond. More... | |
unsigned int | getNumAllVoxels () const |
vector< unsigned int > | getNumFire (unsigned int voxel) const |
unsigned int | getNumLocalVoxels () const |
Number of voxels here. pools_.size() == getNumLocalVoxels. More... | |
unsigned int | getNumPools () const |
Inherited. More... | |
vector< double > | getNvec (unsigned int voxel) const |
Returns the vector of pool Num at the specified voxel. More... | |
unsigned int | getPoolIndex (const Eref &e) const |
Return pool index, using Stoich ptr to do lookup. More... | |
bool | getRandInit () const |
Flag: returns true if randomized round to integers is done. More... | |
Id | getStoich () const |
unsigned int | getVoxelIndex (const Eref &e) const |
Gsolve () | |
void | initProc (const Eref &e, ProcPtr p) |
void | initReinit (const Eref &e, ProcPtr p) |
void | insertMathDepReacs (unsigned int mathDepIndex, unsigned int firedReac) |
void | makeReacDepsUnique () |
Gsolve & | operator= (const Gsolve &) |
void | parallel_advance (int begin, int end, size_t nWorkers, ProcPtr p, const GssaSystem *sys) |
VoxelPoolsBase * | pools (unsigned int i) |
Inherited. More... | |
void | process (const Eref &e, ProcPtr p) |
void | rebuildGssaSystem () |
void | reinit (const Eref &e, ProcPtr p) |
void | setBlock (const vector< double > &values) |
void | setClockedUpdate (bool val) |
Flag: set true if randomized round to integers is to be done. More... | |
void | setCompartment (Id compt) |
Assigns compartment. More... | |
void | setDiffConst (const Eref &e, double v) |
Diffusion constant: Only one per pool, voxel number is ignored. More... | |
void | setDsolve (Id dsolve) |
void | setN (const Eref &e, double v) |
Set # of molecules in given pool and voxel. Varies with time. More... | |
void | setNinit (const Eref &e, double v) |
Set initial # of molecules in given pool and voxel. Bdry cond. More... | |
void | setNumAllVoxels (unsigned int num) |
void | setNumPools (unsigned int num) |
void | setNvec (unsigned int voxel, vector< double > vec) |
void | setRandInit (bool val) |
Flag: set true if randomized round to integers is to be done. More... | |
void | setStoich (Id stoich) |
void | updateRateTerms (unsigned int index) |
void | updateVoxelVol (vector< double > vols) |
double | volume (unsigned int i) const |
Inherited. More... | |
~Gsolve () | |
![]() | |
Id | getCompartment () const |
virtual void | setMotorConst (const Eref &e, double val) |
virtual void | setPrev () |
Used to tell Dsolver to assign 'prev' values. More... | |
virtual void | updateJunctions (double dt) |
Used for telling Dsolver to handle all ops across Junctions. More... | |
ZombiePoolInterface () | |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Private Attributes | |
Id | dsolve_ |
ZombiePoolInterface * | dsolvePtr_ |
Pointer to diffusion solver. More... | |
vector< GssaVoxelPools > | pools_ |
unsigned int | startVoxel_ |
First voxel indexed on the current node. More... | |
Stoich * | stoichPtr_ |
Utility ptr used to help Pool Id lookups by the Ksolve. More... | |
GssaSystem | sys_ |
bool | useClockedUpdate_ |
Flag: True if atot should be updated every clock tick. More... | |
Additional Inherited Members | |
![]() | |
Id | compartment_ |
Id of Chem compartment used to figure out volumes of voxels. More... | |
bool | isBuilt_ |
Flag: True when solver setup has been completed. More... | |
Id | stoich_ |
Gsolve::Gsolve | ( | ) |
Definition at line 206 of file Gsolve.cpp.
Referenced by initCinfo().
Gsolve::~Gsolve | ( | ) |
Definition at line 224 of file Gsolve.cpp.
void Gsolve::fillIncrementFuncDep | ( | ) |
Here we fill in the dependencies involving incrementFuncs. These are the functions that evaluate an expression that specifies rate of change of # of a target molecule. There are two dependencies:
Definition at line 694 of file Gsolve.cpp.
References GssaSystem::dependency, GssaSystem::dependentMathExpn, Stoich::getNumAllPools(), Stoich::getNumRates(), Stoich::getRateTerms(), SparseMatrix< T >::getRow(), stoichPtr_, sys_, and GssaSystem::transposeN.
Referenced by rebuildGssaSystem().
void Gsolve::fillMmEnzDep | ( | ) |
Fill in dependency list for all MMEnzs on reactions. The dependencies of MMenz products are already in the system, so here we just need to add cases where any reaction product is the Enz of an MMEnz.
Definition at line 580 of file Gsolve.cpp.
References GssaSystem::dependency, Stoich::getNumRates(), RateTerm::getReactants(), SparseMatrix< T >::getRow(), Stoich::rates(), stoichPtr_, sys_, and GssaSystem::transposeN.
Referenced by rebuildGssaSystem().
void Gsolve::fillPoolFuncDep | ( | ) |
Here we fill in the dependencies involving poolFuncs. These are the functions that evaluate an expression and assign directly to the
There are two dependencies:
Definition at line 631 of file Gsolve.cpp.
References GssaSystem::dependency, GssaSystem::dependentMathExpn, Stoich::funcs(), Stoich::getNumAllPools(), Stoich::getNumFuncs(), Stoich::getNumRates(), FuncTerm::getReactantIndex(), SparseMatrix< T >::getRow(), Stoich::getStoichiometryMatrix(), FuncTerm::getTarget(), stoichPtr_, sys_, and GssaSystem::transposeN.
Referenced by rebuildGssaSystem().
|
virtual |
Gets block of data. The first 4 entries are passed in on the 'values' vector: the start voxel, numVoxels, start pool#, numPools. These are followed by numVoxels * numPools of data values which are filled in by the function. We assert that the entire requested block is present in this ZombiePoolInterface. The block is organized as an array of arrays of voxels; values[pool#][voxel#]
Note that numVoxels and numPools are the number in the current block, not the upper limit of the block. So values.size() == 4 + numPools * numVoxels.
Implements ZombiePoolInterface.
Definition at line 970 of file Gsolve.cpp.
References pools_, and startVoxel_.
Referenced by process().
bool Gsolve::getClockedUpdate | ( | ) | const |
Flag: returns true if randomized round to integers is done.
Definition at line 352 of file Gsolve.cpp.
References useClockedUpdate_.
Referenced by initCinfo().
Id Gsolve::getCompartment | ( | ) | const |
Inherited from ZombiePoolInterface.
Definition at line 256 of file Gsolve.cpp.
References ZombiePoolInterface::compartment_.
Referenced by initCinfo().
|
virtual |
Diffusion constant: Only one per pool, voxel number is ignored.
Implements ZombiePoolInterface.
Definition at line 948 of file Gsolve.cpp.
|
virtual |
Get # of molecules in given pool and voxel. Varies with time.
Implements ZombiePoolInterface.
Definition at line 903 of file Gsolve.cpp.
References getPoolIndex(), getVoxelIndex(), OFFNODE, and pools_.
|
virtual |
get initial # of molecules in given pool and voxel. Bdry cond.
Implements ZombiePoolInterface.
Definition at line 935 of file Gsolve.cpp.
References getPoolIndex(), getVoxelIndex(), OFFNODE, and pools_.
unsigned int Gsolve::getNumAllVoxels | ( | ) | const |
Definition at line 283 of file Gsolve.cpp.
References pools_.
Referenced by initCinfo().
vector< unsigned int > Gsolve::getNumFire | ( | unsigned int | voxel | ) | const |
Definition at line 331 of file Gsolve.cpp.
References dummy, GssaVoxelPools::numFire(), and pools_.
Referenced by initCinfo().
|
virtual |
Number of voxels here. pools_.size() == getNumLocalVoxels.
Implements ZombiePoolInterface.
Definition at line 278 of file Gsolve.cpp.
References pools_.
Referenced by initCinfo(), and process().
|
virtual |
Inherited.
Implements ZombiePoolInterface.
Definition at line 963 of file Gsolve.cpp.
References pools_.
Referenced by initCinfo().
vector< double > Gsolve::getNvec | ( | unsigned int | voxel | ) | const |
Returns the vector of pool Num at the specified voxel.
Definition at line 299 of file Gsolve.cpp.
References dummy, pools_, and VoxelPoolsBase::Svec().
Referenced by initCinfo().
|
virtual |
Return pool index, using Stoich ptr to do lookup.
Implements ZombiePoolInterface.
Definition at line 844 of file Gsolve.cpp.
References Stoich::convertIdToPoolIndex(), Eref::id(), and stoichPtr_.
Referenced by getN(), getNinit(), setN(), and setNinit().
bool Gsolve::getRandInit | ( | ) | const |
Flag: returns true if randomized round to integers is done.
Definition at line 342 of file Gsolve.cpp.
References sys_, and GssaSystem::useRandInit.
Referenced by initCinfo().
Id Gsolve::getStoich | ( | ) | const |
Definition at line 233 of file Gsolve.cpp.
References ZombiePoolInterface::stoich_.
Referenced by initCinfo().
unsigned int Gsolve::getVoxelIndex | ( | const Eref & | e | ) | const |
Definition at line 849 of file Gsolve.cpp.
References Eref::dataIndex(), OFFNODE, pools_, and startVoxel_.
Referenced by getN(), getNinit(), setN(), and setNinit().
|
static |
Definition at line 37 of file Gsolve.cpp.
References getClockedUpdate(), getCompartment(), getNumAllVoxels(), getNumFire(), getNumLocalVoxels(), getNumPools(), getNvec(), getRandInit(), getStoich(), Gsolve(), gsolveCinfo, init(), Neutral::initCinfo(), initProc(), initReinit(), process(), reinit(), setClockedUpdate(), setCompartment(), setNumAllVoxels(), setNumPools(), setNvec(), setRandInit(), setStoich(), and updateVoxelVol().
Definition at line 532 of file Gsolve.cpp.
Referenced by initCinfo().
Definition at line 535 of file Gsolve.cpp.
References pools_, stoichPtr_, and sys_.
Referenced by initCinfo().
void Gsolve::insertMathDepReacs | ( | unsigned int | mathDepIndex, |
unsigned int | firedReac | ||
) |
Inserts reactions that depend on molecules modified by the specified MathExpn, into the dependency list. Later.
Definition at line 805 of file Gsolve.cpp.
void Gsolve::makeReacDepsUnique | ( | ) |
STL stuff follows, with the usual weirdness.
Definition at line 822 of file Gsolve.cpp.
References GssaSystem::dependency, Stoich::getNumRates(), stoichPtr_, and sys_.
Referenced by rebuildGssaSystem().
Definition at line 219 of file Gsolve.cpp.
void Gsolve::parallel_advance | ( | int | begin, |
int | end, | ||
size_t | nWorkers, | ||
ProcPtr | p, | ||
const GssaSystem * | sys | ||
) |
|
virtual |
Inherited.
Implements ZombiePoolInterface.
Definition at line 1052 of file Gsolve.cpp.
References pools_.
Definition at line 398 of file Gsolve.cpp.
References advance(), ProcInfo::currTime, dsolvePtr_, ProcInfo::dt, ZombiePoolInterface::getBlock(), getBlock(), getNumLocalVoxels(), Stoich::getNumVarPools(), moose::mtrand(), parallel_advance(), pools_, ZombiePoolInterface::setBlock(), setBlock(), ZombiePoolInterface::setPrev(), stoichPtr_, sys_, ZombiePoolInterface::updateJunctions(), and useClockedUpdate_.
Referenced by initCinfo().
void Gsolve::rebuildGssaSystem | ( | ) |
Definition at line 548 of file Gsolve.cpp.
References Stoich::convertRatesToStochasticForm(), GssaSystem::dependency, fillIncrementFuncDep(), fillMmEnzDep(), fillPoolFuncDep(), KinSparseMatrix::getGillespieDependence(), Stoich::getNumCoreRates(), Stoich::getNumProxyPools(), Stoich::getNumRates(), Stoich::getNumVarPools(), Stoich::getRateTerms(), Stoich::getStoichiometryMatrix(), GssaSystem::isReady, makeReacDepsUnique(), pools_, stoichPtr_, sys_, SparseMatrix< T >::transpose(), GssaSystem::transposeN, and KinSparseMatrix::truncateRow().
Referenced by reinit().
Definition at line 503 of file Gsolve.cpp.
References GssaSystem::isReady, pools_, rebuildGssaSystem(), stoichPtr_, and sys_.
Referenced by initCinfo().
|
virtual |
Sets block of data. The first 4 entries on the 'values' vector are the start voxel, numVoxels, start pool#, numPools. These are followed by numVoxels * numPools of data values.
Implements ZombiePoolInterface.
Definition at line 993 of file Gsolve.cpp.
References pools_, and startVoxel_.
Referenced by process().
void Gsolve::setClockedUpdate | ( | bool | val | ) |
Flag: set true if randomized round to integers is to be done.
Definition at line 357 of file Gsolve.cpp.
References useClockedUpdate_.
Referenced by initCinfo().
|
virtual |
Assigns compartment.
Reimplemented from ZombiePoolInterface.
Definition at line 238 of file Gsolve.cpp.
References Element::cinfo(), ZombiePoolInterface::compartment_, Id::element(), Cinfo::isA(), and pools_.
Referenced by initCinfo().
|
virtual |
Diffusion constant: Only one per pool, voxel number is ignored.
Implements ZombiePoolInterface.
Definition at line 943 of file Gsolve.cpp.
|
virtual |
Inherited. Needed for reac-diff calculations so the Gsolve can orchestrate the data transfer between the itself and the diffusion solver.
Implements ZombiePoolInterface.
Definition at line 857 of file Gsolve.cpp.
References Element::cinfo(), Eref::data(), dsolve_, dsolvePtr_, Id::element(), Id::eref(), Cinfo::isA(), Cinfo::name(), and Id::path().
|
virtual |
Set # of molecules in given pool and voxel. Varies with time.
Implements ZombiePoolInterface.
Definition at line 883 of file Gsolve.cpp.
References Element::cinfo(), Eref::element(), getPoolIndex(), getVoxelIndex(), Cinfo::isA(), GssaSystem::isReady, OFFNODE, pools_, and sys_.
|
virtual |
Set initial # of molecules in given pool and voxel. Bdry cond.
Implements ZombiePoolInterface.
Definition at line 911 of file Gsolve.cpp.
References Element::cinfo(), Eref::element(), getPoolIndex(), getVoxelIndex(), Cinfo::isA(), GssaSystem::isReady, OFFNODE, pools_, and sys_.
|
virtual |
Assigns the number of voxels used in the entire reac-diff system. Note that fewer than this may be used on any given node.
Implements ZombiePoolInterface.
Definition at line 289 of file Gsolve.cpp.
References GssaSystem::isReady, pools_, and sys_.
Referenced by initCinfo().
|
virtual |
Assigns number of different pools (chemical species) present in each voxel.
Implements ZombiePoolInterface.
Definition at line 953 of file Gsolve.cpp.
References GssaSystem::isReady, pools_, and sys_.
Referenced by initCinfo().
void Gsolve::setNvec | ( | unsigned int | voxel, |
vector< double > | vec | ||
) |
Definition at line 309 of file Gsolve.cpp.
References GssaSystem::isReady, pools_, and sys_.
Referenced by initCinfo().
void Gsolve::setRandInit | ( | bool | val | ) |
Flag: set true if randomized round to integers is to be done.
Definition at line 347 of file Gsolve.cpp.
References sys_, and GssaSystem::useRandInit.
Referenced by initCinfo().
|
virtual |
Informs the ZPI about the stoich, used during subsequent computations. Called to wrap up the model building. The Stoich does this call after it has set up its own path.
Implements ZombiePoolInterface.
Definition at line 261 of file Gsolve.cpp.
References Element::cinfo(), Eref::data(), Id::element(), Id::eref(), Stoich::getNumAllPools(), Cinfo::isA(), GssaSystem::isReady, pools_, GssaSystem::stoich, ZombiePoolInterface::stoich_, stoichPtr_, and sys_.
Referenced by initCinfo().
|
virtual |
Rescale specified voxel rate term following rate constant change or volume change. If index == ~0U then does all terms.
Implements ZombiePoolInterface.
Definition at line 1031 of file Gsolve.cpp.
References Stoich::getNumCoreRates(), Stoich::getRateTerms(), pools_, and stoichPtr_.
Referenced by updateVoxelVol().
void Gsolve::updateVoxelVol | ( | vector< double > | vols | ) |
Handles request to change volumes of voxels in this Ksolve, and all cascading effects of this. At this point it won't handle change in size of voxel array.
Definition at line 1016 of file Gsolve.cpp.
References pools_, and updateRateTerms().
Referenced by initCinfo().
|
virtual |
Inherited.
Implements ZombiePoolInterface.
Definition at line 1059 of file Gsolve.cpp.
References pools_.
|
private |
Id of diffusion solver, needed for coordinating numerics.
Definition at line 165 of file Gsolve.h.
Referenced by setDsolve().
|
private |
Pointer to diffusion solver.
Definition at line 168 of file Gsolve.h.
Referenced by process(), and setDsolve().
|
private |
Each VoxelPools entry handles all the pools in a single voxel. Each entry knows how to update itself in order to complete the kinetic calculations for that voxel. The ksolver does multinode management by indexing only the subset of entries present on this node.
Definition at line 154 of file Gsolve.h.
Referenced by getBlock(), getN(), getNinit(), getNumAllVoxels(), getNumFire(), getNumLocalVoxels(), getNumPools(), getNvec(), getVoxelIndex(), initReinit(), pools(), process(), rebuildGssaSystem(), reinit(), setBlock(), setCompartment(), setN(), setNinit(), setNumAllVoxels(), setNumPools(), setNvec(), setStoich(), updateRateTerms(), updateVoxelVol(), and volume().
|
private |
First voxel indexed on the current node.
Definition at line 157 of file Gsolve.h.
Referenced by getBlock(), getVoxelIndex(), and setBlock().
|
private |
Utility ptr used to help Pool Id lookups by the Ksolve.
Definition at line 160 of file Gsolve.h.
Referenced by fillIncrementFuncDep(), fillMmEnzDep(), fillPoolFuncDep(), getPoolIndex(), initReinit(), makeReacDepsUnique(), process(), rebuildGssaSystem(), reinit(), setStoich(), and updateRateTerms().
|
private |
Definition at line 146 of file Gsolve.h.
Referenced by fillIncrementFuncDep(), fillMmEnzDep(), fillPoolFuncDep(), getRandInit(), initReinit(), makeReacDepsUnique(), process(), rebuildGssaSystem(), reinit(), setN(), setNinit(), setNumAllVoxels(), setNumPools(), setNvec(), setRandInit(), and setStoich().
|
private |
Flag: True if atot should be updated every clock tick.
Definition at line 171 of file Gsolve.h.
Referenced by getClockedUpdate(), process(), and setClockedUpdate().