MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CylBase.cpp File Reference
#include "header.h"
#include "SparseMatrix.h"
#include "Boundary.h"
#include "MeshEntry.h"
#include "VoxelJunction.h"
#include "ChemCompt.h"
#include "MeshCompt.h"
#include "CubeMesh.h"
#include "CylBase.h"
#include "../utility/Vec.h"
+ Include dependency graph for CylBase.cpp:

Go to the source code of this file.

Functions

static void fillPointsOnCircle (const Vec &u, const Vec &v, const Vec &q, double h, double r, vector< double > &area, const CubeMesh *other)
 
static void fillPointsOnDisc (const Vec &u, const Vec &v, const Vec &q, double h, double r, vector< double > &area, const CubeMesh *other)
 

Variables

const double PI
 

Function Documentation

static void fillPointsOnCircle ( const Vec u,
const Vec v,
const Vec q,
double  h,
double  r,
vector< double > &  area,
const CubeMesh other 
)
static

Definition at line 263 of file CylBase.cpp.

References Vec::a0(), Vec::a1(), Vec::a2(), CubeMesh::EMPTY, PI, and CubeMesh::spaceToIndex().

Referenced by CylBase::matchCubeMeshEntries().

268 {
269  // fine-tune the h spacing so it is integral around circle.
270  // This will cause small errors in area estimate but they will
271  // be anisotropic. The alternative will have large errors toward
272  // 360 degrees, but not elsewhere.
273  unsigned int numAngle = floor( 2.0 * PI * r / h + 0.5 );
274  assert( numAngle > 0 );
275  double dtheta = 2.0 * PI / numAngle;
276  double dArea = h * dtheta * r;
277  // March along points on surface of circle centred at q.
278  for ( unsigned int j = 0; j < numAngle; ++j ) {
279  double theta = j * dtheta;
280  double c = cos( theta );
281  double s = sin( theta );
282  double p0 = q.a0() + r * ( u.a0() * c + v.a0() * s );
283  double p1 = q.a1() + r * ( u.a1() * c + v.a1() * s );
284  double p2 = q.a2() + r * ( u.a2() * c + v.a2() * s );
285  unsigned int index = other->spaceToIndex( p0, p1, p2 );
286  if ( index != CubeMesh::EMPTY )
287  area[index] += dArea;
288  }
289 }
const double PI
Definition: consts.cpp:12
double a0() const
Definition: Vec.h:34
unsigned int spaceToIndex(double x, double y, double z) const
Converts the 3-D coords to an index. EMPTY if out of range.
Definition: CubeMesh.cpp:1171
double a2() const
Definition: Vec.h:40
static const unsigned int EMPTY
Definition: CubeMesh.h:285
double a1() const
Definition: Vec.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void fillPointsOnDisc ( const Vec u,
const Vec v,
const Vec q,
double  h,
double  r,
vector< double > &  area,
const CubeMesh other 
)
static

Definition at line 291 of file CylBase.cpp.

References Vec::a0(), Vec::a1(), Vec::a2(), CubeMesh::EMPTY, PI, and CubeMesh::spaceToIndex().

Referenced by CylBase::matchCubeMeshEntries().

296 {
297  unsigned int numRadial = floor( r / h + 0.5 );
298  double dRadial = r / numRadial;
299  for ( unsigned int i = 0; i < numRadial; ++i ) {
300  double a = ( i + 0.5 ) * dRadial;
301  unsigned int numAngle = floor( 2.0 * PI * a / h + 0.5 );
302  if ( i == 0 )
303  numAngle = 1;
304  double dtheta = 2.0 * PI / numAngle;
305  double dArea = dRadial * dtheta * a;
306  for ( unsigned int j = 0; j < numAngle; ++j ) {
307  double theta = j * dtheta;
308  double c = cos( theta );
309  double s = sin( theta );
310  double p0 = q.a0() + a * ( u.a0() * c + v.a0() * s );
311  double p1 = q.a1() + a * ( u.a1() * c + v.a1() * s );
312  double p2 = q.a2() + a * ( u.a2() * c + v.a2() * s );
313  unsigned int index = other->spaceToIndex( p0, p1, p2 );
314  if ( index != CubeMesh::EMPTY )
315  area[index] += dArea;
316  }
317  }
318 }
const double PI
Definition: consts.cpp:12
double a0() const
Definition: Vec.h:34
unsigned int spaceToIndex(double x, double y, double z) const
Converts the 3-D coords to an index. EMPTY if out of range.
Definition: CubeMesh.cpp:1171
double a2() const
Definition: Vec.h:40
static const unsigned int EMPTY
Definition: CubeMesh.h:285
double a1() const
Definition: Vec.h:37

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation