#include <Ksolve.h>
Public Member Functions | |
Ksolve () | |
~Ksolve () | |
string | getMethod () const |
void | setMethod (string method) |
double | getEpsAbs () const |
Assigns Absolute tolerance for integration. | |
void | setEpsAbs (double val) |
double | getEpsRel () const |
Assigns Relative tolerance for integration. | |
void | setEpsRel (double val) |
Id | getStoich () const |
Assigns Stoich object to Ksolve. | |
void | setStoich (Id stoich) |
Id | getDsolve () const |
Inherited from ZombiePoolInterface. | |
void | setDsolve (Id dsolve) |
Assigns the diffusion solver. Used by the reac solvers. | |
unsigned int | getNumLocalVoxels () const |
Inherited from ZombiePoolInterface. | |
unsigned int | getNumAllVoxels () const |
void | setNumAllVoxels (unsigned int num) |
vector< double > | getNvec (unsigned int voxel) const |
Returns the vector of pool Num at the specified voxel. | |
void | setNvec (unsigned int voxel, vector< double > vec) |
double | getEstimatedDt () const |
void | process (const Eref &e, ProcPtr p) |
void | reinit (const Eref &e, ProcPtr p) |
void | initProc (const Eref &e, ProcPtr p) |
void | initReinit (const Eref &e, ProcPtr p) |
void | updateVoxelVol (vector< double > vols) |
unsigned int | getPoolIndex (const Eref &e) const |
Return pool index, using Stoich ptr to do lookup. | |
unsigned int | getVoxelIndex (const Eref &e) const |
void | setN (const Eref &e, double v) |
Set # of molecules in given pool and voxel. Varies with time. | |
double | getN (const Eref &e) const |
Get # of molecules in given pool and voxel. Varies with time. | |
void | setNinit (const Eref &e, double v) |
Set initial # of molecules in given pool and voxel. Bdry cond. | |
double | getNinit (const Eref &e) const |
get initial # of molecules in given pool and voxel. Bdry cond. | |
void | setDiffConst (const Eref &e, double v) |
Diffusion constant: Only one per pool, voxel number is ignored. | |
double | getDiffConst (const Eref &e) const |
Diffusion constant: Only one per pool, voxel number is ignored. | |
void | setNumPools (unsigned int num) |
unsigned int | getNumPools () const |
gets number of pools (species) handled by system. | |
VoxelPoolsBase * | pools (unsigned int i) |
Return a pointer to the specified VoxelPool. | |
double | volume (unsigned int i) const |
Return volume of voxel i. | |
void | getBlock (vector< double > &values) const |
void | setBlock (const vector< double > &values) |
void | matchJunctionVols (vector< double > &vols, Id otherCompt) const |
void | updateRateTerms (unsigned int index) |
void | setupXfer (Id myKsolve, Id otherKsolve, unsigned int numProxyMols, const vector< VoxelJunction > &vj) |
void | assignXferIndex (unsigned int numProxyMols, unsigned int xferCompt, const vector< vector< unsigned int > > &voxy) |
void | assignXferVoxels (unsigned int xferCompt) |
unsigned int | assignProxyPools (const map< Id, vector< Id > > &xr, Id myKsolve, Id otherKsolve, Id otherComptId) |
void | buildCrossReacVolScaling (Id otherKsolve, const vector< VoxelJunction > &vj) |
void | print () const |
Static Public Member Functions | |
static SrcFinfo2< Id, vector < double > > * | xComptOut () |
static const Cinfo * | initCinfo () |
Ksolve::Ksolve | ( | ) |
Ksolve::~Ksolve | ( | ) |
unsigned int Ksolve::assignProxyPools | ( | const map< Id, vector< Id > > & | xr, | |
Id | myKsolve, | |||
Id | otherKsolve, | |||
Id | otherComptId | |||
) |
Reimplemented from ZombiePoolInterface.
void Ksolve::assignXferIndex | ( | unsigned int | numProxyMols, | |
unsigned int | xferCompt, | |||
const vector< vector< unsigned int > > & | voxy | |||
) |
Reimplemented from ZombiePoolInterface.
void Ksolve::assignXferVoxels | ( | unsigned int | xferCompt | ) |
Figures out which voxels are involved in cross-compt reactions. Stores in the appropriate xfer_ entry.
Reimplemented from ZombiePoolInterface.
void Ksolve::buildCrossReacVolScaling | ( | Id | otherKsolve, | |
const vector< VoxelJunction > & | vj | |||
) |
void Ksolve::getBlock | ( | vector< double > & | values | ) | const [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.
Referenced by process().
double Ksolve::getDiffConst | ( | const Eref & | e | ) | const [virtual] |
Diffusion constant: Only one per pool, voxel number is ignored.
Implements ZombiePoolInterface.
Id Ksolve::getDsolve | ( | ) | const |
Inherited from ZombiePoolInterface.
Assigns Dsolve object to Ksolve.
double Ksolve::getEpsAbs | ( | ) | const |
Assigns Absolute tolerance for integration.
Referenced by initCinfo().
double Ksolve::getEpsRel | ( | ) | const |
Assigns Relative tolerance for integration.
Referenced by initCinfo().
double Ksolve::getEstimatedDt | ( | ) | const |
This does a quick and dirty estimate of the timestep suitable for this sytem
References EPSILON, Stoich::getNumAllPools(), Stoich::getNumProxyPools(), and Stoich::getNumRates().
Referenced by initCinfo().
string Ksolve::getMethod | ( | ) | const |
Assigns integration method
Referenced by initCinfo().
double Ksolve::getN | ( | const Eref & | e | ) | const [virtual] |
Get # of molecules in given pool and voxel. Varies with time.
Implements ZombiePoolInterface.
References getPoolIndex(), getVoxelIndex(), and OFFNODE.
double Ksolve::getNinit | ( | const Eref & | e | ) | const [virtual] |
get initial # of molecules in given pool and voxel. Bdry cond.
Implements ZombiePoolInterface.
References getPoolIndex(), getVoxelIndex(), and OFFNODE.
unsigned int Ksolve::getNumAllVoxels | ( | ) | const |
Referenced by initCinfo().
unsigned int Ksolve::getNumLocalVoxels | ( | ) | const [virtual] |
Inherited from ZombiePoolInterface.
Implements ZombiePoolInterface.
Referenced by initCinfo(), and process().
unsigned int Ksolve::getNumPools | ( | ) | const [virtual] |
gets number of pools (species) handled by system.
Implements ZombiePoolInterface.
Referenced by initCinfo().
vector< double > Ksolve::getNvec | ( | unsigned int | voxel | ) | const |
Returns the vector of pool Num at the specified voxel.
References dummy().
Referenced by initCinfo().
unsigned int Ksolve::getPoolIndex | ( | const Eref & | er | ) | const [virtual] |
Return pool index, using Stoich ptr to do lookup.
Implements ZombiePoolInterface.
References Stoich::convertIdToPoolIndex(), and Eref::id().
Referenced by getN(), getNinit(), setN(), and setNinit().
Id Ksolve::getStoich | ( | ) | const |
Assigns Stoich object to Ksolve.
References ZombiePoolInterface::stoich_.
Referenced by initCinfo().
unsigned int Ksolve::getVoxelIndex | ( | const Eref & | e | ) | const |
References Eref::dataIndex(), and OFFNODE.
Referenced by getN(), getNinit(), setN(), and setNinit().
const Cinfo * Ksolve::initCinfo | ( | ) | [static] |
References ZombiePoolInterface::getCompartment(), getEpsAbs(), getEpsRel(), getEstimatedDt(), getMethod(), getNumAllVoxels(), getNumLocalVoxels(), getNumPools(), getNvec(), getStoich(), init(), Neutral::initCinfo(), initProc(), initReinit(), process(), reinit(), ZombiePoolInterface::setCompartment(), setEpsAbs(), setEpsRel(), setMethod(), setNumAllVoxels(), setNumPools(), setNvec(), updateVoxelVol(), ZombiePoolInterface::xComptIn(), and xComptOut().
References Eref::id(), XferInfo::ksolve, xComptOut(), ZombiePoolInterface::xfer_, XferInfo::xferPoolIdx, and XferInfo::xferVoxel.
Referenced by initCinfo().
References ProcInfo::dt, Eref::id(), XferInfo::ksolve, XferInfo::lastValues, xComptOut(), ZombiePoolInterface::xfer_, XferInfo::xferPoolIdx, and XferInfo::xferVoxel.
Referenced by initCinfo().
void Ksolve::matchJunctionVols | ( | vector< double > & | vols, | |
Id | otherCompt | |||
) | const |
Reimplemented from ZombiePoolInterface.
VoxelPoolsBase * Ksolve::pools | ( | unsigned int | i | ) | [virtual] |
Return a pointer to the specified VoxelPool.
Implements ZombiePoolInterface.
void Ksolve::print | ( | ) | const |
References ZombiePoolInterface::compartment_, Stoich::getKsolve(), Id::path(), ZombiePoolInterface::stoich_, and ZombiePoolInterface::xfer_.
References getBlock(), ZombiePoolInterface::getBlock(), getNumLocalVoxels(), Stoich::getNumVarPools(), ZombiePoolInterface::isBuilt_, XferInfo::lastValues, ZombiePoolInterface::setBlock(), setBlock(), XferInfo::values, ZombiePoolInterface::xfer_, XferInfo::xferPoolIdx, and XferInfo::xferVoxel.
Referenced by initCinfo().
References ProcInfo::dt, Stoich::getNumProxyPools(), ZombiePoolInterface::isBuilt_, XferInfo::lastValues, XferInfo::values, ZombiePoolInterface::xfer_, XferInfo::xferPoolIdx, and XferInfo::xferVoxel.
Referenced by initCinfo().
void Ksolve::setBlock | ( | const vector< double > & | values | ) | [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.
Referenced by process().
void Ksolve::setDiffConst | ( | const Eref & | e, | |
double | val | |||
) | [virtual] |
Diffusion constant: Only one per pool, voxel number is ignored.
Implements ZombiePoolInterface.
void Ksolve::setDsolve | ( | Id | dsolve | ) | [virtual] |
Assigns the diffusion solver. Used by the reac solvers.
Implements ZombiePoolInterface.
References Element::cinfo(), Eref::data(), Id::element(), Id::eref(), Cinfo::isA(), Cinfo::name(), and Id::path().
void Ksolve::setEpsAbs | ( | double | val | ) |
Referenced by initCinfo().
void Ksolve::setEpsRel | ( | double | val | ) |
Referenced by initCinfo().
void Ksolve::setMethod | ( | string | method | ) |
Referenced by initCinfo().
void Ksolve::setN | ( | const Eref & | e, | |
double | val | |||
) | [virtual] |
Set # of molecules in given pool and voxel. Varies with time.
Implements ZombiePoolInterface.
References getPoolIndex(), getVoxelIndex(), and OFFNODE.
void Ksolve::setNinit | ( | const Eref & | e, | |
double | val | |||
) | [virtual] |
Set initial # of molecules in given pool and voxel. Bdry cond.
Implements ZombiePoolInterface.
References getPoolIndex(), getVoxelIndex(), and OFFNODE.
void Ksolve::setNumAllVoxels | ( | unsigned int | num | ) | [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.
Referenced by initCinfo().
void Ksolve::setNumPools | ( | unsigned int | num | ) | [virtual] |
Assigns number of different pools (chemical species) present in each voxel. Inherited.
Implements ZombiePoolInterface.
Referenced by initCinfo().
void Ksolve::setNvec | ( | unsigned int | voxel, | |
vector< double > | vec | |||
) |
Referenced by initCinfo().
void Ksolve::setStoich | ( | Id | stoich | ) | [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.
References Element::cinfo(), Eref::data(), Id::element(), OdeSystem::epsAbs, OdeSystem::epsRel, Id::eref(), Stoich::getNumAllPools(), Stoich::getNumProxyPools(), VoxelPools::gslFunc(), OdeSystem::initStepSize, Cinfo::isA(), ZombiePoolInterface::isBuilt_, and ZombiePoolInterface::stoich_.
void Ksolve::setupXfer | ( | Id | myKsolve, | |
Id | otherKsolve, | |||
unsigned int | numProxyMols, | |||
const vector< VoxelJunction > & | vj | |||
) |
Reimplemented from ZombiePoolInterface.
void Ksolve::updateRateTerms | ( | unsigned int | index | ) | [virtual] |
Rescale specified voxel rate term following rate constant change or volume change. If index == ~0U then does all terms.
updateRateTerms obtains the latest parameters for the rates_ vector, and has each of the pools update its parameters including rescaling for volumes.
Implements ZombiePoolInterface.
References Stoich::getNumCoreRates(), and Stoich::getRateTerms().
void Ksolve::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.
Referenced by initCinfo().
double Ksolve::volume | ( | unsigned int | i | ) | const [virtual] |
Return volume of voxel i.
Implements ZombiePoolInterface.
Referenced by initCinfo(), initProc(), and initReinit().