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