MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Dsolve.cpp File Reference
#include "header.h"
#include "ElementValueFinfo.h"
#include "SparseMatrix.h"
#include "KinSparseMatrix.h"
#include "VoxelPoolsBase.h"
#include "../mesh/VoxelJunction.h"
#include "XferInfo.h"
#include "ZombiePoolInterface.h"
#include "../kinetics/ConcChan.h"
#include "DiffPoolVec.h"
#include "ConcChanInfo.h"
#include "FastMatrixElim.h"
#include "DiffJunction.h"
#include "Dsolve.h"
#include "../mesh/Boundary.h"
#include "../mesh/MeshEntry.h"
#include "../mesh/ChemCompt.h"
#include "../mesh/MeshCompt.h"
#include "../shell/Wildcard.h"
#include "../kinetics/PoolBase.h"
#include "../kinetics/Pool.h"
#include "../kinetics/BufPool.h"
#include "../ksolve/ZombiePool.h"
#include "../ksolve/ZombieBufPool.h"
+ Include dependency graph for Dsolve.cpp:

Go to the source code of this file.

Functions

static bool checkJn (const vector< DiffJunction > &jn, unsigned int voxel, const string &info)
 
static double integ (double myN, double rf, double rb, double dt)
 
static void mapVoxelsBetweenMeshes (DiffJunction &jn, Id self, Id other)
 
void printJunction (Id self, Id other, const DiffJunction &jn)
 

Variables

static const CinfodsolveCinfo = Dsolve::initCinfo()
 

Function Documentation

static bool checkJn ( const vector< DiffJunction > &  jn,
unsigned int  voxel,
const string &  info 
)
static

Definition at line 225 of file Dsolve.cpp.

Referenced by Dsolve::getDiffScale(), Dsolve::getDiffVol1(), Dsolve::getDiffVol2(), Dsolve::setDiffScale(), Dsolve::setDiffVol1(), and Dsolve::setDiffVol2().

227 {
228  if ( jn.size() < 1 ) {
229  cout << "Warning: Dsolve::" << info << ": junctions not defined.\n";
230  return false;
231  }
232  if ( jn[0].vj.size() < voxel + 1 ) {
233  cout << "Warning: Dsolve:: " << info << ": " << voxel <<
234  "out of range.\n";
235  return false;
236  }
237  return true;
238 }

+ Here is the caller graph for this function:

static double integ ( double  myN,
double  rf,
double  rb,
double  dt 
)
static

Definition at line 295 of file Dsolve.cpp.

References EPSILON.

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

296 {
297  const double EPSILON = 1e-12;
298  if ( myN > EPSILON && rf > EPSILON ) {
299  double C = exp( -rf * dt / myN );
300  myN *= C + ( rb / rf ) * ( 1.0 - C );
301  } else {
302  myN += ( rb - rf ) * dt;
303  }
304  if ( myN < 0.0 )
305  return 0.0;
306  return myN;
307 }
#define EPSILON
Definition: MatrixOps.h:28

+ Here is the caller graph for this function:

static void mapVoxelsBetweenMeshes ( DiffJunction jn,
Id  self,
Id  other 
)
static

Definition at line 921 of file Dsolve.cpp.

References Eref::data(), Id::eref(), Field< A >::get(), ChemCompt::getVoxelVolume(), ChemCompt::matchMeshEntries(), and DiffJunction::vj.

Referenced by Dsolve::innerBuildMeshJunctions().

922 {
923  Id myMesh = Field< Id >::get( self, "compartment" );
924  Id otherMesh = Field< Id >::get( other, "compartment" );
925 
926  const ChemCompt* myCompt = reinterpret_cast< const ChemCompt* >(
927  myMesh.eref().data() );
928  const ChemCompt* otherCompt = reinterpret_cast< const ChemCompt* >(
929  otherMesh.eref().data() );
930  myCompt->matchMeshEntries( otherCompt, jn.vj );
931  vector< double > myVols = myCompt->getVoxelVolume();
932  vector< double > otherVols = otherCompt->getVoxelVolume();
933  for ( vector< VoxelJunction >::iterator
934  i = jn.vj.begin(); i != jn.vj.end(); ++i ) {
935  i->firstVol = myVols[i->first];
936  i->secondVol = otherVols[i->second];
937  }
938 }
char * data() const
Definition: Eref.cpp:41
vector< double > getVoxelVolume() const
Returns vector of all voxel volumes in compartment.
Definition: ChemCompt.cpp:313
Eref eref() const
Definition: Id.cpp:125
Definition: Id.h:17
virtual void matchMeshEntries(const ChemCompt *other, vector< VoxelJunction > &ret) const =0
vector< VoxelJunction > vj
Definition: DiffJunction.h:49
static A get(const ObjId &dest, const string &field)
Definition: SetGet.h:284

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void printJunction ( Id  self,
Id  other,
const DiffJunction jn 
)

Definition at line 810 of file Dsolve.cpp.

References DiffJunction::myPools, DiffJunction::otherPools, Id::path(), and DiffJunction::vj.

811 {
812  cout << "Junction between " << self.path() << ", " << other.path() << endl;
813  cout << "Pool indices: myPools, otherPools\n";
814  for ( unsigned int i = 0; i < jn.myPools.size(); ++i )
815  cout << i << " " << jn.myPools[i] << " " << jn.otherPools[i] << endl;
816  cout << "Voxel junctions: first second firstVol secondVol diffScale\n";
817  for ( unsigned int i = 0; i < jn.vj.size(); ++i ) {
818  cout << i << " " << jn.vj[i].first << " " << jn.vj[i].second <<
819  " " << jn.vj[i].firstVol << " " << jn.vj[i].secondVol <<
820  " " << jn.vj[i].diffScale << endl;
821  }
822 }
std::string path(const std::string &separator="/") const
Definition: Id.cpp:76
vector< unsigned int > otherPools
Definition: DiffJunction.h:38
vector< unsigned int > myPools
Definition: DiffJunction.h:37
vector< VoxelJunction > vj
Definition: DiffJunction.h:49

+ Here is the call graph for this function:

Variable Documentation

const Cinfo* dsolveCinfo = Dsolve::initCinfo()
static

Definition at line 183 of file Dsolve.cpp.

Referenced by Dsolve::initCinfo().