DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Tet4.hpp
Go to the documentation of this file.
1#pragma once
2// Auto-generated by tools/gen_shape_functions -- DO NOT EDIT
3// Element: Tet4
4// Regenerate: /usr/bin/python3 -m tools.gen_shape_functions.generate
5
6#include "DNDS/Defines.hpp"
7#include "Geom/Geometric.hpp"
8#include "Geom/ElemEnum.hpp"
10
11namespace DNDS::Geom::Elem
12{
13
14 // Forward declaration (primary template is in ElementTraitsBase.hpp)
15 template <ElemType>
16 struct ShapeFuncImpl;
17
18 // <GEN_SHAPE_FUNCS_BEGIN>
19 template <>
21 {
22 template <class TPoint, class TArray>
23 DNDS_DEVICE_CALLABLE static void Diff0(const TPoint &p, TArray &&v)
24 {
25 t_real xi = p[0];
26 t_real et = p[1];
27 t_real zt = p[2];
28 v(0, 0) = -et - xi - zt + 1;
29 v(0, 1) = xi;
30 v(0, 2) = et;
31 v(0, 3) = zt;
32 }
33
34 template <class TPoint, class TArray>
35 DNDS_DEVICE_CALLABLE static void Diff1(const TPoint &p, TArray &&v)
36 {
37 t_real xi = p[0];
38 t_real et = p[1];
39 t_real zt = p[2];
40 v(0, 0) = -1;
41 v(0, 1) = 1;
42 v(1, 0) = -1;
43 v(1, 2) = 1;
44 v(2, 0) = -1;
45 v(2, 3) = 1;
46 }
47
48 template <class TPoint, class TArray>
49 DNDS_DEVICE_CALLABLE static void Diff2(const TPoint &p, TArray &&v)
50 {
51 t_real xi = p[0];
52 t_real et = p[1];
53 t_real zt = p[2];
54 // all zero
55 }
56
57 template <class TPoint, class TArray>
58 DNDS_DEVICE_CALLABLE static void Diff3(const TPoint &p, TArray &&v)
59 {
60 t_real xi = p[0];
61 t_real et = p[1];
62 t_real zt = p[2];
63 // all zero
64 }
65 };
66 // <GEN_SHAPE_FUNCS_END>
67
68 // <GEN_ELEM_TRAITS_BEGIN>
69
70 template <>
72 {
73 static constexpr ElemType elemType = Tet4;
74 static constexpr int dim = 3;
75 static constexpr int order = 1;
76 static constexpr int numVertices = 4;
77 static constexpr int numNodes = 4;
78 static constexpr int numFaces = 4;
79 static constexpr int numEdges = 6;
80 static constexpr ParamSpace paramSpace = TetSpace;
81 static constexpr t_real paramSpaceVol = 1.0 / 6.0;
82 // 3 * NNodes is a compile-time constant; no overflow possible.
83 // NOLINTNEXTLINE(bugprone-implicit-widening-of-multiplication-result)
84 static constexpr std::array<t_real, 3 * 4> standardCoords = {
85 0, 0, 0, // Node 0: vertex
86 1, 0, 0, // Node 1: vertex
87 0, 1, 0, // Node 2: vertex
88 0, 0, 1}; // Node 3: vertex
89
90 static constexpr ElemType GetFaceType(t_index /*iFace*/) { return Tri3; }
91
92 static constexpr std::array<std::array<t_index, 10>, 4> faceNodes = {{{0, 2, 1},
93 {0, 1, 3},
94 {1, 2, 3},
95 {2, 0, 3}}};
96
97 static constexpr ElemType GetEdgeType(t_index /*iEdge*/) { return Line2; }
98
99 static constexpr std::array<std::array<t_index, 3>, 6> edgeNodes = {{{0, 1},
100 {1, 2},
101 {2, 0},
102 {0, 3},
103 {1, 3},
104 {2, 3}}};
105
106 static constexpr ElemType elevatedType = Tet10;
107 static constexpr int numElevNodes = 6;
108
109 static constexpr std::array<tElevSpan, 6> elevSpans = {{{0, 1},
110 {1, 2},
111 {2, 0},
112 {0, 3},
113 {1, 3},
114 {2, 3}}};
115
116 static constexpr std::array<ElemType, 6> elevNodeSpanTypes = {
118
119 static constexpr int vtkCellType = 10;
120
121 static constexpr std::array<int, 4> vtkNodeOrder = {0, 1, 2, 3};
122 };
123 // <GEN_ELEM_TRAITS_END>
124
125} // namespace DNDS::Geom::Elem
Core type aliases, constants, and metaprogramming utilities for the DNDS framework.
#define DNDS_DEVICE_CALLABLE
Definition Defines.hpp:76
int32_t t_index
Definition Geometric.hpp:6
double t_real
Definition Geometric.hpp:8
static constexpr ElemType GetEdgeType(t_index)
Definition Tet4.hpp:97
static constexpr ElemType GetFaceType(t_index)
Definition Tet4.hpp:90
static DNDS_DEVICE_CALLABLE void Diff0(const TPoint &p, TArray &&v)
Definition Tet4.hpp:23
static DNDS_DEVICE_CALLABLE void Diff2(const TPoint &p, TArray &&v)
Definition Tet4.hpp:49
static DNDS_DEVICE_CALLABLE void Diff3(const TPoint &p, TArray &&v)
Definition Tet4.hpp:58
static DNDS_DEVICE_CALLABLE void Diff1(const TPoint &p, TArray &&v)
Definition Tet4.hpp:35
Eigen::Matrix< real, 5, 1 > v
double order
Definition test_ODE.cpp:257
const tPoint const tPoint const tPoint & p