MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::Geometry Class Reference

#include <geom.hpp>

Classes

struct  Constants
 
struct  Constants< Geometry::CUBE >
 
struct  Constants< Geometry::POINT >
 
struct  Constants< Geometry::PRISM >
 
struct  Constants< Geometry::PYRAMID >
 
struct  Constants< Geometry::SEGMENT >
 
struct  Constants< Geometry::SQUARE >
 
struct  Constants< Geometry::TETRAHEDRON >
 
struct  Constants< Geometry::TRIANGLE >
 

Public Types

enum  Type {
  INVALID = -1 , POINT = 0 , SEGMENT , TRIANGLE ,
  SQUARE , TETRAHEDRON , CUBE , PRISM ,
  PYRAMID , NUM_GEOMETRIES
}
 

Public Member Functions

 Geometry ()
 
 ~Geometry ()
 
const IntegrationRuleGetVertices (int GeomType) const
 Return an IntegrationRule consisting of all vertices of the given Geometry::Type, GeomType.
 
const IntegrationPointGetCenter (int GeomType) const
 Return the center of the given Geometry::Type, GeomType.
 
const DenseMatrixGetGeomToPerfGeomJac (int GeomType) const
 
const DenseMatrixGetPerfGeomToGeomJac (int GeomType) const
 
void GetPerfPointMat (int GeomType, DenseMatrix &pm) const
 
void JacToPerfJac (int GeomType, const DenseMatrix &J, DenseMatrix &PJ) const
 
int NumBdr (int GeomType) const
 Return the number of boundary "faces" of a given Geometry::Type.
 

Static Public Member Functions

static void GetRandomPoint (int GeomType, IntegrationPoint &ip)
 Get a random point in the reference element specified by GeomType.
 
static bool CheckPoint (int GeomType, const IntegrationPoint &ip)
 Check if the given point is inside the given reference element.
 
static bool CheckPoint (int GeomType, const IntegrationPoint &ip, real_t eps)
 Check if the given point is inside the given reference element. Overload for fuzzy tolerance.
 
static bool ProjectPoint (int GeomType, const IntegrationPoint &beg, IntegrationPoint &end)
 Project a point end, onto the given Geometry::Type, GeomType.
 
static bool ProjectPoint (int GeomType, IntegrationPoint &ip)
 Project a point ip, onto the given Geometry::Type, GeomType.
 
static bool IsTensorProduct (Type geom)
 
static Type TensorProductGeometry (int dim)
 
static int GetInverseOrientation (Type geom_type, int orientation)
 Return the inverse of the given orientation for the specified geometry type.
 

Static Public Attributes

static const int NumGeom = NUM_GEOMETRIES
 
static const int MaxDim = 3
 
static const int NumBdrArray [NumGeom] = { 0, 2, 3, 4, 4, 6, 5, 5 }
 
static const char * Name [NumGeom]
 
static const real_t Volume [NumGeom]
 
static const int Dimension [NumGeom] = { 0, 1, 2, 2, 3, 3, 3, 3 }
 
static const int DimStart [MaxDim+2]
 
static const int NumVerts [NumGeom] = { 1, 2, 3, 4, 4, 8, 6, 5 }
 
static const int NumEdges [NumGeom] = { 0, 1, 3, 4, 6, 12, 9, 8 }
 
static const int NumFaces [NumGeom] = { 0, 0, 1, 1, 4, 6, 5, 5 }
 

Detailed Description

Types of domains for integration rules and reference finite elements: Geometry::POINT - a point Geometry::SEGMENT - the interval [0,1] Geometry::TRIANGLE - triangle with vertices (0,0), (1,0), (0,1) Geometry::SQUARE - the unit square (0,1)x(0,1) Geometry::TETRAHEDRON - w/ vert. (0,0,0),(1,0,0),(0,1,0),(0,0,1) Geometry::CUBE - the unit cube Geometry::PRISM - w/ vert. (0,0,0),(1,0,0),(0,1,0),(0,0,1),(1,0,1),(0,1,1) Geometry::PYRAMID - w/ vert. (0,0,0),(1,0,0),(1,1,0),(0,1,0),(0,0,1)

Definition at line 32 of file geom.hpp.

Member Enumeration Documentation

◆ Type

Enumerator
INVALID 
POINT 
SEGMENT 
TRIANGLE 
SQUARE 
TETRAHEDRON 
CUBE 
PRISM 
PYRAMID 
NUM_GEOMETRIES 

Definition at line 35 of file geom.hpp.

Constructor & Destructor Documentation

◆ Geometry()

mfem::Geometry::Geometry ( )

Definition at line 28 of file geom.cpp.

◆ ~Geometry()

mfem::Geometry::~Geometry ( )

Definition at line 283 of file geom.cpp.

Member Function Documentation

◆ CheckPoint() [1/2]

bool mfem::Geometry::CheckPoint ( int GeomType,
const IntegrationPoint & ip )
static

Check if the given point is inside the given reference element.

Definition at line 435 of file geom.cpp.

◆ CheckPoint() [2/2]

bool mfem::Geometry::CheckPoint ( int GeomType,
const IntegrationPoint & ip,
real_t eps )
static

Check if the given point is inside the given reference element. Overload for fuzzy tolerance.

Definition at line 476 of file geom.cpp.

◆ GetCenter()

const IntegrationPoint & mfem::Geometry::GetCenter ( int GeomType) const
inline

Return the center of the given Geometry::Type, GeomType.

Definition at line 71 of file geom.hpp.

◆ GetGeomToPerfGeomJac()

const DenseMatrix & mfem::Geometry::GetGeomToPerfGeomJac ( int GeomType) const
inline

Definition at line 98 of file geom.hpp.

◆ GetInverseOrientation()

int mfem::Geometry::GetInverseOrientation ( Type geom_type,
int orientation )
static

Return the inverse of the given orientation for the specified geometry type.

Definition at line 264 of file geom.cpp.

◆ GetPerfGeomToGeomJac()

const DenseMatrix * mfem::Geometry::GetPerfGeomToGeomJac ( int GeomType) const
inline

Definition at line 100 of file geom.hpp.

◆ GetPerfPointMat()

void mfem::Geometry::GetPerfPointMat ( int GeomType,
DenseMatrix & pm ) const

Definition at line 822 of file geom.cpp.

◆ GetRandomPoint()

void mfem::Geometry::GetRandomPoint ( int GeomType,
IntegrationPoint & ip )
static

Get a random point in the reference element specified by GeomType.

This method uses the function rand() for random number generation.

Definition at line 314 of file geom.cpp.

◆ GetVertices()

const IntegrationRule * mfem::Geometry::GetVertices ( int GeomType) const

Return an IntegrationRule consisting of all vertices of the given Geometry::Type, GeomType.

Definition at line 293 of file geom.cpp.

◆ IsTensorProduct()

static bool mfem::Geometry::IsTensorProduct ( Type geom)
inlinestatic

Returns true if the given geom is of tensor-product type (i.e. if geom is a segment, quadrilateral, or hexahedron), returns false otherwise.

Definition at line 108 of file geom.hpp.

◆ JacToPerfJac()

void mfem::Geometry::JacToPerfJac ( int GeomType,
const DenseMatrix & J,
DenseMatrix & PJ ) const

Definition at line 909 of file geom.cpp.

◆ NumBdr()

int mfem::Geometry::NumBdr ( int GeomType) const
inline

Return the number of boundary "faces" of a given Geometry::Type.

Definition at line 129 of file geom.hpp.

◆ ProjectPoint() [1/2]

bool mfem::Geometry::ProjectPoint ( int GeomType,
const IntegrationPoint & beg,
IntegrationPoint & end )
static

Project a point end, onto the given Geometry::Type, GeomType.

Check if the end point is inside the reference element, if not overwrite it with the point on the boundary that lies on the line segment between beg and end (beg must be inside the element). Return true if end is inside the element, and false otherwise.

Definition at line 616 of file geom.cpp.

◆ ProjectPoint() [2/2]

bool mfem::Geometry::ProjectPoint ( int GeomType,
IntegrationPoint & ip )
static

Project a point ip, onto the given Geometry::Type, GeomType.

If ip is outside the element, replace it with the point on the boundary that is closest to the original ip and return false; otherwise, return true without changing ip.

Definition at line 686 of file geom.cpp.

◆ TensorProductGeometry()

static Type mfem::Geometry::TensorProductGeometry ( int dim)
inlinestatic

Returns the Geometry::Type corresponding to a tensor-product of the given dimension.

Definition at line 113 of file geom.hpp.

Member Data Documentation

◆ Dimension

const int mfem::Geometry::Dimension = { 0, 1, 2, 2, 3, 3, 3, 3 }
static

Definition at line 47 of file geom.hpp.

◆ DimStart

const int mfem::Geometry::DimStart
static
Initial value:

Definition at line 48 of file geom.hpp.

◆ MaxDim

const int mfem::Geometry::MaxDim = 3
static

Definition at line 43 of file geom.hpp.

◆ Name

const char * mfem::Geometry::Name
static
Initial value:
=
{
"Point", "Segment", "Triangle", "Square", "Tetrahedron", "Cube", "Prism",
"Pyramid"
}

Definition at line 45 of file geom.hpp.

◆ NumBdrArray

const int mfem::Geometry::NumBdrArray = { 0, 2, 3, 4, 4, 6, 5, 5 }
static

Definition at line 44 of file geom.hpp.

◆ NumEdges

const int mfem::Geometry::NumEdges = { 0, 1, 3, 4, 6, 12, 9, 8 }
static

Definition at line 50 of file geom.hpp.

◆ NumFaces

const int mfem::Geometry::NumFaces = { 0, 0, 1, 1, 4, 6, 5, 5 }
static

Definition at line 51 of file geom.hpp.

◆ NumGeom

const int mfem::Geometry::NumGeom = NUM_GEOMETRIES
static

Definition at line 42 of file geom.hpp.

◆ NumVerts

const int mfem::Geometry::NumVerts = { 1, 2, 3, 4, 4, 8, 6, 5 }
static

Definition at line 49 of file geom.hpp.

◆ Volume

const real_t mfem::Geometry::Volume
static
Initial value:
=
{ 1.0, 1.0, 0.5, 1.0, 1./6, 1.0, 0.5, 1./3 }

Definition at line 46 of file geom.hpp.


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