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

#include <DiffPoolVec.h>

+ Collaboration diagram for DiffPoolVec:

Public Member Functions

void advance (double dt)
 
 DiffPoolVec ()
 
double getDiffConst () const
 
unsigned int getId () const
 
double getMotorConst () const
 
double getN (unsigned int vox) const
 
double getNinit (unsigned int vox) const
 
unsigned int getNumVoxels () const
 
const vector< double > & getNvec () const
 Used by parent solver to manipulate 'n'. More...
 
double getPrev (unsigned int vox) const
 
void process ()
 
void reinit ()
 
void setDiffConst (double value)
 
void setId (unsigned int id)
 
void setMotorConst (double value)
 
void setN (unsigned int vox, double value)
 
void setNinit (unsigned int vox, double value)
 
void setNumVoxels (unsigned int num)
 
void setNvec (const vector< double > &n)
 Used by parent solver to manipulate 'n'. More...
 
void setNvec (unsigned int start, unsigned int num, vector< double >::const_iterator q)
 
void setOps (const vector< Triplet< double > > &ops_, const vector< double > &diagVal_)
 Assigns prev_ = n_. More...
 
void setPrevVec ()
 

Private Attributes

vector< double > diagVal_
 
double diffConst_
 Boundary condition: Initial 'n'. More...
 
unsigned int id_
 Assign operations. More...
 
double motorConst_
 Diffusion const, assumed uniform. More...
 
vector< double > n_
 Integer conversion of Id of pool handled. More...
 
vector< double > nInit_
 

molecules of pool on previous timestep

More...
 
vector< Triplet< double > > ops_
 Motor const, ie, transport rate. More...
 
vector< double > prev_
 Number of molecules of pool in each voxel. More...
 

Detailed Description

This is a FieldElement of the Dsolve class. It manages (ie., zombifies) a specific pool, and the pool maintains a pointer to it. For accessing volumes, this maintains a pointer to the relevant ChemCompt.

Definition at line 18 of file DiffPoolVec.h.

Constructor & Destructor Documentation

DiffPoolVec::DiffPoolVec ( )

Default is to create it with a single compartment, independent of any solver, so that we can set it up as a dummy DiffPool for the Pool to work on in single-compartment models.

Definition at line 25 of file DiffPoolVec.cpp.

26  : id_( 0 ), n_( 1, 0.0 ), nInit_( 1, 0.0 ),
27  diffConst_( 1.0e-12 ), motorConst_( 0.0 )
28 {
29  ;
30 }
unsigned int id_
Assign operations.
Definition: DiffPoolVec.h:56
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
double diffConst_
Boundary condition: Initial 'n'.
Definition: DiffPoolVec.h:60
double motorConst_
Diffusion const, assumed uniform.
Definition: DiffPoolVec.h:61
vector< double > nInit_
molecules of pool on previous timestep
Definition: DiffPoolVec.h:59

Member Function Documentation

void DiffPoolVec::advance ( double  dt)

Definition at line 144 of file DiffPoolVec.cpp.

References diagVal_, n_, and ops_.

145 {
146  if ( ops_.size() == 0 ) return;
147  for ( vector< Triplet< double > >::const_iterator
148  i = ops_.begin(); i != ops_.end(); ++i )
149  n_[i->c_] -= n_[i->b_] * i->a_;
150 
151  assert( n_.size() == diagVal_.size() );
152  vector< double >::iterator iy = n_.begin();
153  for ( vector< double >::const_iterator
154  i = diagVal_.begin(); i != diagVal_.end(); ++i )
155  *iy++ *= *i;
156 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
vector< Triplet< double > > ops_
Motor const, ie, transport rate.
Definition: DiffPoolVec.h:62
vector< double > diagVal_
Definition: DiffPoolVec.h:63
double DiffPoolVec::getDiffConst ( ) const

Definition at line 87 of file DiffPoolVec.cpp.

References diffConst_.

Referenced by Dsolve::calcJnDiff().

88 {
89  return diffConst_;
90 }
double diffConst_
Boundary condition: Initial 'n'.
Definition: DiffPoolVec.h:60

+ Here is the caller graph for this function:

unsigned int DiffPoolVec::getId ( ) const

Definition at line 123 of file DiffPoolVec.cpp.

References id_.

124 {
125  return id_;
126 }
unsigned int id_
Assign operations.
Definition: DiffPoolVec.h:56
double DiffPoolVec::getMotorConst ( ) const

Definition at line 97 of file DiffPoolVec.cpp.

References motorConst_.

98 {
99  return motorConst_;
100 }
double motorConst_
Diffusion const, assumed uniform.
Definition: DiffPoolVec.h:61
double DiffPoolVec::getN ( unsigned int  vox) const

Definition at line 44 of file DiffPoolVec.cpp.

References n_.

Referenced by Dsolve::calcJnChan(), Dsolve::calcJnDiff(), Dsolve::calcJnXfer(), and Dsolve::calcOtherJnChan().

45 {
46  assert( voxel < n_.size() );
47  return n_[ voxel ];
48 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57

+ Here is the caller graph for this function:

double DiffPoolVec::getNinit ( unsigned int  vox) const

Definition at line 32 of file DiffPoolVec.cpp.

References nInit_.

33 {
34  assert( voxel < nInit_.size() );
35  return nInit_[ voxel ];
36 }
vector< double > nInit_
molecules of pool on previous timestep
Definition: DiffPoolVec.h:59
unsigned int DiffPoolVec::getNumVoxels ( ) const

Definition at line 113 of file DiffPoolVec.cpp.

References n_.

114 {
115  return n_.size();
116 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
const vector< double > & DiffPoolVec::getNvec ( ) const

Used by parent solver to manipulate 'n'.

Definition at line 62 of file DiffPoolVec.cpp.

References n_.

63 {
64  return n_;
65 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
double DiffPoolVec::getPrev ( unsigned int  vox) const

Definition at line 56 of file DiffPoolVec.cpp.

References n_, and prev_.

Referenced by Dsolve::calcJnXfer().

57 {
58  assert( voxel < n_.size() );
59  return prev_[ voxel ];
60 }
vector< double > prev_
Number of molecules of pool in each voxel.
Definition: DiffPoolVec.h:58
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57

+ Here is the caller graph for this function:

void DiffPoolVec::process ( )
void DiffPoolVec::reinit ( )

Definition at line 158 of file DiffPoolVec.cpp.

References n_, nInit_, and prev_.

159 {
160  assert( n_.size() == nInit_.size() );
161  prev_ = n_ = nInit_;
162 }
vector< double > prev_
Number of molecules of pool in each voxel.
Definition: DiffPoolVec.h:58
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
vector< double > nInit_
molecules of pool on previous timestep
Definition: DiffPoolVec.h:59
void DiffPoolVec::setDiffConst ( double  value)

Definition at line 92 of file DiffPoolVec.cpp.

References diffConst_.

93 {
94  diffConst_ = v;
95 }
double diffConst_
Boundary condition: Initial 'n'.
Definition: DiffPoolVec.h:60
void DiffPoolVec::setId ( unsigned int  id)

Definition at line 118 of file DiffPoolVec.cpp.

References id, and id_.

119 {
120  id_ = id;
121 }
unsigned int id_
Assign operations.
Definition: DiffPoolVec.h:56
static char id[]
Definition: mfield.cpp:404
void DiffPoolVec::setMotorConst ( double  value)

Definition at line 102 of file DiffPoolVec.cpp.

References motorConst_.

103 {
104  motorConst_ = v;
105 }
double motorConst_
Diffusion const, assumed uniform.
Definition: DiffPoolVec.h:61
void DiffPoolVec::setN ( unsigned int  vox,
double  value 
)

Definition at line 50 of file DiffPoolVec.cpp.

References n_.

Referenced by Dsolve::calcJnChan(), Dsolve::calcJnDiff(), Dsolve::calcJnXfer(), and Dsolve::calcOtherJnChan().

51 {
52  assert( voxel < n_.size() );
53  n_[ voxel ] = v;
54 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57

+ Here is the caller graph for this function:

void DiffPoolVec::setNinit ( unsigned int  vox,
double  value 
)

Definition at line 38 of file DiffPoolVec.cpp.

References nInit_.

39 {
40  assert( voxel < nInit_.size() );
41  nInit_[ voxel ] = v;
42 }
vector< double > nInit_
molecules of pool on previous timestep
Definition: DiffPoolVec.h:59
void DiffPoolVec::setNumVoxels ( unsigned int  num)

Definition at line 107 of file DiffPoolVec.cpp.

References n_, and nInit_.

108 {
109  nInit_.resize( num, 0.0 );
110  n_.resize( num, 0.0 );
111 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
vector< double > nInit_
molecules of pool on previous timestep
Definition: DiffPoolVec.h:59
void DiffPoolVec::setNvec ( const vector< double > &  n)

Used by parent solver to manipulate 'n'.

Definition at line 67 of file DiffPoolVec.cpp.

References n_.

68 {
69  assert( vec.size() == n_.size() );
70  n_ = vec;
71 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
void DiffPoolVec::setNvec ( unsigned int  start,
unsigned int  num,
vector< double >::const_iterator  q 
)

Definition at line 73 of file DiffPoolVec.cpp.

References n_.

75 {
76  assert( start + num <= n_.size() );
77  vector< double >::iterator p = n_.begin() + start;
78  for ( unsigned int i = 0; i < num; ++i )
79  *p++ = *q++;
80 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
void DiffPoolVec::setOps ( const vector< Triplet< double > > &  ops_,
const vector< double > &  diagVal_ 
)

Assigns prev_ = n_.

Definition at line 128 of file DiffPoolVec.cpp.

References diagVal_, n_, and ops_.

130 {
131  if ( ops.size() > 0 )
132  {
133  assert( diagVal.size() == n_.size() );
134  ops_ = ops;
135  diagVal_ = diagVal;
136  }
137  else
138  {
139  ops_.clear();
140  diagVal_.clear();
141  }
142 }
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57
void DiffPoolVec::setPrevVec ( )

Definition at line 82 of file DiffPoolVec.cpp.

References n_, and prev_.

83 {
84  prev_ = n_;
85 }
vector< double > prev_
Number of molecules of pool in each voxel.
Definition: DiffPoolVec.h:58
vector< double > n_
Integer conversion of Id of pool handled.
Definition: DiffPoolVec.h:57

Member Data Documentation

vector< double > DiffPoolVec::diagVal_
private

Definition at line 63 of file DiffPoolVec.h.

Referenced by advance(), and setOps().

double DiffPoolVec::diffConst_
private

Boundary condition: Initial 'n'.

Definition at line 60 of file DiffPoolVec.h.

Referenced by getDiffConst(), and setDiffConst().

unsigned int DiffPoolVec::id_
private

Assign operations.

Definition at line 56 of file DiffPoolVec.h.

Referenced by getId(), and setId().

double DiffPoolVec::motorConst_
private

Diffusion const, assumed uniform.

Definition at line 61 of file DiffPoolVec.h.

Referenced by getMotorConst(), and setMotorConst().

vector< double > DiffPoolVec::n_
private

Integer conversion of Id of pool handled.

Definition at line 57 of file DiffPoolVec.h.

Referenced by advance(), getN(), getNumVoxels(), getNvec(), getPrev(), reinit(), setN(), setNumVoxels(), setNvec(), setOps(), and setPrevVec().

vector< double > DiffPoolVec::nInit_
private

molecules of pool on previous timestep

Definition at line 59 of file DiffPoolVec.h.

Referenced by getNinit(), reinit(), setNinit(), and setNumVoxels().

vector< Triplet< double > > DiffPoolVec::ops_
private

Motor const, ie, transport rate.

Definition at line 62 of file DiffPoolVec.h.

Referenced by advance(), and setOps().

vector< double > DiffPoolVec::prev_
private

Number of molecules of pool in each voxel.

Definition at line 58 of file DiffPoolVec.h.

Referenced by getPrev(), reinit(), and setPrevVec().


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