Structure for defining a mapping between an element and a reference element. More...
#include <ptems/referencemapping.hpp>
Public Member Functions | |
constexpr | ReferenceMapping () |
Create an empty reference mapping. More... | |
constexpr ReferenceElement< DIM > | Reference () const |
Gets the type of all extrusions from the reference element. More... | |
template<std::size_t D> | |
constexpr ExtrudeType | Extrusion () const |
Gets the type of extrusion of the reference element in the \((D+1)\)th-dimension. More... | |
constexpr ExtrudeType | Extrusion (std::size_t dim) const |
Gets the type of extrusion of the reference element in the \((dim+1)\)th-dimension. More... | |
Vector< SpaceDIM > | LocalToGlobal (const Vector< DIM > &pt) const |
Maps a point in local coordinate space on the reference element to the global coordinate space. More... | |
template<std::size_t D = SpaceDIM, typename = std::enable_if_t<(D == SpaceDIM) && (D == DIM)>> | |
Vector< DIM > | GlobalToLocal (const Vector< D > &pt) const |
Maps a point in global coordinate space to a point in the local coordinate space on the reference element. More... | |
Matrix< SpaceDIM, DIM > | Jacobian (const Vector< DIM > &pt) const |
Gets the Jacobian matrix for the specified point. More... | |
std::array< Matrix< SpaceDIM >, DIM > | Hessian (const Vector< DIM > &pt) const |
Gets the Hessian matrix for each component of the mapping for the specified point. More... | |
constexpr std::size_t | VertexCount () const |
Gets the number of vertices in the reference element. More... | |
bool | IsAffine () const |
Gets if the mapping is GUARANTEED to be affine. More... | |
Static Public Member Functions | |
template<ExtrudeType... Types> | |
constexpr static ReferenceMapping | Create (const std::initializer_list< Vector< SpaceDIM >> &args) |
Creates mapping to the reference element defined by Types from the specified shape. More... | |
Static Public Attributes | |
static constexpr ReferenceElement< DIM > | ReferenceSimplex = CreateReferenceElement(ExtrudeType::Point) |
Simplex reference element of dimension DIM. More... | |
static constexpr ReferenceElement< DIM > | ReferenceHypercube = CreateReferenceElement(ExtrudeType::Hyperplane) |
Hypercube reference element of dimension DIM. More... | |
Structure for defining a mapping between an element and a reference element.
A 2D reference element can be constructed by considering the reference interval \([-1,1]\) in 1D and then "extruding" this between y=-1 and y=1 either as an interval at \(y=-1\) and \(y=1\) (the reference square \([-1,1]^2\)), or as an interval at \(y=-1\) and a point \((-1,1)\) at \(y=1\) (the reference triangle \((-1,-1)--(1,-1)--(-1,1)\)).
A 3D reference element can be constructed by extruding one of the two 2D reference elements at \(z=-1\) to either the same 2D reference element at \(z=1\), or to the point \((-1,-1,1)\):
This can be repeated for any dimension. In general, therefore, we call the extrusion of the DIM-1 reference element to a DIM-1 reference element an extrusion to a "hyperplane" (ExtrudeType::Hyperplane), and to a point as extrusion to a "point" (ExtrudeType::Point)
DIM | Dimension of the element being mapped |
SpaceDIM | The dimension of the space (DIM <= SpaceD) the element is within |
|
inlineconstexpr |
Create an empty reference mapping.
|
inlinestaticconstexpr |
Creates mapping to the reference element defined by Types from the specified shape.
Types | DIM-1 list of the extrusions for the \(N=2,3,...,DIM\) dimension to get the \(N\)-dimensional reference element from the \((N-1)\)-dimensional reference element, where the \(1\)-dimensional reference element is the interval \([-1,1]\). |
args | List of vertices of the element to map to the reference element. If the last extrusion in Types is ExtrudeType::Hyperplane, then the first half of vertices are the vertices on the \(\hat{x}_{DIM}=-1\) plane and the second half are the vertices on the \(\hat{x}_{DIM}=1\). If the last extrusion in Types is ExtrudeType::Point, then the last point is the single point on the \(\hat{x}_{DIM}=1\) plane and the rest are the vertices of the hyperplane on the \(\hat{x}_{DIM}=-1\) plane. (This is applied recursive for the \(N=DIM-1,...,1\) planes to each set of vertices defining a hyperplane) |
|
inlineconstexpr |
Gets the type of extrusion of the reference element in the \((D+1)\)th-dimension.
D | The dimension to get the extrusion for |
|
inlineconstexpr |
Gets the type of extrusion of the reference element in the \((dim+1)\)th-dimension.
std::out_of_range | If dim is not less than DIM |
dim | The dimension to get the extrusion for |
|
inline |
Maps a point in global coordinate space to a point in the local coordinate space on the reference element.
Only exists if SpaceDIM == DIM
pt | Point in global coordinate to map |
|
inline |
Gets the Hessian matrix for each component of the mapping for the specified point.
pt | Point in local coordinate space to get Hessian for |
|
inline |
Gets if the mapping is GUARANTEED to be affine.
\[ \textrm{IsAffine()} = \textrm{true} \quad \implies \quad \text{Mapping Affine} \]
but\[ \text{Mapping Affine} \quad \not\implies \quad \textrm{IsAffine()} = \textrm{true} \]
true
if and only if the mapping is for the reference simplex.
|
inline |
Gets the Jacobian matrix for the specified point.
pt | Point in local coordinate space to get Jacobian for |
|
inline |
Maps a point in local coordinate space on the reference element to the global coordinate space.
pt | Point in local coordinate space on the reference element to map |
|
inlineconstexpr |
Gets the type of all extrusions from the reference element.
|
inlineconstexpr |
Gets the number of vertices in the reference element.
|
staticconstexpr |
Hypercube reference element of dimension DIM.
|
staticconstexpr |
Simplex reference element of dimension DIM.