MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
VoxelPoolsBase Class Referenceabstract

#include <VoxelPoolsBase.h>

+ Inheritance diagram for VoxelPoolsBase:
+ Collaboration diagram for VoxelPoolsBase:

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 StoichstoichPtr_
 

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

VoxelPoolsBase::VoxelPoolsBase ( )

Definition at line 25 of file VoxelPoolsBase.cpp.

25  :
26  stoichPtr_( 0 ),
27  S_(1),
28  Sinit_(1),
29  volume_(1.0)
30 {
31  ;
32 }
const Stoich * stoichPtr_
vector< double > S_
vector< double > Sinit_
VoxelPoolsBase::~VoxelPoolsBase ( )
virtual

Definition at line 34 of file VoxelPoolsBase.cpp.

35 {}

Member Function Documentation

void VoxelPoolsBase::addProxyTransferIndex ( unsigned int  comptIndex,
unsigned int  transferIndex 
)

Definition at line 253 of file VoxelPoolsBase.cpp.

References proxyTransferIndex_.

255 {
256  if ( comptIndex >= proxyTransferIndex_.size() )
257  proxyTransferIndex_.resize( comptIndex + 1 );
258  proxyTransferIndex_[comptIndex].push_back( transferIndex );
259 }
vector< vector< unsigned int > > 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_.

243 {
244  if ( comptIndex >= proxyPoolVoxels_.size() )
245  {
246  proxyPoolVoxels_.resize( comptIndex + 1 );
247  }
248 
249  proxyPoolVoxels_[comptIndex].push_back( voxel );
250  proxyComptMap_[otherComptId] = comptIndex;
251 }
vector< vector< unsigned int > > proxyPoolVoxels_
map< Id, unsigned int > proxyComptMap_
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_.

300 {
301  assert( i < xReacScaleProducts_.size() );
302  xReacScaleProducts_[i] *= volume / getVolume();
303  // cout << "backwardReacVolumeFactor[" << i << "] = "<< xReacScaleProducts_[i] <<endl;
304 }
vector< double > xReacScaleProducts_
double getVolume() const
Return the volume of the voxel.

+ Here is the call graph for this function:

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_.

323 {
324  assert (offSolverReacs.size() == offSolverReacCompts.size() );
325  // unsigned int numCoreRates = stoichPtr_->getNumCoreRates();
326  for ( unsigned int i = 0; i < offSolverReacCompts.size(); ++i )
327  {
328  const pair< Id, Id >& p = offSolverReacCompts[i];
329  if ( !isVoxelJunctionPresent( p.first, p.second) )
330  {
331  Id reacId = offSolverReacs[i];
332  const Cinfo* reacCinfo = reacId.element()->cinfo();
333  unsigned int k = stoichPtr_->convertIdToReacIndex( offSolverReacs[i] );
334  // Start by replacing the immediate cross reaction term.
335  if ( rates_[k] )
336  delete rates_[k];
337  rates_[k] = new ExternReac;
338  if ( stoichPtr_->getOneWay() )
339  {
340  k++; // Delete the next entry too, it is the reverse reacn.
341  assert( k < rates_.size() );
342  if ( reacCinfo->isA( "ReacBase" ) )
343  {
344  if ( rates_[k] )
345  delete rates_[k];
346  rates_[k] = new ExternReac;
347  }
348  if ( reacCinfo->isA( "CplxEnzBase" ) ) // Delete next two.
349  {
350  if ( rates_[k] )
351  delete rates_[k];
352  rates_[k] = new ExternReac;
353  k++;
354  assert( k < rates_.size() );
355  if ( rates_[k] )
356  delete rates_[k];
357  rates_[k] = new ExternReac;
358  }
359  }
360  else
361  {
362  if ( reacCinfo->isA( "CplxEnzBase" ) ) // Delete next one.
363  {
364  k++;
365  assert( k < rates_.size() );
366  if ( rates_[k] )
367  delete rates_[k];
368  rates_[k] = new ExternReac;
369  }
370  }
371  }
372  }
373 }
const Stoich * stoichPtr_
Element * element() const
Synonym for Id::operator()()
Definition: Id.cpp:113
bool isVoxelJunctionPresent(Id i1, Id i2) const
bool isA(const string &ancestor) const
Definition: Cinfo.cpp:280
const Cinfo * cinfo() const
Definition: Element.cpp:66
unsigned int convertIdToReacIndex(Id id) const
Definition: Stoich.cpp:1474
static const Cinfo * reacCinfo
Definition: Reac.cpp:41
Definition: Id.h:17
bool getOneWay() const
Definition: Stoich.cpp:305
vector< RateTerm * > rates_
Definition: Cinfo.h:18

+ Here is the call graph for this function:

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_.

293 {
294  assert( i < xReacScaleSubstrates_.size() );
295  xReacScaleSubstrates_[i] *= volume / getVolume();
296  // cout << "forwardReacVolumeFactor[" << i << "] = " << xReacScaleSubstrates_[i] <<endl;
297 }
double getVolume() const
Return the volume of the voxel.
vector< double > xReacScaleSubstrates_

+ Here is the call graph for this function:

double VoxelPoolsBase::getDiffConst ( unsigned int  i) const

Definition at line 179 of file VoxelPoolsBase.cpp.

180 {
181  return 0;
182 }
double VoxelPoolsBase::getN ( unsigned int  i) const

Definition at line 157 of file VoxelPoolsBase.cpp.

References S_.

158 {
159  return S_[i];
160 }
vector< double > S_
double VoxelPoolsBase::getNinit ( unsigned int  i) const

Definition at line 169 of file VoxelPoolsBase.cpp.

References Sinit_.

170 {
171  return Sinit_[i];
172 }
vector< double > Sinit_
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().

91 {
92  return volume_;
93 }

+ Here is the caller graph for this function:

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().

312 {
313  return xReacScaleProducts_[i];
314 }
vector< double > xReacScaleProducts_

+ Here is the caller graph for this function:

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().

307 {
308  return xReacScaleSubstrates_[i];
309 }
vector< double > xReacScaleSubstrates_

+ Here is the caller graph for this function:

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().

262 {
263  if ( comptIndex >= proxyPoolVoxels_.size() )
264  return false;
265  return (proxyPoolVoxels_[ comptIndex ].size() > 0);
266 }
unsigned int size() const
vector< vector< unsigned int > > proxyPoolVoxels_

+ Here is the call graph for this function:

bool VoxelPoolsBase::isVoxelJunctionPresent ( Id  i1,
Id  i2 
) const

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().

269 {
270  if ( i1 == Id () )
271  return false;
272  if ( proxyComptMap_.find( i1 ) == proxyComptMap_.end() )
273  return false;
274  if ( i2 == Id() ) // This is intentionally blank, only one jn.
275  return true;
276  // If there is an i2 but it isn't on the map, then not connected.
277  if ( proxyComptMap_.find( i2 ) == proxyComptMap_.end() )
278  return false;
279  return true;
280 }
Definition: Id.h:17
map< Id, unsigned int > proxyComptMap_

+ Here is the caller graph for this function:

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().

377 {
378  cout << "S_.size=" << S_.size() << ", volume = " << volume_ << endl;
379  cout << "proxyPoolsVoxels.size()=" << proxyPoolVoxels_.size() <<
380  ", proxyTransferIndex.size()=" << proxyTransferIndex_.size() <<
381  endl;
382  assert( proxyPoolVoxels_.size() == proxyTransferIndex_.size() );
383  for ( unsigned int i = 0; i < proxyPoolVoxels_.size(); ++i )
384  {
385  cout << "ppv[" << i << "]=";
386  const vector< unsigned int >& ppv = proxyPoolVoxels_[i];
387  for ( unsigned int j = 0; j < ppv.size(); ++j )
388  {
389  cout << " " << ppv[j];
390  }
391  cout << endl;
392  }
393  for ( unsigned int i = 0; i < proxyTransferIndex_.size(); ++i )
394  {
395  cout << "pti[" << i << "]=";
396  const vector< unsigned int >& pti = proxyTransferIndex_[i];
397  for ( unsigned int j = 0; j < pti.size(); ++j )
398  {
399  cout << " " << pti[j];
400  }
401  cout << endl;
402  }
403  cout <<
404  "xReacScaleSubstrates.size()=" << xReacScaleSubstrates_.size() <<
405  ", xReacScaleProducts.size()=" << xReacScaleProducts_.size() <<
406  endl;
407  assert( xReacScaleSubstrates_.size() == xReacScaleProducts_.size() );
408  for ( unsigned int i = 0; i < xReacScaleSubstrates_.size(); ++i )
409  {
410  cout << i << " " << xReacScaleSubstrates_[i] << " " <<
411  xReacScaleProducts_[i] << endl;
412  }
413  cout << "############## RATES ######################\n";
414  for ( unsigned int i = 0; i < rates_.size(); ++i )
415  {
416  cout << i << " : " << rates_[i]->getR1() << ", " <<
417  rates_[i]->getR2() << endl;
418  }
419 }
vector< double > xReacScaleProducts_
vector< double > S_
vector< vector< unsigned int > > proxyTransferIndex_
vector< double > xReacScaleSubstrates_
vector< vector< unsigned int > > proxyPoolVoxels_
vector< RateTerm * > rates_

+ Here is the caller graph for this function:

void VoxelPoolsBase::reinit ( )

Assigns S = Sinit and sets up initial dt.

Definition at line 47 of file VoxelPoolsBase.cpp.

References S_, and Sinit_.

Referenced by VoxelPools::reinit(), GssaVoxelPools::reinit(), and VoxelPools::setStoich().

48 {
49  S_ = Sinit_;
50 }
vector< double > S_
vector< double > Sinit_

+ Here is the caller graph for this function:

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_.

287 {
288  xReacScaleSubstrates_.assign( size, 1.0 );
289  xReacScaleProducts_.assign( size, 1.0 );
290 }
vector< double > xReacScaleProducts_
unsigned int size() const
vector< double > 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.

References S_, and Sinit_.

42 {
43  S_.resize( totNumPools, 0.0 );
44  Sinit_.resize( totNumPools, 0.0);
45 }
vector< double > S_
vector< double > Sinit_
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().

56 {
57  return &S_[0];
58 }
vector< double > S_

+ Here is the caller graph for this function:

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().

113 {
114  volume_ *= ratio; // Scale vol
115  for ( vector< double >::iterator
116  i = Sinit_.begin(); i != Sinit_.end(); ++i )
117  *i *= ratio; // Scale Bufs
118  // Here we also need to set the Ns for the buffered pools.
119  unsigned int start = stoichPtr_->getNumVarPools();
120  unsigned int end = start + stoichPtr_->getNumBufPools();
121  assert( end == Sinit_.size() );
122  for ( unsigned int i = start; i < end; ++i )
123  {
124  // Must not reassign pools that are controlled by functions.
125  if ( !stoichPtr->isFuncTarget(i) )
126  S_[i] = Sinit_[i];
127  }
128 
129  // Scale rates. Start by clearing out old rates if any
130  for ( unsigned int i = 0; i < rates_.size(); ++i )
131  delete( rates_[i] );
132 
133  unsigned int numCoreRates = stoichPtr->getNumCoreRates();
134  const vector< RateTerm* >& rates = stoichPtr->getRateTerms();
135  rates_.resize( rates.size() );
136  for ( unsigned int i = 0; i < numCoreRates; ++i )
137  rates_[i] = rates[i]->copyWithVolScaling( getVolume(), 1, 1 );
138  for ( unsigned int i = numCoreRates; i < rates.size(); ++i )
139  {
140  rates_[i] = rates[i]->copyWithVolScaling( getVolume(),
141  getXreacScaleSubstrates(i - numCoreRates),
142  getXreacScaleProducts(i - numCoreRates ) );
143  }
144 }
double getXreacScaleProducts(unsigned int i) const
const Stoich * stoichPtr_
vector< double > S_
double getVolume() const
Return the volume of the voxel.
vector< double > Sinit_
double getXreacScaleSubstrates(unsigned int i) const
unsigned int getNumBufPools() const
Returns number of local buffered pools.
Definition: Stoich.cpp:515
unsigned int getNumVarPools() const
Returns number of local pools that are updated by solver.
Definition: Stoich.cpp:510
bool isFuncTarget(unsigned int poolIndex) const
Returns true if the specified pool is controlled by a func.
Definition: Stoich.cpp:606
unsigned int getNumCoreRates() const
Number of rate terms for reactions purely on this compartment.
Definition: Stoich.cpp:574
const vector< RateTerm * > & getRateTerms() const
Returns a reference to the entire rates_ vector.
Definition: Stoich.cpp:589
vector< RateTerm * > rates_

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void VoxelPoolsBase::setDiffConst ( unsigned int  i,
double  v 
)

Definition at line 174 of file VoxelPoolsBase.cpp.

175 {
176  ; // Do nothing.
177 }
void VoxelPoolsBase::setN ( unsigned int  i,
double  v 
)

Definition at line 150 of file VoxelPoolsBase.cpp.

References S_.

151 {
152  S_[i] = v;
153  if ( S_[i] < 0.0 )
154  S_[i] = 0.0;
155 }
vector< double > S_
void VoxelPoolsBase::setNinit ( unsigned int  i,
double  v 
)

Definition at line 162 of file VoxelPoolsBase.cpp.

References Sinit_.

163 {
164  Sinit_[i] = v;
165  if ( Sinit_[i] < 0.0 )
166  Sinit_[i] = 0.0;
167 }
vector< double > Sinit_
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().

86 {
87  volume_ = vol;
88 }

+ Here is the caller graph for this function:

void VoxelPoolsBase::setVolumeAndDependencies ( double  vol)
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().

96 {
97  double ratio = vol / volume_;
98  volume_ = vol;
99  for ( vector< double >::iterator
100  i = Sinit_.begin(); i != Sinit_.end(); ++i )
101  *i *= ratio;
102 
103  for ( vector< double >::iterator i = S_.begin(); i != S_.end(); ++i )
104  *i *= ratio;
105 
106  // I would like to update the xReacScaleSubstreates and Products here,
107  // but I don't know the order of their reactions. So leave it to
108  // a subsequent call via Ksolve or Stoich.
109 }
vector< double > S_
vector< double > Sinit_

+ Here is the caller graph for this function:

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_.

71 {
72  return &Sinit_[0];
73 }
vector< double > Sinit_
unsigned int VoxelPoolsBase::size ( ) const

Returns # of pools

Definition at line 80 of file VoxelPoolsBase.cpp.

References Sinit_.

Referenced by hasXfer().

81 {
82  return Sinit_.size();
83 }
vector< double > Sinit_

+ Here is the caller graph for this function:

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().

61 {
62  return S_;
63 }
vector< double > S_

+ Here is the caller graph for this function:

virtual void VoxelPoolsBase::updateAllRateTerms ( const vector< RateTerm * > &  rates,
unsigned int  numCoreRates 
)
pure virtual

Reassign entire rate vector.

Implemented in VoxelPools, and GssaVoxelPools.

virtual void VoxelPoolsBase::updateRateTerms ( const vector< RateTerm * > &  rates,
unsigned int  numCoreRates,
unsigned int  index 
)
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().

66 {
67  return &S_[0];
68 }
vector< double > S_

+ Here is the caller graph for this function:

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_.

76 {
77  return &Sinit_[0];
78 }
vector< double > 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_.

192 {
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 )
198  {
199  S_[*k] += *i++ - *j++;
200  }
201 }
vector< double > 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_.

208 {
209  unsigned int offset = voxelIndex * poolIndex.size();
210  vector< double >::const_iterator i = values.begin() + offset;
211  unsigned int proxyEndIndex = stoichPtr_->getNumVarPools() +
213  for ( vector< unsigned int >::const_iterator
214  k = poolIndex.begin(); k != poolIndex.end(); ++k )
215  {
216  // if ( *k >= S_.size() - numProxyPools )
217  if ( *k >= stoichPtr_->getNumVarPools() && *k < proxyEndIndex )
218  {
219  // cout << S_[*k] << ", " << Sinit_[*k] << ", " << *i << endl;
220  Sinit_[*k] = *i;
221  S_[*k] = *i;
222  }
223  i++;
224  }
225 }
const Stoich * stoichPtr_
vector< double > S_
vector< double > Sinit_
unsigned int getNumVarPools() const
Returns number of local pools that are updated by solver.
Definition: Stoich.cpp:510
unsigned int getNumProxyPools() const
Definition: Stoich.cpp:525

+ Here is the call graph for this function:

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_.

231 {
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 )
236  {
237  *i++ = S_[*k];
238  }
239 }
vector< double > S_

Member Data Documentation

map< Id, unsigned int > VoxelPoolsBase::proxyComptMap_
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().

vector< vector< unsigned int > > VoxelPoolsBase::proxyPoolVoxels_
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().

vector< vector< unsigned int > > VoxelPoolsBase::proxyTransferIndex_
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().

vector< double > VoxelPoolsBase::S_
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().

vector< double > VoxelPoolsBase::Sinit_
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().

double VoxelPoolsBase::volume_
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().

vector< double > VoxelPoolsBase::xReacScaleProducts_
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().

vector< double > VoxelPoolsBase::xReacScaleSubstrates_
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().


The documentation for this class was generated from the following files: