libMesh::ReferenceElem Namespace Reference

Namespace providing access to reference geoemtric element types. More...

Functions

const Elemget (const ElemType type_in)
 

Detailed Description

Namespace providing access to reference geoemtric element types.

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

Author
Benjamin S. Kirk
Date
2013

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::QUADSHELL4, libMesh::TRI3, and libMesh::TRISHELL3.

Referenced by libMesh::Elem::reference_elem().

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  init_ref_elem_table();
251 
252  // Throw an error if the user asked for an ElemType that we don't
253  // have a reference element for.
254  if (ref_elem_map[base_type] == libmesh_nullptr || type_in == INVALID_ELEM)
255  libmesh_error_msg("No reference elem data available for ElemType " << type_in << " = " << Utility::enum_to_string(type_in) << ".");
256 
257  return *ref_elem_map[base_type];
258 }
const class libmesh_nullptr_t libmesh_nullptr
std::string enum_to_string(const T e)