Loading...
Searching...
No Matches
Reference Elements
dune-geometry
Collaboration diagram for Reference Elements:

## Classes

struct | Dune::Geo::ReferenceElements< ctype_, dim >
| Class providing access to the singletons of the reference elements. More...
class | Dune::Geo::ReferenceElement< Implementation >
| This class provides access to geometric and topological properties of a reference element. More...

## Functions

template<typename... T>
unspecified value type | Dune::referenceElement (T &&... t)
| Returns a reference element for the objects t....
template<typename T, int dim>
auto | Dune::referenceElement (const Dune::GeometryType &gt, Dune::Dim< dim >={})
| Returns a reference element of dimension dim for the given geometry type and coordinate field type.
template<typename T, int dim, std::enable_if_t< IsNumber< std::decay_t< T > >::value, int > = 0>
auto | Dune::referenceElement (const T &, const Dune::GeometryType &gt, Dune::Dim< dim >)
| Returns a reference element of dimension dim for the given geometry type and coordinate field type.

## Detailed Description

### Generic Geometries

# Introduction

In the following we will give a definition of reference elements and subelement numbering. This is used to define geometries by prescribing a set of points in the space .

The basic building block for these elements is given by a recursion formula which assigns to each set either a prism element or a pyramid element with and . The recursion starts with a single point .

For this leads to the following elements

- : is a line.
- : is a cube and is a simplex.
- : is a cube, is a simplex, is a pyramid, and is a prism.

In general if is a cube then is also a cube and if is a simplex then is also a simplex.

Based on the recursion formula we can also define a numbering of the subentities and also of the sub-subentities of or based on a numbering of . For the subentities of codimension we use the numbering

- : the first numbers are assigned to the entities parallel to the axis in the same order as the subentites of the same codimension in ; then to the subentities of codimension in the bottom followed by those in the top.
- : in this case we first number the subentities of codimension in the bottom, followed by each subentity based on a subentity of codimension in .

For the subentity of codimension in a codimension subentity we use the numbering induced by the numbering the reference element corresponding to .

Here is a graphical representation of the reference elements:

1. One-dimensional reference element. For d=1 the simplex and cube are identical
2. Two-dimensional reference simplex (a.k.a. triangle)
3. Three-dimensional reference simplex (a.k.a. tetrahedron)

   Face Numbering | Edge Numbering

4. Two-dimensional reference cube (a.k.a. quadrilateral)
5. Three-dimensional reference cube (a.k.a. hexahedron)

   Face Numbering | Edge Numbering

6. Prism reference element

   Face Numbering | Edge Numbering

7. Pyramid reference element

   Face Numbering | Edge Numbering

In addition to the numbering and the corner coordinates of a reference element we also define the barycenters , the volume and the normals to all codimension one subelements.

The recursion formula is also used to define mappings from reference elements to general polytop given by a set of coordinates for the corner points - together with the mapping , the transpose of the Jacobian is also defined where is the dimension of the reference element and the dimension of the coordinates. This suffices to define other necessary parts of a Dune geometry by LQ-decomposing : let be given with a lower diagonal matrix and a matrix which satisfies :

- Jacobian inverse transpose

- Integration element

- Volume

  (Here some assumptions on the degree of the integration element is used.)

The next sections describe the details of the construction.

# Reference Topology

We define the set of reference topologies by the following rules:

- contains an element that we call the point topology.
- For , contains an element that we call the prism over .
- For , contains an element that we call the pyramid over .

For each reference topology we define the following values:

- Dimension: The point topology has dimension zero and the dimension of a prism or a pyramid topology over has dimension .
- Size: For with we define the number through
  - .
  - If then and for we have .
  - If then and for we have .
- Subtopology: Given a reference topology of dimension and a codimension we now define the subtopology for :
  - and
  - For and we define using the abbreviations

  - For and we define using the abbreviations

Notice that the number of vertices (i.e., subtopologies of codimension ) of a topology does not uniquely identify the topology. To see this, consider the topologies and . For these topologies we have .

# Reference Domains

For each reference topology we associate the set of corners defined through

- :
- : for , with .
- : for and with

The convex hall of the set of points defines the reference domain for the reference topology ; it follows that

- ,
- ,
- .

# Reference Elements and Mappings

A pair of a topology and a map with is called an element.

The reference element is the pair .

For a given set of points we define a mapping through for all . This mapping can be expressed using the recursive definition of the reference topologies through:

- ,
- with and .
- with and .

# Numbering of Subelements

Given a reference topology , a codimension and a subtopology we define a subset of the corner set given by the subsequence of :

, , and for we define through the recursion

- :
  For we define with .
  For we define with .
  For we define with .
- :
  For we define with .
  For we define with .

Given these subsets we define subreference elements of given by the following mapping .

Furthermore we define a numbering of the subreference elements of each subreference element in . This is the number for , , and , for which

## Function Documentation

## referenceElement() [1/3]

template<typename T, int dim>

auto Dune::referenceElement | ( | const Dune::GeometryType & | gt,
|  | Dune::Dim< dim > | = {} )

Returns a reference element of dimension dim for the given geometry type and coordinate field type.

This function allows you to obtain a reference element for a given coordinate type, dimension and GeometryType:

auto gt = ...;
using Dune::referenceElement;
auto ref_el = referenceElement<ctype,dim>(gt);
auto ref_el = referenceElement<ctype>(gt,Dune::Dim<dim>());
Dune::referenceElement
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Dune::Dim
Static tag representing a dimension.
Definition dimension.hh:16

## referenceElement() [2/3]

template<typename T, int dim, std::enable_if_t< IsNumber< std::decay_t< T > >::value, int > = 0>

auto Dune::referenceElement | ( | const T & | ,
|  | const Dune::GeometryType & | gt,
|  | Dune::Dim< dim > | )

Returns a reference element of dimension dim for the given geometry type and coordinate field type.

This function allows you to obtain a reference element for a given coordinate type, dimension and GeometryType:

auto gt = ...;
using Dune::referenceElement;
auto ref_el = referenceElement(ctype(),gt,Dune::Dim<dim>());

## referenceElement() [3/3]

template<typename... T>

unspecified value type Dune::referenceElement | ( | T &&... | t | ) |

Returns a reference element for the objects t....

The freestanding function referenceElement is a generic entry point for getting reference elements for arbitrary objects that support the operation. As it relies on argument-dependent lookup, the function should be called without any qualifying namespace. Note, however, that the versions of referenceElement() for a dimension and GeometryType with explicit template arguments cannot be found by ADL, so you have to explicitly pull them in or qualify the call using Dune:::

{
// option 1: using
using Dune::referenceElement;
auto ref_el = referenceElement<double,dim>(geometry_type);
}
{
// option 2: explicitly put in Dune::
auto ref_el = Dune::referenceElement<double,dim>(geometry_type);
}
{
// option 3: use version without explicit template arguments
auto ref_el = referenceElement(double(),geometry_type,Dune::Dim<dim>());
}

The returned object is guaranteed to have value semantics, so you can copy it around and store it by value.

The grid geometries in dune-grid support this function, and thus most people will use this function as

for (const auto& cell : elements(grid_view))
{
auto geo = cell.geometry();
auto ref_el = referenceElement(geo);
// do some work...
}

This does of course also work for entities of other codimensions.