DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
Line.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 // Gauss-Legendre Quadrature on [-1, 1]
10 // ===================================================================
11 // These are the standard Gauss-Legendre quadrature points and weights
12 // for integration over the interval [-1, 1].
13 //
14 // A rule with n points integrates polynomials up to degree 2n-1 exactly.
15 //
16 // Data format: [2][n] array where:
17 // [0][i] = quadrature point (xi)
18 // [1][i] = quadrature weight (wi)
19 // ===================================================================
20
21 /// Gauss-Legendre with 1 point: exact for degree 1
22 /// Point: 0, Weight: 2
23 namespace detail
24 {
25 static constexpr std::array<std::array<t_real, 1>, 2> GaussLegendre_1{{{{0}},
26 {{2}}}};
27
28 /// Gauss-Legendre with 2 points: exact for degree 3
29 /// Points: ±1/√3 ≈ ±0.577350269189626
30 /// Weights: 1, 1
31 static constexpr std::array<std::array<t_real, 2>, 2> GaussLegendre_2{{{{-0.577350269189626, 0.577350269189626}},
32 {{1, 1}}}};
33
34 /// Gauss-Legendre with 3 points: exact for degree 5
35 /// Points: 0, ±√(3/5) ≈ ±0.774596669241483
36 /// Weights: 8/9, 5/9, 5/9
37 static constexpr std::array<std::array<t_real, 3>, 2> GaussLegendre_3{{{{-0.774596669241483, 0, 0.774596669241483}},
38 {{0.555555555555555, 0.888888888888889, 0.555555555555555}}}};
39
40 /// Gauss-Legendre with 4 points: exact for degree 7
41 static constexpr std::array<std::array<t_real, 4>, 2> GaussLegendre_4{{{{-0.861136311594053, -0.339981043584856, 0.339981043584856, 0.861136311594053}},
42 {{0.347854845137454, 0.652145154862546, 0.652145154862546, 0.347854845137454}}}};
43
44 /// Gauss-Legendre with 5 points: exact for degree 9
45 static constexpr std::array<std::array<t_real, 5>, 2> GaussLegendre_5{{{{-0.906179845938664, -0.538469310105683, 0, 0.538469310105683, 0.906179845938664}},
46 {{0.236926885056189, 0.478628670499366, 0.568888888888889, 0.478628670499366, 0.236926885056189}}}};
47
48 } // namespace detail
49} // namespace DNDS::Geom::Elem