OGS
ElementTraitsLagrange.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#include "
BaseLib/TMP.h
"
14
#include "
MeshLib/Elements/Elements.h
"
15
#include "
NumLib/Fem/FiniteElement/LowerDimShapeTable.h
"
16
#include "
NumLib/Fem/ShapeFunction/ShapeHex20.h
"
17
#include "
NumLib/Fem/ShapeFunction/ShapeHex8.h
"
18
#include "
NumLib/Fem/ShapeFunction/ShapeLine2.h
"
19
#include "
NumLib/Fem/ShapeFunction/ShapeLine3.h
"
20
#include "
NumLib/Fem/ShapeFunction/ShapePoint1.h
"
21
#include "
NumLib/Fem/ShapeFunction/ShapePrism15.h
"
22
#include "
NumLib/Fem/ShapeFunction/ShapePrism6.h
"
23
#include "
NumLib/Fem/ShapeFunction/ShapePyra13.h
"
24
#include "
NumLib/Fem/ShapeFunction/ShapePyra5.h
"
25
#include "
NumLib/Fem/ShapeFunction/ShapeQuad4.h
"
26
#include "
NumLib/Fem/ShapeFunction/ShapeQuad8.h
"
27
#include "
NumLib/Fem/ShapeFunction/ShapeQuad9.h
"
28
#include "
NumLib/Fem/ShapeFunction/ShapeTet10.h
"
29
#include "
NumLib/Fem/ShapeFunction/ShapeTet4.h
"
30
#include "
NumLib/Fem/ShapeFunction/ShapeTri3.h
"
31
#include "
NumLib/Fem/ShapeFunction/ShapeTri6.h
"
32
33
namespace
NumLib
34
{
35
namespace
detail
36
{
37
template
<
typename
ShapeFunction,
typename
Enabled =
void
>
38
struct
LowerOrderShapeFunctionOrSame
39
{
40
static_assert
(ShapeFunction::ORDER < 2,
41
"Only shape functions of order 1 should use this fallback. "
42
"Order 0 is a special case for 0D elements."
);
43
using
type
= ShapeFunction;
44
};
45
46
template
<
typename
ShapeFunction>
47
struct
LowerOrderShapeFunctionOrSame
<
48
ShapeFunction,
49
std::void_t<typename NumLib::LowerDim<ShapeFunction>::type>>
50
{
51
using
type
=
typename
NumLib::LowerDim<ShapeFunction>::type
;
52
};
53
54
template
<
typename
ShapeFunction_>
55
struct
ShapeFunctionTraits
56
{
57
using
ShapeFunction
= ShapeFunction_;
58
using
LowerOrderShapeFunction
=
59
typename
LowerOrderShapeFunctionOrSame<ShapeFunction>::type
;
60
};
61
}
// namespace detail
62
63
template
<
typename
Element>
64
struct
ElementTraitsLagrange
;
65
66
#define OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE(ELEMENT, SHAPE_FUNCTION) \
67
template <> \
68
struct ElementTraitsLagrange<MeshLib::ELEMENT> \
69
: detail::ShapeFunctionTraits<NumLib::SHAPE_FUNCTION> \
70
{ \
71
using Element = MeshLib::ELEMENT; \
72
static_assert( \
73
std::is_same_v<Element, typename ShapeFunction::MeshElement>); \
74
}
75
76
// points and lines
77
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Point,
ShapePoint1
);
78
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(
Line
,
ShapeLine2
);
79
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Line3,
ShapeLine3
);
80
// quads and hexahedra
81
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Quad,
ShapeQuad4
);
82
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Quad8,
ShapeQuad8
);
83
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Quad9,
ShapeQuad9
);
84
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Hex,
ShapeHex8
);
85
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Hex20,
ShapeHex20
);
86
// simplices
87
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Tri,
ShapeTri3
);
88
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Tri6,
ShapeTri6
);
89
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Tet,
ShapeTet4
);
90
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Tet10,
ShapeTet10
);
91
// prisms
92
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Prism,
ShapePrism6
);
93
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Prism15,
ShapePrism15
);
94
// pyramids
95
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Pyramid,
ShapePyra5
);
96
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
(Pyramid13,
ShapePyra13
);
97
98
#undef OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
99
100
using
AllElementTraitsLagrange
=
101
BaseLib::TMP::Map_t<ElementTraitsLagrange, MeshLib::AllElementTypes>
;
102
}
// namespace NumLib
OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE
#define OGS_SPECIALIZE_ELEMENT_TRAITS_LAGRANGE(ELEMENT, SHAPE_FUNCTION)
Definition
ElementTraitsLagrange.h:66
Elements.h
LowerDimShapeTable.h
ShapeHex20.h
ShapeHex8.h
ShapeLine2.h
ShapeLine3.h
ShapePoint1.h
ShapePrism15.h
ShapePrism6.h
ShapePyra13.h
ShapePyra5.h
ShapeQuad4.h
ShapeQuad8.h
ShapeQuad9.h
ShapeTet10.h
ShapeTet4.h
ShapeTri3.h
ShapeTri6.h
TMP.h
NumLib::ShapeHex20
Definition
ShapeHex20.h:22
NumLib::ShapeHex8
Definition
ShapeHex8.h:40
NumLib::ShapeLine2
Definition
ShapeLine2.h:26
NumLib::ShapeLine3
Definition
ShapeLine3.h:21
NumLib::ShapePoint1
Shape function for a point element in natural coordinates.
Definition
ShapePoint1.h:19
NumLib::ShapePrism15
Definition
ShapePrism15.h:22
NumLib::ShapePrism6
Definition
ShapePrism6.h:22
NumLib::ShapePyra13
Definition
ShapePyra13.h:22
NumLib::ShapePyra5
Definition
ShapePyra5.h:22
NumLib::ShapeQuad4
Definition
ShapeQuad4.h:34
NumLib::ShapeQuad8
Definition
ShapeQuad8.h:21
NumLib::ShapeQuad9
Definition
ShapeQuad9.h:21
NumLib::ShapeTet10
Definition
ShapeTet10.h:21
NumLib::ShapeTet4
Definition
ShapeTet4.h:21
NumLib::ShapeTri3
Definition
ShapeTri3.h:34
NumLib::ShapeTri6
Definition
ShapeTri6.h:22
BaseLib::TMP::Map_t
typename Map< MapFromTypeToType, List >::type Map_t
Definition
TMP.h:102
NumLib
Definition
ProjectData.h:46
NumLib::AllElementTraitsLagrange
BaseLib::TMP::Map_t< ElementTraitsLagrange, MeshLib::AllElementTypes > AllElementTraitsLagrange
Definition
ElementTraitsLagrange.h:100
detail
Definition
ElementCoordinatesMappingLocal.cpp:22
NumLib::ElementTraitsLagrange
Definition
ElementTraitsLagrange.h:64
NumLib::LowerDim
Definition
LowerDimShapeTable.h:32
NumLib::detail::Line
Definition
ComponentGlobalIndexDict.h:31
NumLib::detail::LowerOrderShapeFunctionOrSame< ShapeFunction, std::void_t< typename NumLib::LowerDim< ShapeFunction >::type > >::type
typename NumLib::LowerDim< ShapeFunction >::type type
Definition
ElementTraitsLagrange.h:51
NumLib::detail::LowerOrderShapeFunctionOrSame
Definition
ElementTraitsLagrange.h:39
NumLib::detail::LowerOrderShapeFunctionOrSame::type
ShapeFunction type
Definition
ElementTraitsLagrange.h:43
NumLib::detail::ShapeFunctionTraits
Definition
ElementTraitsLagrange.h:56
NumLib::detail::ShapeFunctionTraits::ShapeFunction
ShapeFunction_ ShapeFunction
Definition
ElementTraitsLagrange.h:57
NumLib::detail::ShapeFunctionTraits::LowerOrderShapeFunction
typename LowerOrderShapeFunctionOrSame< ShapeFunction >::type LowerOrderShapeFunction
Definition
ElementTraitsLagrange.h:58
NumLib
Fem
FiniteElement
ElementTraitsLagrange.h
Generated by
1.10.0