DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Tri6.hpp
Go to the documentation of this file.
1#pragma once
2// Auto-generated by tools/gen_shape_functions -- DO NOT EDIT
3// Element: Tri6
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 const t_real _t0 = et + xi - 1;
28 const t_real _t1 = 2 * et;
29 const t_real _t2 = 2 * xi - 1;
30 const t_real _t3 = -_t0;
31 const t_real _t4 = 4 * xi;
32 v(0, 0) = _t0 * (_t1 + _t2);
33 v(0, 1) = _t2 * xi;
34 v(0, 2) = et * (_t1 - 1);
35 v(0, 3) = _t3 * _t4;
36 v(0, 4) = _t4 * et;
37 v(0, 5) = 4 * _t3 * et;
38 }
39
40 template <class TPoint, class TArray>
41 DNDS_DEVICE_CALLABLE static void Diff1(const TPoint &p, TArray &&v)
42 {
43 t_real xi = p[0];
44 t_real et = p[1];
45 const t_real _t0 = 4 * et;
46 const t_real _t1 = 4 * xi;
47 const t_real _t2 = _t0 + _t1 - 3;
48 v(0, 0) = _t2;
49 v(0, 1) = _t1 - 1;
50 v(0, 3) = -_t0 - 8 * xi + 4;
51 v(0, 4) = _t0;
52 v(0, 5) = -_t0;
53 v(1, 0) = _t2;
54 v(1, 2) = _t0 - 1;
55 v(1, 3) = -_t1;
56 v(1, 4) = _t1;
57 v(1, 5) = -_t1 - 8 * et + 4;
58 }
59
60 template <class TPoint, class TArray>
61 DNDS_DEVICE_CALLABLE static void Diff2(const TPoint &p, TArray &&v)
62 {
63 t_real xi = p[0];
64 t_real et = p[1];
65 v(0, 0) = 4;
66 v(0, 1) = 4;
67 v(0, 3) = -8;
68 v(1, 0) = 4;
69 v(1, 3) = -4;
70 v(1, 4) = 4;
71 v(1, 5) = -4;
72 v(2, 0) = 4;
73 v(2, 2) = 4;
74 v(2, 5) = -8;
75 }
76
77 template <class TPoint, class TArray>
78 DNDS_DEVICE_CALLABLE static void Diff3(const TPoint &p, TArray &&v)
79 {
80 t_real xi = p[0];
81 t_real et = p[1];
82 // all zero
83 }
84 };
85 // <GEN_SHAPE_FUNCS_END>
86
87 // <GEN_ELEM_TRAITS_BEGIN>
88
89 template <>
91 {
92 static constexpr ElemType elemType = Tri6;
93 static constexpr int dim = 2;
94 static constexpr int order = 2;
95 static constexpr int numVertices = 3;
96 static constexpr int numNodes = 6;
97 static constexpr int numFaces = 3;
98 static constexpr ParamSpace paramSpace = TriSpace;
99 static constexpr t_real paramSpaceVol = 0.5;
100 // 3 * NNodes is a compile-time constant; no overflow possible.
101 // NOLINTNEXTLINE(bugprone-implicit-widening-of-multiplication-result)
102 static constexpr std::array<t_real, 3 * 6> standardCoords = {
103 0, 0, 0, // Node 0: vertex
104 1, 0, 0, // Node 1: vertex
105 0, 1, 0, // Node 2: vertex
106 0.5, 0, 0, // Node 3
107 0.5, 0.5, 0, // Node 4
108 0, 0.5, 0}; // Node 5
109
110 static constexpr ElemType GetFaceType(t_index /*iFace*/) { return Line3; }
111
112 static constexpr std::array<std::array<t_index, 10>, 3> faceNodes = {{{0, 1, 3},
113 {1, 2, 4},
114 {2, 0, 5}}};
115
116 static constexpr ElemType elevatedType = UnknownElem;
117 static constexpr int numElevNodes = 0;
118
119 static constexpr int numBisect = 4;
120 static constexpr int numBisectVariants = 1;
121
122 static constexpr ElemType GetBisectElemType(t_index /*i*/) { return Tri3; }
123
124 static constexpr std::array<tBisectSub, 4> bisectElements = {{{0, 3, 5},
125 {3, 1, 4},
126 {5, 3, 4},
127 {5, 4, 2}}};
128
129 static constexpr int vtkCellType = 22;
130
131 static constexpr std::array<int, 6> vtkNodeOrder = {0, 1, 2, 3, 4, 5};
132 };
133 // <GEN_ELEM_TRAITS_END>
134
135} // 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 GetFaceType(t_index)
Definition Tri6.hpp:110
static constexpr ElemType GetBisectElemType(t_index)
Definition Tri6.hpp:122
static DNDS_DEVICE_CALLABLE void Diff2(const TPoint &p, TArray &&v)
Definition Tri6.hpp:61
static DNDS_DEVICE_CALLABLE void Diff0(const TPoint &p, TArray &&v)
Definition Tri6.hpp:23
static DNDS_DEVICE_CALLABLE void Diff1(const TPoint &p, TArray &&v)
Definition Tri6.hpp:41
static DNDS_DEVICE_CALLABLE void Diff3(const TPoint &p, TArray &&v)
Definition Tri6.hpp:78
Eigen::Matrix< real, 5, 1 > v
double order
Definition test_ODE.cpp:257
const tPoint const tPoint const tPoint & p