DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Tri.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 Triangle
10 // ===================================================================
11 // Reference triangle: vertices at (0,0), (1,0), (0,1)
12 // Area = 1/2
13 //
14 // Data format: [3][n] array where:
15 // [0][i] = xi coordinate (barycentric coord for vertex 1)
16 // [1][i] = eta coordinate (barycentric coord for vertex 2)
17 // [2][i] = quadrature weight (wi)
18 //
19 // Note: The third barycentric coordinate is 1 - xi - eta
20 // ===================================================================
21
22 /// Hammer rule with 1 point: degree 1 exact
23 /// Point: centroid (1/3, 1/3), Weight: 1/2 (total area)
24 namespace detail
25 {
26 static constexpr std::array<std::array<t_real, 1>, 3> HammerTri_1{{{{1. / 3.}},
27 {{1. / 3.}},
28 {{1. / 2.}}}};
29
30 /// Hammer rule with 3 points: degree 2 exact
31 /// Points: (2/3, 1/6), (1/6, 2/3), (1/6, 1/6)
32 /// Weights: 1/6 each (sum = 1/2)
33 static constexpr std::array<std::array<t_real, 3>, 3> HammerTri_3{{{{2. / 3., 1. / 6., 1. / 6.}},
34 {{1. / 6., 2. / 3., 1. / 6.}},
35 {{1. / 6., 1. / 6., 1. / 6.}}}};
36
37 /// Hammer rule with 6 points: degree 4 exact
38 /// Points include permutations of (a, a), (b, b), (c, d)
39 static constexpr std::array<std::array<t_real, 6>, 3> HammerTri_6{{{{0.09157621350977102, 0.8168475729804585, 0.09157621350977052,
40 0.445948490915965, 0.10810301816807, 0.445948490915965}},
41 {{0.09157621350977102, 0.09157621350977052, 0.8168475729804585,
42 0.445948490915965, 0.445948490915965, 0.10810301816807}},
43 {{0.054975871827661, 0.054975871827661, 0.054975871827661,
44 0.1116907948390057, 0.1116907948390057, 0.1116907948390057}}}};
45
46 /// Hammer rule with 7 points: degree 5 exact
47 /// Includes centroid + 6 points in 3 pairs
48 static constexpr std::array<std::array<t_real, 7>, 3> HammerTri_7{{{{0.3333333333333335, 0.470142064105115, 0.05971587178977, 0.470142064105115,
49 0.1012865073234565, 0.7974269853530875, 0.1012865073234565}},
50 {{0.3333333333333335, 0.470142064105115, 0.470142064105115, 0.05971587178977,
51 0.1012865073234565, 0.1012865073234565, 0.7974269853530875}},
52 {{0.1125, 0.066197076394253, 0.066197076394253, 0.066197076394253,
53 0.0629695902724135, 0.0629695902724135, 0.0629695902724135}}}};
54
55 /// Hammer rule with 12 points: degree 6 exact
56 static constexpr std::array<std::array<t_real, 12>, 3> HammerTri_12{{{{0.2492867451709105, 0.501426509658179, 0.2492867451709105,
57 0.063089014491502, 0.8738219710169954, 0.063089014491502,
58 0.3103524510337845, 0.05314504984481699, 0.6365024991213986,
59 0.05314504984481699, 0.6365024991213986, 0.3103524510337845}},
60 {{0.2492867451709105, 0.2492867451709105, 0.501426509658179,
61 0.063089014491502, 0.063089014491502, 0.8738219710169954,
62 0.05314504984481699, 0.3103524510337845, 0.05314504984481699,
63 0.6365024991213986, 0.3103524510337845, 0.6365024991213986}},
64 {{0.05839313786318975, 0.05839313786318975, 0.05839313786318975,
65 0.0254224531851035, 0.0254224531851035, 0.0254224531851035,
66 0.04142553780918675, 0.04142553780918675, 0.04142553780918675,
67 0.04142553780918675, 0.04142553780918675, 0.04142553780918675}}}};
68
69 } // namespace detail
70} // namespace DNDS::Geom::Elem