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