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

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 239 of file reference_elem.C.

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

Referenced by libMesh::Elem::reference_elem(), WhichNodeAmITest::testHexes(), WhichNodeAmITest::testPrisms(), WhichNodeAmITest::testPyramids(), and WhichNodeAmITest::testTets().

240 {
241  ElemType base_type = type_in;
242 
243  // For shell elements, use non shell type as the base type
244  if (type_in == TRISHELL3)
245  base_type = TRI3;
246 
247  if (type_in == QUADSHELL4)
248  base_type = QUAD4;
249 
250  if (type_in == QUADSHELL8)
251  base_type = QUAD8;
252 
253  init_ref_elem_table();
254 
255  // Throw an error if the user asked for an ElemType that we don't
256  // have a reference element for.
257  if (ref_elem_map[base_type] == libmesh_nullptr || type_in == INVALID_ELEM)
258  libmesh_error_msg("No reference elem data available for ElemType " << type_in << " = " << Utility::enum_to_string(type_in) << ".");
259 
260  return *ref_elem_map[base_type];
261 }
ElemType
Defines an enum for geometric element types.
const class libmesh_nullptr_t libmesh_nullptr
std::string enum_to_string(const T e)