libMesh
Functions
libMesh::ReferenceElem Namespace Reference

This namespace implements singleton reference elements for each fundamental element type supported by libMesh. More...

Functions

const Elemget (const ElemType type_in)
 

Detailed Description

This namespace implements singleton reference elements for each fundamental element type supported by libMesh.

Author
Benjamin S. Kirk
Date
2013 Namespace providing access to reference geometric element types.

Function Documentation

◆ get()

const Elem & libMesh::ReferenceElem::get ( const ElemType  type_in)
Returns
A constant reference to the reference element of the user-requested type.

Definition at line 251 of file reference_elem.C.

References libMesh::Utility::enum_to_string(), libMesh::INVALID_ELEM, libMesh::QUAD4, libMesh::QUAD8, libMesh::QUAD9, libMesh::QUADSHELL4, libMesh::QUADSHELL8, libMesh::QUADSHELL9, libMesh::TRI3, and libMesh::TRISHELL3.

Referenced by main(), libMesh::Elem::reference_elem(), VolumeTest::testEdge4Invertible(), WhichNodeAmITest::testHexes(), WhichNodeAmITest::testPrisms(), VolumeTest::testPyramid5TrueCentroid(), WhichNodeAmITest::testPyramids(), VolumeTest::testQuad4TrueCentroid(), WhichNodeAmITest::testTets(), and VolumeTest::testTri3TrueCentroid().

252 {
253  ElemType base_type = type_in;
254 
255  // For shell elements, use non shell type as the base type
256  if (type_in == TRISHELL3)
257  base_type = TRI3;
258 
259  if (type_in == QUADSHELL4)
260  base_type = QUAD4;
261 
262  if (type_in == QUADSHELL8)
263  base_type = QUAD8;
264 
265  if (type_in == QUADSHELL9)
266  base_type = QUAD9;
267 
268  init_ref_elem_table();
269 
270  // Throw an error if the user asked for an ElemType that we don't
271  // have a reference element for.
272  libmesh_error_msg_if(ref_elem_map[base_type] == nullptr || type_in == INVALID_ELEM,
273  "No reference elem data available for ElemType " << type_in
274  << " = " << Utility::enum_to_string(type_in) << ".");
275 
276  return *ref_elem_map[base_type];
277 }
ElemType
Defines an enum for geometric element types.
std::string enum_to_string(const T e)