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

#include <Stencil.h>

+ Inheritance diagram for RectangleStencil:
+ Collaboration diagram for RectangleStencil:

Public Member Functions

void addFlux (unsigned int meshIndex, vector< double > &f, const vector< vector< double > > &S, const vector< double > &diffConst) const
 
 RectangleStencil (double dx, double dy, unsigned int nx)
 
 ~RectangleStencil ()
 
- Public Member Functions inherited from Stencil
 Stencil ()
 
virtual ~Stencil ()
 

Private Attributes

double dx_
 
double dy_
 
double invDxSq_
 
double invDySq_
 
unsigned int nx_
 

Detailed Description

Assumes a 2-D rectangular array, so the index offset for neighboring mesh points in x is 1, and in y is nx.

Definition at line 67 of file Stencil.h.

Constructor & Destructor Documentation

RectangleStencil::RectangleStencil ( double  dx,
double  dy,
unsigned int  nx 
)

Definition at line 141 of file Stencil.cpp.

References dx_, dy_, invDxSq_, and invDySq_.

142  : dx_( dx ), dy_( dy ), nx_( nx )
143 {
144  if ( dx <= 0 ) {
145  dx_ = 1;
146  invDxSq_ = 1;
147  } else {
148  invDxSq_ = 1.0 / ( dx * dx );
149  }
150 
151  if ( dy <= 0 ) {
152  dy_ = 1;
153  invDySq_ = 1;
154  } else {
155  invDySq_ = 1.0 / ( dy * dy );
156  }
157 }
double invDySq_
Definition: Stencil.h:79
double dx_
Definition: Stencil.h:76
unsigned int nx_
Definition: Stencil.h:80
double invDxSq_
Definition: Stencil.h:78
double dy_
Definition: Stencil.h:77
RectangleStencil::~RectangleStencil ( )

Definition at line 159 of file Stencil.cpp.

160 {;}

Member Function Documentation

void RectangleStencil::addFlux ( unsigned int  meshIndex,
vector< double > &  f,
const vector< vector< double > > &  S,
const vector< double > &  diffConst 
) const
virtual

computes the Flux f in the voxel on meshIndex. Takes the matrix of molNumber[meshIndex][pool] and the vector of diffusionConst[pool] as arguments.

Implements Stencil.

Definition at line 163 of file Stencil.cpp.

References invDxSq_, invDySq_, nx_, stencil1(), and stencilN().

166 {
167  assert( f.size() <= S[0].size() );
168  if ( S.size() < 2 * nx_ )
169  return;
170  assert( meshIndex < S.size() );
171  int index = meshIndex;
172  stencilN( f, index, nx_, 1, invDxSq_, S, diffConst ); // Diffusion in x
173  stencil1( f, index, nx_, invDySq_, S, diffConst ); // Diffusion in y
174 }
void stencil1(vector< double > &f, int index, unsigned int n, double invSq, const vector< vector< double > > &S, const vector< double > &diffConst)
Definition: Stencil.cpp:18
void stencilN(vector< double > &f, int index, unsigned int n, int offset, double invSq, const vector< vector< double > > &S, const vector< double > &diffConst)
Definition: Stencil.cpp:55
double invDySq_
Definition: Stencil.h:79
unsigned int nx_
Definition: Stencil.h:80
double invDxSq_
Definition: Stencil.h:78

+ Here is the call graph for this function:

Member Data Documentation

double RectangleStencil::dx_
private

Definition at line 76 of file Stencil.h.

Referenced by RectangleStencil().

double RectangleStencil::dy_
private

Definition at line 77 of file Stencil.h.

Referenced by RectangleStencil().

double RectangleStencil::invDxSq_
private

Definition at line 78 of file Stencil.h.

Referenced by addFlux(), and RectangleStencil().

double RectangleStencil::invDySq_
private

Definition at line 79 of file Stencil.h.

Referenced by addFlux(), and RectangleStencil().

unsigned int RectangleStencil::nx_
private

Definition at line 80 of file Stencil.h.

Referenced by addFlux().


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