DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Tet.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include "QuadratureBase.hpp"
5
6namespace DNDS::Geom::Elem
7{
8 // ===================================================================
9 // Hammer Quadrature on Reference Tetrahedron
10 // ===================================================================
11 // Reference tetrahedron: vertices at (0,0,0), (1,0,0), (0,1,0), (0,0,1)
12 // Volume = 1/6
13 //
14 // Data format: [4][n] array where:
15 // [0][i] = xi coordinate
16 // [1][i] = eta coordinate
17 // [2][i] = zeta coordinate
18 // [3][i] = quadrature weight (wi)
19 //
20 // Note: The fourth barycentric coordinate is 1 - xi - eta - zeta
21 // ===================================================================
22
23 /// Hammer rule with 1 point: degree 1 exact
24 /// Point: centroid (1/4, 1/4, 1/4), Weight: 1/6 (total volume)
25 namespace detail
26 {
27 static constexpr std::array<std::array<t_real, 1>, 4> HammerTet_1{{{{0.25}},
28 {{0.25}},
29 {{0.25}},
30 {{0.1666666666666667}}}};
31
32 /// Hammer rule with 4 points: degree 2 exact
33 /// Points are permutations of (a, a, a) where a = (5 - √5)/20 ≈ 0.1381966
34 /// and the interior point (b, b, b) where b = (5 + 3√5)/20 ≈ 0.5854102
35 static constexpr std::array<std::array<t_real, 4>, 4> HammerTet_4{{{{0.1381966011250105, 0.1381966011250105, 0.5854101966249685, 0.1381966011250105}},
36 {{0.1381966011250105, 0.5854101966249684, 0.1381966011250105, 0.1381966011250105}},
37 {{0.5854101966249684, 0.1381966011250105, 0.1381966011250105, 0.1381966011250105}},
38 {{0.04166666666666666, 0.04166666666666666, 0.04166666666666666, 0.04166666666666666}}}};
39
40 /// Hammer rule with 8 points: degree 3 exact
41 static constexpr std::array<std::array<t_real, 8>, 4> HammerTet_8{{{{0.1069940147705369, 0.1069940147705369, 0.6790179556883893, 0.1069940147705369,
42 0.3280585716625127, 0.3280585716625127, 0.01582428501246191, 0.3280585716625127}},
43 {{0.1069940147705369, 0.6790179556883893, 0.1069940147705369, 0.1069940147705369,
44 0.3280585716625127, 0.01582428501246191, 0.3280585716625127, 0.3280585716625127}},
45 {{0.6790179556883893, 0.1069940147705369, 0.1069940147705369, 0.1069940147705369,
46 0.01582428501246191, 0.3280585716625127, 0.3280585716625127, 0.3280585716625127}},
47 {{0.01859314997209119, 0.01859314997209119, 0.01859314997209119, 0.01859314997209119,
48 0.02307351669457548, 0.02307351669457548, 0.02307351669457548, 0.02307351669457548}}}};
49
50 /// Hammer rule with 14 points: degree 5 exact
51 static constexpr std::array<std::array<t_real, 14>, 4> HammerTet_14{{{{0.09273525031089125, 0.09273525031089125, 0.7217942490673263, 0.09273525031089125,
52 0.3108859192633008, 0.3108859192633008, 0.06734224221009777, 0.3108859192633008,
53 0.04550370412564952, 0.4544962958743505, 0.04550370412564952, 0.04550370412564952,
54 0.4544962958743505, 0.4544962958743505}},
55 {{0.09273525031089125, 0.7217942490673263, 0.09273525031089125, 0.09273525031089125,
56 0.3108859192633008, 0.06734224221009777, 0.3108859192633008, 0.3108859192633008,
57 0.4544962958743505, 0.04550370412564952, 0.04550370412564952, 0.4544962958743505,
58 0.04550370412564952, 0.4544962958743505}},
59 {{0.7217942490673263, 0.09273525031089125, 0.09273525031089125, 0.09273525031089125,
60 0.06734224221009777, 0.3108859192633008, 0.3108859192633008, 0.3108859192633008,
61 0.4544962958743505, 0.4544962958743505, 0.4544962958743505, 0.04550370412564952,
62 0.04550370412564952, 0.04550370412564952}},
63 {{0.01224884051939367, 0.01224884051939367, 0.01224884051939367, 0.01224884051939367,
64 0.01878132095300264, 0.01878132095300264, 0.01878132095300264, 0.01878132095300264,
65 0.0070910034628469, 0.0070910034628469, 0.0070910034628469, 0.0070910034628469,
66 0.0070910034628469, 0.0070910034628469}}}};
67
68 /// Hammer rule with 24 points: degree 6 exact
69 static constexpr std::array<std::array<t_real, 24>, 4> HammerTet_24{{{{0.2146028712591523, 0.2146028712591523, 0.3561913862225431, 0.2146028712591523,
70 0.3223378901422754, 0.3223378901422754, 0.0329863295731736, 0.3223378901422754,
71 0.04067395853461131, 0.04067395853461131, 0.8779781243961661, 0.04067395853461131,
72 0.6030056647916491, 0.6030056647916491, 0.06366100187501755, 0.2696723314583158,
73 0.06366100187501755, 0.06366100187501755, 0.2696723314583158, 0.06366100187501755,
74 0.06366100187501755, 0.06366100187501755, 0.2696723314583158, 0.6030056647916491}},
75 {{0.2146028712591523, 0.3561913862225431, 0.2146028712591523, 0.2146028712591523,
76 0.3223378901422754, 0.0329863295731736, 0.3223378901422754, 0.3223378901422754,
77 0.04067395853461131, 0.8779781243961661, 0.04067395853461131, 0.04067395853461131,
78 0.06366100187501755, 0.06366100187501755, 0.06366100187501755, 0.6030056647916491,
79 0.2696723314583158, 0.6030056647916491, 0.06366100187501755, 0.2696723314583158,
80 0.06366100187501755, 0.6030056647916491, 0.06366100187501755, 0.2696723314583158}},
81 {{0.3561913862225431, 0.2146028712591523, 0.2146028712591523, 0.2146028712591523,
82 0.0329863295731736, 0.3223378901422754, 0.3223378901422754, 0.3223378901422754,
83 0.8779781243961661, 0.04067395853461131, 0.04067395853461131, 0.04067395853461131,
84 0.2696723314583158, 0.06366100187501755, 0.6030056647916491, 0.06366100187501755,
85 0.6030056647916491, 0.06366100187501755, 0.6030056647916491, 0.06366100187501755,
86 0.2696723314583158, 0.2696723314583158, 0.06366100187501755, 0.06366100187501755}},
87 {{0.006653791709694545, 0.006653791709694545, 0.006653791709694545, 0.006653791709694545,
88 0.009226196923942479, 0.009226196923942479, 0.009226196923942479, 0.009226196923942479,
89 0.001679535175886773, 0.001679535175886773, 0.001679535175886773, 0.001679535175886773,
90 0.008035714285714285, 0.008035714285714285, 0.008035714285714285, 0.008035714285714285,
91 0.008035714285714285, 0.008035714285714285, 0.008035714285714285, 0.008035714285714285,
92 0.008035714285714285, 0.008035714285714285, 0.008035714285714285, 0.008035714285714285}}}};
93
94 } // namespace detail
95} // namespace DNDS::Geom::Elem