MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MeshCompt.h
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2011 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #ifndef _MESH_COMPT_H
11 #define _MESH_COMPT_H
12 
20 class MeshCompt: public ChemCompt
21 {
22  public:
23  MeshCompt();
24  ~MeshCompt();
25 
27 
31  double extendedMeshEntryVolume( unsigned int fid ) const;
32 
35 
37  void innerResetStencil();
38 
41  unsigned int getStencilRow( unsigned int meshIndex,
42  const double** entry, const unsigned int** colIndex ) const;
43 
45  const SparseMatrix< double >& getStencil() const;
46 
48  vector< unsigned int > getNeighbors( unsigned int fid ) const;
49 
54  vector< double > innerGetStencilRate( unsigned int row ) const;
55 
56  void addRow( unsigned int index, const vector< double >& entry,
57  const vector< unsigned int >& colIndex );
58 
59  void setStencilSize( unsigned int numRows, unsigned int numCols );
60 
62 
64  void extendStencil(
65  const ChemCompt* other, const vector< VoxelJunction >& vj );
66 
67  virtual vector< unsigned int > getParentVoxel() const = 0;
68  virtual const vector< double >& getVoxelArea() const = 0;
69  virtual const vector< double >& getVoxelLength() const = 0;
70 
71  private:
72 
75 
78 
85  vector< double > extendedMeshEntryVolume_;
86 };
87 
88 // Helper class for setting up and sorting rows of matrix entries.
89 class Ecol {
90  public:
91  Ecol( double e, unsigned int col )
92  : e_( e ), col_( col )
93  {;}
94 
95  Ecol()
96  : e_( 0 ), col_( 0 )
97  {;}
98 
99  bool operator<( const Ecol& other ) const
100  {
101  return col_ < other.col_;
102  }
103 
104  double e_;
105  double col_;
106 };
107 
108 #endif // _MESH_COMPT_H
bool operator<(const Ecol &other) const
Definition: MeshCompt.h:99
unsigned int getStencilRow(unsigned int meshIndex, const double **entry, const unsigned int **colIndex) const
Definition: MeshCompt.cpp:54
void innerResetStencil()
virtual func implemented here.
Definition: MeshCompt.cpp:49
vector< unsigned int > getNeighbors(unsigned int fid) const
Looks up stencil to return vector of indices of coupled voxels.
Definition: MeshCompt.cpp:69
SparseMatrix< double > m_
Handles stencil for core + abutting voxels.
Definition: MeshCompt.h:77
vector< double > extendedMeshEntryVolume_
Definition: MeshCompt.h:85
void addRow(unsigned int index, const vector< double > &entry, const vector< unsigned int > &colIndex)
Definition: MeshCompt.cpp:98
double extendedMeshEntryVolume(unsigned int fid) const
Virtual function to return volume of mesh Entry, including.
Definition: MeshCompt.cpp:36
virtual vector< unsigned int > getParentVoxel() const =0
Ecol()
Definition: MeshCompt.h:95
vector< double > innerGetStencilRate(unsigned int row) const
Definition: MeshCompt.cpp:85
void clearExtendedMeshEntryVolume()
Inherited virtual function to clear the vector of MeshEntryVolume.
Definition: MeshCompt.cpp:43
double col_
Definition: MeshCompt.h:105
double e_
Definition: MeshCompt.h:104
Ecol(double e, unsigned int col)
Definition: MeshCompt.h:91
virtual const vector< double > & getVoxelArea() const =0
void extendStencil(const ChemCompt *other, const vector< VoxelJunction > &vj)
Add boundary voxels to stencil for cross-solver junctions.
Definition: MeshCompt.cpp:121
virtual const vector< double > & getVoxelLength() const =0
void setStencilSize(unsigned int numRows, unsigned int numCols)
Definition: MeshCompt.cpp:106
const SparseMatrix< double > & getStencil() const
Returns entire sparse matrix of mesh. Used by diffusion solver.
Definition: MeshCompt.cpp:60
SparseMatrix< double > coreStencil_
Handles the core stencil for own vol.
Definition: MeshCompt.h:74
Definition: MeshCompt.h:89