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