Chombo + EB + MF  3.2
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes | List of all members
PolyGeom Class Reference

#include <PolyGeom.H>

Public Member Functions

 PolyGeom ()
 
 ~PolyGeom ()
 

Static Public Member Functions

static void invertMatrix (Real a_AInverse[SpaceDim][SpaceDim], const Real a_A[SpaceDim][SpaceDim], bool a_test)
 
static void getMinor (Real a_Aminor[SpaceDim-1][SpaceDim-1], const Real a_A[SpaceDim][SpaceDim], int a_row, int acol)
 
static void getJacobianAndInverse (Real a_Jacobian[SpaceDim][SpaceDim], Real a_Jinverse[SpaceDim][SpaceDim], RealVect &a_normal, RealVect a_tangents[SpaceDim-1])
 
static void getTangentVectors (RealVect a_tangen[CH_SPACEDIM-1], const RealVect &a_normal)
 
static Real determinantSD (const Real a_A[SpaceDim][SpaceDim])
 
static Real determinantSDM1 (const Real a_A[SpaceDim-1][SpaceDim-1])
 
static void pointToLine (RealVect &a_closestPt, RealVect &a_normal, const RealVect &a_point, const RealVect &a_pointOnLine, const RealVect &a_direction)
 
static Real distancePointToPlane (const RealVect &a_point, const RealVect &a_normal, const RealVect &a_pointOnLine)
 return distance from point to a plane More...
 
static void setTolerance (const Real &a_tolerance)
 
static void setVectDx (const RealVect &a_vectDx)
 
static void setVolumeTolerance (const Real &a_tolerance)
 
static void setAreaTolerance (const Real &a_tolerance)
 
static void setLengthTolerance (const Real &a_tolerance)
 
static RealVect cross (const RealVect &a_xvec1, const RealVect &a_xvec0)
 
static Real dot (const RealVect &a_xvec1, const RealVect &a_xvec0)
 
static const RealgetTolerance ()
 
static const RealVectgetVectDx ()
 
static const RealgetVolumeTolerance ()
 
static const RealgetAreaTolerance ()
 
static const RealgetLengthTolerance ()
 
static RealVect normal (const VolIndex &a_vof, const EBISBox &a_ebisBox, const Real &a_bndryArea)
 
static Real bndryArea (const VolIndex &a_vof, const EBISBox &a_ebisBox)
 
static Real computeAlpha (const Real &a_volFrac, const RealVect &a_normal)
 
static Real computeVolume (const Real &a_alpha, const RealVect &a_normal)
 
static void computeNormalAndAlpha (Real &a_alpha, RealVect &a_normal, const int &a_upDir, const Tuple< RealVect, CH_SPACEDIM > &a_poly)
 
static Real matrixSolveComp (const Vector< Vector< Real > > &a_A, const Vector< Real > &a_rhs, const int &a_icomp)
 
static Real determinant (const Vector< Vector< Real > > &a_A)
 
static Real sAndZVolume (const Real &a_alpha, const RealVect &a_normal)
 
static void sortVector (RealVect &vect, IntVect &ivmap)
 
static void posifyVector (RealVect &vect, IntVect &signs)
 make vector all pos and return the signs More...
 
static void unifyVector (RealVect &normal, Real &sumSquare)
 make vector into a unit vector and return the sum of squares More...
 
static Tuple< int, CH_SPACEDIM-1 > computeTanDirs (int upDir)
 

Static Protected Member Functions

static Real twoDFunc (const Real &arg)
 
static Real threeDFunc (const Real &arg)
 
static Real computeAnyVolume (const Real &a_alpha, const Real &a_norm0, const Real &a_norm1, const Real &a_norm2)
 
static RealVect tetCentroid (const RealVect &normal, const Real &alpha)
 
static Real tetVolume (const RealVect &normal, const Real &alpha)
 

Static Protected Attributes

static RealVect s_vectDx
 
static Real s_tolerance
 
static Real s_lengthtolerance
 
static Real s_areatolerance
 

Detailed Description

PolyGeom encapsulates the functions to generate centroids, normals, etc given the geometric information. It is meant to be used simply as a static class. Its only data member (a static) is its tolerance.

Constructor & Destructor Documentation

◆ PolyGeom()

PolyGeom::PolyGeom ( )
inline

◆ ~PolyGeom()

PolyGeom::~PolyGeom ( )
inline

Member Function Documentation

◆ invertMatrix()

static void PolyGeom::invertMatrix ( Real  a_AInverse[SpaceDim][SpaceDim],
const Real  a_A[SpaceDim][SpaceDim],
bool  a_test 
)
static

return the inverse of the input matrix. done using cramers rule

Referenced by getJacobianAndInverse().

◆ getMinor()

static void PolyGeom::getMinor ( Real  a_Aminor[SpaceDim-1][SpaceDim-1],
const Real  a_A[SpaceDim][SpaceDim],
int  a_row,
int  acol 
)
static

calculate the cofactor of element (row,col) this is the matrix which excludes row and column row, col

◆ getJacobianAndInverse()

static void PolyGeom::getJacobianAndInverse ( Real  a_Jacobian[SpaceDim][SpaceDim],
Real  a_Jinverse[SpaceDim][SpaceDim],
RealVect a_normal,
RealVect  a_tangents[SpaceDim-1] 
)
inlinestatic

References invertMatrix(), and SpaceDim.

◆ getTangentVectors()

static void PolyGeom::getTangentVectors ( RealVect  a_tangen[CH_SPACEDIM-1],
const RealVect a_normal 
)
inlinestatic

◆ determinantSD()

static Real PolyGeom::determinantSD ( const Real  a_A[SpaceDim][SpaceDim])
static

Referenced by getTangentVectors().

◆ determinantSDM1()

static Real PolyGeom::determinantSDM1 ( const Real  a_A[SpaceDim-1][SpaceDim-1])
static

Referenced by getTangentVectors().

◆ pointToLine()

static void PolyGeom::pointToLine ( RealVect a_closestPt,
RealVect a_normal,
const RealVect a_point,
const RealVect a_pointOnLine,
const RealVect a_direction 
)
static

find equation of line between a line formed by a_pointOnLine = p0 and a_direction=v l(t) = p0 + v t and a point in space a_point. returns closest point on line and the normal between the closest point and the point in space

Referenced by getTangentVectors().

◆ distancePointToPlane()

static Real PolyGeom::distancePointToPlane ( const RealVect a_point,
const RealVect a_normal,
const RealVect a_pointOnLine 
)
static

return distance from point to a plane

Referenced by getTangentVectors().

◆ setTolerance()

static void PolyGeom::setTolerance ( const Real a_tolerance)
static

Referenced by getTangentVectors().

◆ setVectDx()

static void PolyGeom::setVectDx ( const RealVect a_vectDx)
static

Referenced by getTangentVectors().

◆ setVolumeTolerance()

static void PolyGeom::setVolumeTolerance ( const Real a_tolerance)
static

Referenced by getTangentVectors().

◆ setAreaTolerance()

static void PolyGeom::setAreaTolerance ( const Real a_tolerance)
static

Referenced by getTangentVectors().

◆ setLengthTolerance()

static void PolyGeom::setLengthTolerance ( const Real a_tolerance)
static

Referenced by getTangentVectors().

◆ cross()

static RealVect PolyGeom::cross ( const RealVect a_xvec1,
const RealVect a_xvec0 
)
static

compute the cross product between xvec0 and xvec1 (returns xvec1 x xvec0)

Referenced by getTangentVectors().

◆ dot()

static Real PolyGeom::dot ( const RealVect a_xvec1,
const RealVect a_xvec0 
)
static

compute the dot product between xvec0 and xvec1 (returns xvec1 dot xvec0)

Referenced by getTangentVectors().

◆ getTolerance()

static const Real& PolyGeom::getTolerance ( )
static

Referenced by getTangentVectors().

◆ getVectDx()

static const RealVect& PolyGeom::getVectDx ( )
static

Referenced by getTangentVectors().

◆ getVolumeTolerance()

static const Real& PolyGeom::getVolumeTolerance ( )
static

Referenced by getTangentVectors().

◆ getAreaTolerance()

static const Real& PolyGeom::getAreaTolerance ( )
static

Referenced by getTangentVectors().

◆ getLengthTolerance()

static const Real& PolyGeom::getLengthTolerance ( )
static

Referenced by getTangentVectors().

◆ normal()

static RealVect PolyGeom::normal ( const VolIndex a_vof,
const EBISBox a_ebisBox,
const Real a_bndryArea 
)
static

Return the normal to the boundary at the input VoF. If said normal is undefined, returns the zero vector.

Referenced by getTangentVectors().

◆ bndryArea()

static Real PolyGeom::bndryArea ( const VolIndex a_vof,
const EBISBox a_ebisBox 
)
static

Referenced by getTangentVectors().

◆ computeAlpha()

static Real PolyGeom::computeAlpha ( const Real a_volFrac,
const RealVect a_normal 
)
static

Return the inhomogeneous component of the plane eqution ni xi = alpha. Volume fraction must be positive and <= 1.0 and the normals can be in any order.

Referenced by getTangentVectors().

◆ computeVolume()

static Real PolyGeom::computeVolume ( const Real a_alpha,
const RealVect a_normal 
)
static

Compute the volume fraction in the cell given alpha and the normal.

Referenced by getTangentVectors().

◆ computeNormalAndAlpha()

static void PolyGeom::computeNormalAndAlpha ( Real a_alpha,
RealVect a_normal,
const int &  a_upDir,
const Tuple< RealVect, CH_SPACEDIM > &  a_poly 
)
static

Get the normal and alpha given the points in a polygon. Solves the linear system \ ni xi - alpha = 0\ ni*ni = 1\ for ni and alpha. Always returns nromal[updir] >= 0

Referenced by getTangentVectors().

◆ matrixSolveComp()

static Real PolyGeom::matrixSolveComp ( const Vector< Vector< Real > > &  a_A,
const Vector< Real > &  a_rhs,
const int &  a_icomp 
)
static

Referenced by getTangentVectors().

◆ determinant()

static Real PolyGeom::determinant ( const Vector< Vector< Real > > &  a_A)
static

Referenced by getTangentVectors().

◆ sAndZVolume()

static Real PolyGeom::sAndZVolume ( const Real a_alpha,
const RealVect a_normal 
)
static

andzvolume computes the volume under the curve (covered volume). Does so using Scardovelli and Zaleski's direct formulae. The normal has to be all positive numbers. The normals also must be ordered from lowest to highest.

Referenced by getTangentVectors().

◆ sortVector()

static void PolyGeom::sortVector ( RealVect vect,
IntVect ivmap 
)
static

Sort vector from low to high. All comps must be positive. Return reverse mapping

Referenced by ~PolyGeom().

◆ posifyVector()

static void PolyGeom::posifyVector ( RealVect vect,
IntVect signs 
)
static

make vector all pos and return the signs

Referenced by ~PolyGeom().

◆ unifyVector()

static void PolyGeom::unifyVector ( RealVect normal,
Real sumSquare 
)
static

make vector into a unit vector and return the sum of squares

Referenced by getTangentVectors(), and ~PolyGeom().

◆ computeTanDirs()

static Tuple<int, CH_SPACEDIM-1> PolyGeom::computeTanDirs ( int  upDir)
static

Referenced by ~PolyGeom().

◆ twoDFunc()

static Real PolyGeom::twoDFunc ( const Real arg)
staticprotected

Referenced by ~PolyGeom().

◆ threeDFunc()

static Real PolyGeom::threeDFunc ( const Real arg)
staticprotected

Referenced by ~PolyGeom().

◆ computeAnyVolume()

static Real PolyGeom::computeAnyVolume ( const Real a_alpha,
const Real a_norm0,
const Real a_norm1,
const Real a_norm2 
)
staticprotected

Referenced by ~PolyGeom().

◆ tetCentroid()

static RealVect PolyGeom::tetCentroid ( const RealVect normal,
const Real alpha 
)
staticprotected

◆ tetVolume()

static Real PolyGeom::tetVolume ( const RealVect normal,
const Real alpha 
)
staticprotected

Member Data Documentation

◆ s_vectDx

RealVect PolyGeom::s_vectDx
staticprotected

◆ s_tolerance

Real PolyGeom::s_tolerance
staticprotected

◆ s_lengthtolerance

Real PolyGeom::s_lengthtolerance
staticprotected

◆ s_areatolerance

Real PolyGeom::s_areatolerance
staticprotected

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