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

Go to the source code of this file.

Functions

static double dotprd (double x0, double y0, double z0, double x1, double y1, double z1)
 
void fillPointsOnCircle (const Vec &u, const Vec &v, const Vec &q, double h, double r, vector< double > &area, const CubeMesh *other)
 

Variables

static const CinfocylMeshCinfo = CylMesh::initCinfo()
 

Function Documentation

static double dotprd ( double  x0,
double  y0,
double  z0,
double  x1,
double  y1,
double  z1 
)
static

Definition at line 1037 of file CylMesh.cpp.

Referenced by CylMesh::nearest().

1039 {
1040  return x0 * x1 + y0 * y1 + z0 * z1;
1041 }

+ Here is the caller graph for this function:

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

Definition at line 955 of file CylMesh.cpp.

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

Referenced by CylMesh::matchCubeMeshEntries().

960 {
961  // fine-tune the h spacing so it is integral around circle.
962  // This will cause small errors in area estimate but they will
963  // be anisotropic. The alternative will have large errors toward
964  // 360 degrees, but not elsewhere.
965  unsigned int numAngle = floor( 2.0 * PI * r / h + 0.5 );
966  assert( numAngle > 0 );
967  double dtheta = 2.0 * PI / numAngle;
968  double dArea = h * dtheta * r;
969  // March along points on surface of circle centred at q.
970  for ( unsigned int j = 0; j < numAngle; ++j ) {
971  double theta = j * dtheta;
972  double c = cos( theta );
973  double s = sin( theta );
974  double p0 = q.a0() + r * ( u.a0() * c + v.a0() * s );
975  double p1 = q.a1() + r * ( u.a1() * c + v.a1() * s );
976  double p2 = q.a2() + r * ( u.a2() * c + v.a2() * s );
977  unsigned int index = other->spaceToIndex( p0, p1, p2 );
978  if ( index != CubeMesh::EMPTY )
979  area[index] += dArea;
980  }
981 }
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
const double PI
Definition: consts.cpp:12
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

const Cinfo* cylMeshCinfo = CylMesh::initCinfo()
static

Definition at line 164 of file CylMesh.cpp.

Referenced by CylMesh::initCinfo().