libMesh::ReferenceElem Namespace Reference

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

Functions

const Elemget (const ElemType type_in)
 

Detailed Description

Namespace providing access to reference geometric element types.

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

Author
Benjamin S. Kirk
Date
2013

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

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

Referenced by libMesh::Parallel::BuildStandardTypeVector< n_minus_i >::build(), libMesh::Parallel::FillDisplacementArray< n_minus_i >::fill(), and libMesh::Elem::reference_elem().

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