ug4
ug::ReferenceElement Class Reference

base class for reference elements More...

#include <reference_element.h>

+ Inheritance diagram for ug::ReferenceElement:

Public Member Functions

int dimension () const
 returns the dimension where reference element lives More...
 
int id (int dim_i, size_t i, int dim_j, size_t j) const
 id of object j in dimension dim_j of obj i in dimension dim_i More...
 
size_t num (int dim) const
 returns the number of geometric objects of dim More...
 
size_t num (int dim_i, size_t i, int dim_j) const
 returns the number of object of dim for a sub-geometric object More...
 
size_t num (ReferenceObjectID type) const
 number of reference elements this element contains More...
 
void print_info () const
 print informations about the reference element More...
 
 ReferenceElement ()
 Constructor filling the arrays. More...
 
ReferenceObjectID roid () const
 returns the reference object id More...
 
ReferenceObjectID roid (int dim_i, size_t i) const
 reference element type of obj nr i in dimension dim_i More...
 
number size () const
 returns the size (e.g. area or volume) of the reference element More...
 

Protected Types

enum  { POINT = 0 , EDGE = 1 , FACE = 2 , VOLUME = 3 }
 to make it more readable More...
 
enum  { MAXOBJECTS = 12 }
 maximum number of Objects in all dimensions More...
 
enum  { MAXDIM = 3 }
 maximum dimension More...
 

Protected Attributes

int m_dim
 dimension of the reference world More...
 
int m_id [MAXDIM+1][MAXOBJECTS][MAXDIM+1][MAXOBJECTS]
 indices of GeomObjects More...
 
number m_size
 size of reference element More...
 
size_t m_vNum [MAXDIM+1]
 number of Geometric Objects of a dimension More...
 
size_t m_vNumRefElem [NUM_REFERENCE_OBJECTS]
 number of reference elements More...
 
ReferenceObjectID m_vRefElemType [MAXDIM+1][MAXOBJECTS]
 type of reference elements More...
 
size_t m_vSubNum [MAXDIM+1][MAXOBJECTS][MAXDIM+1]
 number of Geometric Objects contained in a (Sub-)Geometric Object of the Element More...
 

Detailed Description

base class for reference elements

Reference element interface. A reference element describes in local coordinates the structure an element type. Physical elements of a grid are thought to be constructed by a mapping from a reference element into the real world space.

Each ReferenceElement may be constructed from other (lower dimensional) geometric objects, that are themselves a mapping from a (lower dimensional) reference element. (E.g. a triangle is constructed by three edges and three vertices) Thus, these relationships are also specified by the reference element and methods of this function provide the number of constructing sub-geometric objects and the relationship between those.

Note, that we use one base class in order to implement all reference elements providing enough space to store all data for each derivation. This enlarges the memory consumption slightly but allows fast and inlined code. Since usually only one reference element (singleton) per program is created memory consumption is not an issue.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected

to make it more readable

Enumerator
POINT 
EDGE 
FACE 
VOLUME 

◆ anonymous enum

anonymous enum
protected

maximum number of Objects in all dimensions

Enumerator
MAXOBJECTS 

◆ anonymous enum

anonymous enum
protected

maximum dimension

Enumerator
MAXDIM 

Constructor & Destructor Documentation

◆ ReferenceElement()

ug::ReferenceElement::ReferenceElement ( )

Member Function Documentation

◆ dimension()

int ug::ReferenceElement::dimension ( ) const
inline

◆ id()

int ug::ReferenceElement::id ( int  dim_i,
size_t  i,
int  dim_j,
size_t  j 
) const
inline

id of object j in dimension dim_j of obj i in dimension dim_i

A reference element is constructed by several geometric objects, that are mapped by a reference element by themselves. This method returns the id (w.r.t. this reference element) of a sub-geometric object that is part of a sub-geometric object of the reference element

Parameters
[in]dim_idimension of sub geometric object
[in]iid of sub geometric object
[in]dim_jdimension for obj contained in the sub-object
[in]jnumber of obj contained in the sub-object
Returns
id of the j'th object of the dimension dim_j that are contained in the i*th (sub-)geom object of dimension dim_i

References m_id.

Referenced by ug::SCVFofSCVRayIntersectionWrapper< 2, 2 >::apply(), ug::DimHFV1Geometry< TDim, TWorldDim >::compute_side_midpoints(), ug::ComputeGradientPiecewiseConstant(), ug::fv1_dim_traits_base< TDim, TWorldDim >::get_dim_scvf_from_to(), ug::SideAndElemErrEstData< TDomain >::get_elem_error_indicator(), ug::SideAndElemErrEstData< TDomain >::init_quadrature(), ug::IntegralNormalComponentOnManifoldGeneral(), print_info(), ug::fv1_traits_ReferencePyramid::scv_mid_id(), ug::fv1_traits_ReferencePyramid::scv_node_id(), ug::fv1_traits_ReferencePyramid::scvf_from_to(), ug::fv1_traits_ReferencePyramid::scvf_mid_id(), ug::DoFDistribution::sort_constrained_edges(), ug::DoFDistribution::sort_constrained_faces(), ug::SubLocalDoFSet< TDim >::SubLocalDoFSet(), ug::DimCRFVGeometry< TDim, TWorldDim >::update(), ug::DimFV1Geometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimFV1IBGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimFVGeometry< TWorldDim, TDim >::update_boundary_faces(), ug::DimFEGeometry< TWorldDim, TRefDim >::update_boundary_faces(), ug::DimCRFVGeometry< TDim, TWorldDim >::update_geometric_data(), ug::DimFVGeometry< TWorldDim, TDim >::update_local(), and ug::DimFV1IBGeometry< TDim, TWorldDim >::update_local_data().

◆ num() [1/3]

size_t ug::ReferenceElement::num ( int  dim) const
inline

returns the number of geometric objects of dim

A reference element is constructed by several geometric objects, that are mapped by a reference element by themselves. This method returns how many (sub-)geometric objects of a given dimension are contained in this reference element.

Parameters
[in]dimdimension
Returns
number of objects of the dimension contained in the ref elem

References dim, and m_vNum.

Referenced by ug::CommonLocalDoFSet::add(), ug::SCVFofSCVRayIntersectionWrapper< 2, 2 >::apply(), ug::DimHFV1Geometry< TDim, TWorldDim >::compute_side_midpoints(), ug::ComputeGradientPiecewiseConstant(), ug::LocalFiniteElementProvider::create_sub_dof_set(), ug::fv1_dim_traits_base< TDim, TWorldDim >::dim_get_num_SCV_and_SCVF(), ug::SideAndElemErrEstData< TDomain >::get_elem_error_indicator(), ug::SideAndElemErrEstData< TDomain >::init_quadrature(), ug::IntegralNormalComponentOnManifoldGeneral(), print_info(), ug::DimReferenceElement< d >::print_info(), ug::SetLagrangeFaceLocalDoFs(), ug::SetLagrangeVertexLocalDoFs(), ug::SubLocalDoFSet< TDim >::SubLocalDoFSet(), ug::DimFV1Geometry< TDim, TWorldDim >::update(), ug::DimFV1IBGeometry< TDim, TWorldDim >::update(), ug::DimCRFVGeometry< TDim, TWorldDim >::update(), ug::DimFV1Geometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimFV1IBGeometry< TDim, TWorldDim >::update_boundary_faces(), ug::DimFVGeometry< TWorldDim, TDim >::update_boundary_faces(), ug::DimFEGeometry< TWorldDim, TRefDim >::update_boundary_faces(), ug::DimCRFVGeometry< TDim, TWorldDim >::update_geometric_data(), ug::DimFV1Geometry< TDim, TWorldDim >::update_local(), ug::DimFVGeometry< TWorldDim, TDim >::update_local(), and ug::DimFV1IBGeometry< TDim, TWorldDim >::update_local_data().

◆ num() [2/3]

size_t ug::ReferenceElement::num ( int  dim_i,
size_t  i,
int  dim_j 
) const
inline

returns the number of object of dim for a sub-geometric object

A reference element is constructed by several geometric objects, that are mapped by a reference element by themselves. This method returns how many (sub-)geometric objects of a given dimension are contained in a (sub-)geometric object of this reference element.

Parameters
[in]dim_idimension of sub geometric object
[in]inumber of sub geometric object
[in]dim_jdimension for elems contained in the sub-object
Returns
number of objects of the dimension dim_j that are contained in the i*th (sub-)geom object of dimension dim_i

References m_vSubNum.

◆ num() [3/3]

size_t ug::ReferenceElement::num ( ReferenceObjectID  type) const
inline

number of reference elements this element contains

References m_vNumRefElem.

◆ print_info()

void ug::ReferenceElement::print_info ( ) const

print informations about the reference element

References dimension(), id(), num(), and size().

Referenced by ug::DimReferenceElement< d >::print_info().

◆ roid() [1/2]

◆ roid() [2/2]

ReferenceObjectID ug::ReferenceElement::roid ( int  dim_i,
size_t  i 
) const
inline

reference element type of obj nr i in dimension dim_i

References m_vRefElemType.

◆ size()

number ug::ReferenceElement::size ( ) const
inline

returns the size (e.g. area or volume) of the reference element

References m_size.

Referenced by print_info().

Member Data Documentation

◆ m_dim

◆ m_id

◆ m_size

◆ m_vNum

◆ m_vNumRefElem

◆ m_vRefElemType

◆ m_vSubNum


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