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

#include <MeshEntry.h>

+ Collaboration diagram for MeshEntry:

Public Member Functions

void extent (DataId di, double volume, double area, double perimeter)
 
vector< double > getCoordinates (const Eref &e) const
 
vector< double > getDiffusionArea (const Eref &e) const
 
vector< double > getDiffusionScaling (const Eref &e) const
 
unsigned int getDimensions (const Eref &e) const
 
unsigned int getMeshType (const Eref &e) const
 
vector< unsigned int > getNeighbors (const Eref &e) const
 
double getVolume (const Eref &e) const
 
 MeshEntry ()
 
 MeshEntry (const ChemCompt *parent)
 
void process (const Eref &e, ProcPtr info)
 
void reinit (const Eref &e, ProcPtr info)
 
void triggerRemesh (const Eref &e, double oldvol, unsigned int startEntry, const vector< unsigned int > &localIndices, const vector< double > &vols)
 

Static Public Member Functions

static const CinfoinitCinfo ()
 

Private Attributes

const ChemComptparent_
 Volume or area. More...
 
double volume_
 

Detailed Description

The MeshEntry is a single 'compartment' in the mathematical sense, that is, all properties are assumed homogenous within it. It is a FieldElement, so it gets all its values from the parent ChemCompt.

Definition at line 33 of file MeshEntry.h.

Constructor & Destructor Documentation

MeshEntry::MeshEntry ( )

Definition at line 183 of file MeshEntry.cpp.

184  : parent_( 0 )
185 {;}
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
MeshEntry::MeshEntry ( const ChemCompt parent)

Definition at line 187 of file MeshEntry.cpp.

188  : parent_( parent )
189 {;}
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127

Member Function Documentation

void MeshEntry::extent ( DataId  di,
double  volume,
double  area,
double  perimeter 
)
vector< double > MeshEntry::getCoordinates ( const Eref e) const

Coords that define current MeshEntry. Usually generated on the fly by passing the current Field Index to the parent ChemCompt subclass, which will figure it out.

Definition at line 242 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getCoordinates(), and parent_.

Referenced by initCinfo().

243 {
244  return parent_->getCoordinates( e.fieldIndex() );
245 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
virtual vector< double > getCoordinates(unsigned int fid) const =0
Virtual function to return coords of mesh Entry.
unsigned int fieldIndex() const
Definition: Eref.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vector< double > MeshEntry::getDiffusionArea ( const Eref e) const

Diffusion scaling for area

Definition at line 253 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getDiffusionArea(), and parent_.

Referenced by initCinfo().

254 {
255  return parent_->getDiffusionArea( e.fieldIndex() );
256 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual vector< double > getDiffusionArea(unsigned int fid) const =0
Virtual function to return diffusion X-section area per neighbor.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vector< double > MeshEntry::getDiffusionScaling ( const Eref e) const

Diffusion scaling for geometry of interface

Definition at line 259 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getDiffusionScaling(), and parent_.

Referenced by initCinfo().

260 {
261  return parent_->getDiffusionScaling( e.fieldIndex() );
262 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual vector< double > getDiffusionScaling(unsigned int fid) const =0
Virtual function to return scale factor for diffusion. 1 here.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int MeshEntry::getDimensions ( const Eref e) const

returns number of dimension

Definition at line 232 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getMeshDimensions(), and parent_.

Referenced by initCinfo().

233 {
234  return parent_->getMeshDimensions( e.fieldIndex() );
235 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
virtual unsigned int getMeshDimensions(unsigned int fid) const =0
Virtual function to return dimensions of specified entry.
unsigned int fieldIndex() const
Definition: Eref.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int MeshEntry::getMeshType ( const Eref e) const

The MeshType defines the shape of the mesh entry. 0: Not assigned 1: cuboid 2: cylinder

  1. cylindrical shell 4: cylindrical shell segment 5: sphere 6: spherical shell 7: spherical shell segment 8: Tetrahedral 9: EndoMesh

Definition at line 237 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getMeshType(), and parent_.

Referenced by initCinfo().

238 {
239  return parent_->getMeshType( e.fieldIndex() );
240 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual unsigned int getMeshType(unsigned int fid) const =0
Virtual function to return MeshType of specified entry.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vector< unsigned int > MeshEntry::getNeighbors ( const Eref e) const

Indices of other Entries that this one connects to, for diffusion

Definition at line 247 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getNeighbors(), and parent_.

Referenced by initCinfo().

248 {
249  return parent_->getNeighbors( e.fieldIndex() );
250 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual vector< unsigned int > getNeighbors(unsigned int fid) const =0
Virtual function to return info on Entries connected to this one.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double MeshEntry::getVolume ( const Eref e) const

Definition at line 226 of file MeshEntry.cpp.

References Eref::fieldIndex(), ChemCompt::getMeshEntryVolume(), and parent_.

Referenced by initCinfo().

227 {
228  //return parent_->getMeshEntryVolume( e.dataIndex() );
229  return parent_->getMeshEntryVolume( e.fieldIndex() );
230 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int fieldIndex() const
Definition: Eref.h:61
virtual double getMeshEntryVolume(unsigned int fid) const =0
Virtual function to return volume of mesh Entry.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const Cinfo * MeshEntry::initCinfo ( )
static

Definition at line 47 of file MeshEntry.cpp.

References getCoordinates(), getDiffusionArea(), getDiffusionScaling(), getDimensions(), ValueFinfoBase::getFinfo(), getMeshType(), getNeighbors(), getVolume(), Neutral::initCinfo(), meshEntryCinfo, process(), reinit(), remeshOut(), and remeshReacsOut().

Referenced by ChemCompt::initCinfo().

48 {
50  // Field Definitions
53  "volume",
54  "Volume of this MeshEntry",
56  );
57 
59  dimensions (
60  "dimensions",
61  "number of dimensions of this MeshEntry",
63  );
64 
66  meshType(
67  "meshType",
68  " The MeshType defines the shape of the mesh entry."
69  " 0: Not assigned"
70  " 1: cuboid"
71  " 2: cylinder"
72  " 3. cylindrical shell"
73  " 4: cylindrical shell segment"
74  " 5: sphere"
75  " 6: spherical shell"
76  " 7: spherical shell segment"
77  " 8: Tetrahedral",
79  );
80 
82  coordinates (
83  "Coordinates",
84  "Coordinates that define current MeshEntry. Depend on MeshType.",
86  );
87 
89  neighbors (
90  "neighbors",
91  "Indices of other MeshEntries that this one connects to",
93  );
94 
96  diffusionArea (
97  "DiffusionArea",
98  "Diffusion area for geometry of interface",
100  );
101 
103  diffusionScaling (
104  "DiffusionScaling",
105  "Diffusion scaling for geometry of interface",
107  );
108 
110  // MsgDest Definitions
112  static DestFinfo process( "process",
113  "Handles process call",
115  static DestFinfo reinit( "reinit",
116  "Handles reinit call",
119  // Shared definitions
121  static Finfo* procShared[] = {
122  &process, &reinit
123  };
124  static SharedFinfo proc( "proc",
125  "Shared message for process and reinit",
126  procShared, sizeof( procShared ) / sizeof( const Finfo* )
127  );
128 
129  static Finfo* meshShared[] = {
130  remeshOut(), volume.getFinfo()
131  };
132 
133  static SharedFinfo mesh( "mesh",
134  "Shared message for updating mesh volumes and subdivisions,"
135  "typically controls pool volumes",
136  meshShared, sizeof( meshShared ) / sizeof( const Finfo* )
137  );
138 
139 
141  // SrcFinfo Definitions
143 
144  static Finfo* meshFinfos[] = {
145  &volume, // Readonly Value
146  &dimensions, // Readonly Value
147  &meshType, // Readonly Value
148  &coordinates, // Readonly Value
149  &neighbors, // Readonly Value
150  &diffusionArea, // Readonly Value
151  &diffusionScaling, // Readonly Value
152  &proc, // SharedFinfo
153  &mesh, // SharedFinfo
154  remeshReacsOut(), // SrcFinfo
155  };
156 
157  static string doc[] =
158  {
159  "Name", "MeshEntry",
160  "Author", "Upi Bhalla",
161  "Description", "One voxel in a chemical reaction compartment",
162  };
163  static Dinfo< MeshEntry > dinfo;
164  static Cinfo meshEntryCinfo (
165  "MeshEntry",
167  meshFinfos,
168  sizeof( meshFinfos ) / sizeof ( Finfo* ),
169  &dinfo,
170  doc,
171  sizeof(doc)/sizeof( string ),
172  true // This IS a FieldElement, not be be created directly.
173  );
174 
175  return &meshEntryCinfo;
176 }
static const Cinfo * meshEntryCinfo
Definition: MeshEntry.cpp:181
Definition: Dinfo.h:60
void reinit(const Eref &e, ProcPtr info)
Definition: MeshEntry.cpp:213
double getVolume(const Eref &e) const
Definition: MeshEntry.cpp:226
vector< unsigned int > getNeighbors(const Eref &e) const
Definition: MeshEntry.cpp:247
static SrcFinfo5< double, unsigned int, unsigned int, vector< unsigned int >, vector< double > > * remeshOut()
Definition: MeshEntry.cpp:17
unsigned int getDimensions(const Eref &e) const
Definition: MeshEntry.cpp:232
static SrcFinfo0 * remeshReacsOut()
Definition: MeshEntry.cpp:36
void process(const Eref &e, ProcPtr info)
Definition: MeshEntry.cpp:204
vector< double > getCoordinates(const Eref &e) const
Definition: MeshEntry.cpp:242
vector< double > getDiffusionArea(const Eref &e) const
Definition: MeshEntry.cpp:253
vector< double > getDiffusionScaling(const Eref &e) const
Definition: MeshEntry.cpp:259
static const Cinfo * initCinfo()
Definition: Neutral.cpp:16
unsigned int getMeshType(const Eref &e) const
Definition: MeshEntry.cpp:237
Definition: Cinfo.h:18
Definition: Finfo.h:12

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MeshEntry::process ( const Eref e,
ProcPtr  info 
)

Update the diffusion rate terms. Note that these stay the same through the entire clock tick, even if the GSL solver takes many intermediate steps. The assumption is that the concs change slowly enough that the diffusion terms are not hugely changed over the duration of one tick. Also assume that diffusion itself is slow. The latter assumption is OK for suitable grid sizes. The first assumption is OK with a sensible tick step.

Definition at line 204 of file MeshEntry.cpp.

Referenced by initCinfo().

205 {
206  // cout << "updateDiffusion for " << e.fieldIndex() << ", at t = " << info->currTime << ", on thr = " << info->threadIndexInGroup << endl << flush;
207  // parent_->updateDiffusion( e.fieldIndex() );
208 }

+ Here is the caller graph for this function:

void MeshEntry::reinit ( const Eref e,
ProcPtr  info 
)

Assigns the Stoich Id to the parent.

Definition at line 213 of file MeshEntry.cpp.

References Eref::dataIndex(), and Neutral::parent().

Referenced by initCinfo().

214 {
215  if ( e.dataIndex() == 0 ) {
216  ObjId pa = Neutral::parent( e );
217  // parent_->lookupStoich( pa );
218  }
219 }
static ObjId parent(const Eref &e)
Definition: Neutral.cpp:701
unsigned int dataIndex() const
Definition: Eref.h:50
Definition: ObjId.h:20

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MeshEntry::triggerRemesh ( const Eref e,
double  oldvol,
unsigned int  startEntry,
const vector< unsigned int > &  localIndices,
const vector< double > &  vols 
)

Definition at line 267 of file MeshEntry.cpp.

References ChemCompt::getNumEntries(), parent_, remeshOut(), remeshReacsOut(), and SrcFinfo0::send().

Referenced by PsdMesh::handlePsdList(), and SpineMesh::handleSpineList().

271 {
272  // cout << "MeshEntry::triggerRemesh on " << e.element()->getName() << endl;
273  remeshOut()->send( e, oldvol, parent_->getNumEntries(),
274  startEntry, localIndices, vols );
275  remeshReacsOut()->send( e );
276 }
const ChemCompt * parent_
Volume or area.
Definition: MeshEntry.h:127
unsigned int getNumEntries() const
Definition: ChemCompt.cpp:390
static SrcFinfo5< double, unsigned int, unsigned int, vector< unsigned int >, vector< double > > * remeshOut()
Definition: MeshEntry.cpp:17
static SrcFinfo0 * remeshReacsOut()
Definition: MeshEntry.cpp:36
void send(const Eref &e) const
Definition: SrcFinfo.cpp:70

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

const ChemCompt* MeshEntry::parent_
private
double MeshEntry::volume_
private

Definition at line 126 of file MeshEntry.h.


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