DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Tri3.hpp
Go to the documentation of this file.
1#pragma once
2// Auto-generated by tools/gen_shape_functions -- DO NOT EDIT
3// Element: Tri3
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 v(0, 0) = -et - xi + 1;
28 v(0, 1) = xi;
29 v(0, 2) = et;
30 }
31
32 template <class TPoint, class TArray>
33 DNDS_DEVICE_CALLABLE static void Diff1(const TPoint &p, TArray &&v)
34 {
35 t_real xi = p[0];
36 t_real et = p[1];
37 v(0, 0) = -1;
38 v(0, 1) = 1;
39 v(1, 0) = -1;
40 v(1, 2) = 1;
41 }
42
43 template <class TPoint, class TArray>
44 DNDS_DEVICE_CALLABLE static void Diff2(const TPoint &p, TArray &&v)
45 {
46 t_real xi = p[0];
47 t_real et = p[1];
48 // all zero
49 }
50
51 template <class TPoint, class TArray>
52 DNDS_DEVICE_CALLABLE static void Diff3(const TPoint &p, TArray &&v)
53 {
54 t_real xi = p[0];
55 t_real et = p[1];
56 // all zero
57 }
58 };
59 // <GEN_SHAPE_FUNCS_END>
60
61 // <GEN_ELEM_TRAITS_BEGIN>
62
63 template <>
65 {
66 static constexpr ElemType elemType = Tri3;
67 static constexpr int dim = 2;
68 static constexpr int order = 1;
69 static constexpr int numVertices = 3;
70 static constexpr int numNodes = 3;
71 static constexpr int numFaces = 3;
72 static constexpr ParamSpace paramSpace = TriSpace;
73 static constexpr t_real paramSpaceVol = 0.5;
74 // 3 * NNodes is a compile-time constant; no overflow possible.
75 // NOLINTNEXTLINE(bugprone-implicit-widening-of-multiplication-result)
76 static constexpr std::array<t_real, 3 * 3> standardCoords = {
77 0, 0, 0, // Node 0: vertex
78 1, 0, 0, // Node 1: vertex
79 0, 1, 0}; // Node 2: vertex
80
81 static constexpr ElemType GetFaceType(t_index /*iFace*/) { return Line2; }
82
83 static constexpr std::array<std::array<t_index, 10>, 3> faceNodes = {{{0, 1},
84 {1, 2},
85 {2, 0}}};
86
87 static constexpr ElemType elevatedType = Tri6;
88 static constexpr int numElevNodes = 3;
89
90 static constexpr std::array<tElevSpan, 3> elevSpans = {{{0, 1},
91 {1, 2},
92 {2, 0}}};
93
94 static constexpr std::array<ElemType, 3> elevNodeSpanTypes = {
95 Line2, Line2, Line2};
96
97 static constexpr int vtkCellType = 5;
98
99 static constexpr std::array<int, 3> vtkNodeOrder = {0, 1, 2};
100 };
101 // <GEN_ELEM_TRAITS_END>
102
103} // 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 Tri3.hpp:81
static DNDS_DEVICE_CALLABLE void Diff0(const TPoint &p, TArray &&v)
Definition Tri3.hpp:23
static DNDS_DEVICE_CALLABLE void Diff3(const TPoint &p, TArray &&v)
Definition Tri3.hpp:52
static DNDS_DEVICE_CALLABLE void Diff1(const TPoint &p, TArray &&v)
Definition Tri3.hpp:33
static DNDS_DEVICE_CALLABLE void Diff2(const TPoint &p, TArray &&v)
Definition Tri3.hpp:44
Eigen::Matrix< real, 5, 1 > v
double order
Definition test_ODE.cpp:257
const tPoint const tPoint const tPoint & p