OGS
GaussLegendreTet.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "GaussLegendreTet.h"
5
6namespace MathLib
7{
8template <>
9const std::array<std::array<double, 3>, GaussLegendreTet<1>::NPoints>
10 GaussLegendreTet<1>::X = {{{{1. / 4., 1. / 4., 1. / 4.}}}};
11template <>
12double const GaussLegendreTet<1>::W[1] = {1. / 6.};
13
14const std::array<std::array<double, 3>, GaussLegendreTet<2>::NPoints>
15 GaussLegendreTet<2>::X = {{{{1. / 4., 1. / 4., 1. / 4.}},
16 {{1. / 6., 1. / 6., 1. / 6.}},
17 {{1. / 2., 1. / 6., 1. / 6.}},
18 {{1. / 6., 1. / 2., 1. / 6.}},
19 {{1. / 6., 1. / 6., 1. / 2.}}}};
20double const GaussLegendreTet<2>::W[5] = {-2. / 15., 0.075, 0.075, 0.075,
21 0.075};
22
23static std::array<std::array<double, 3>, GaussLegendreTet<3>::NPoints>
25{
26 // Cf. Gellert, M., Harbord, R., 1991. Moderate degree cubature formulas for
27 // 3-D tetrahedral finite-element approximations. Communications in Applied
28 // Numerical Methods 7, 487-495. doi:10.1002/cnm.1630070609
29 const double a = 0.0673422422100983;
30 const double b = 0.3108859192633005;
31 const double c = 0.7217942490673264;
32 const double d = 0.0927352503108912;
33 const double e = 0.4544962958743506;
34 const double f = 0.045503704125649;
35
36 return {{{{a, b, b}},
37 {{b, a, b}},
38 {{b, b, a}},
39 {{b, b, b}},
40 {{c, d, d}},
41 {{d, c, d}},
42 {{d, d, c}},
43 {{d, d, d}},
44 {{e, e, f}},
45 {{e, f, e}},
46 {{e, f, f}},
47 {{f, e, e}},
48 {{f, e, f}},
49 {{f, f, e}}}};
50}
51
52const std::array<std::array<double, 3>, GaussLegendreTet<3>::NPoints>
54
55static const double p = 0.1126879257180162 / 6.;
56static const double q = 0.0734930431163619 / 6.;
57static const double r = 0.0425460207770812 / 6.;
58
60 p, p, p, p, q, q, q, q, r, r, r, r, r, r};
61
62static std::array<std::array<double, 3>, GaussLegendreTet<4>::NPoints>
64{
65 // Cf. Gellert, M., Harbord, R., 1991. Moderate degree cubature formulas for
66 // 3-D tetrahedral finite-element approximations. Communications in Applied
67 // Numerical Methods 7, 487-495. doi:10.1002/cnm.1630070609
68 const double a = 0.3797582452067875;
69 const double b = 0.1202417547932126;
70
71 return {{{{0.0, 1. / 3, 1. / 3}},
72 {{1. / 3, 0.0, 1. / 3}},
73 {{1. / 3, 1. / 3, 0.0}},
74 {{1. / 3, 1. / 3, 1. / 3}},
75 {{8. / 11, 1. / 11, 1. / 11}},
76 {{1. / 11, 8. / 11, 1. / 11}},
77 {{1. / 11, 1. / 11, 8. / 11}},
78 {{1. / 11, 1. / 11, 1. / 11}},
79 {{0.0, 0.0, 0.5}},
80 {{0.0, 0.5, 0.0}},
81 {{0.0, 0.5, 0.5}},
82 {{0.5, 0.0, 0.0}},
83 {{0.5, 0.0, 0.5}},
84 {{0.5, 0.5, 0.0}},
85 {{a, a, b}},
86 {{a, b, a}},
87 {{a, b, b}},
88 {{b, a, a}},
89 {{b, a, b}},
90 {{b, b, a}}}};
91}
92const std::array<std::array<double, 3>, GaussLegendreTet<4>::NPoints>
94
95static const double s = 81. / 2240. / 6.;
96static const double t = 161051. / 2304960. / 6.;
97static const double u = 409. / 31395. / 6.;
98static const double v = 2679769. / 32305455. / 6.;
99
101 s, s, s, s, t, t, t, t, u, u, u, u, u, u, v, v, v, v, v, v};
102
103} // namespace MathLib
static std::array< std::array< double, 3 >, GaussLegendreTet< 3 >::NPoints > initGLTet3X()
static const double q
static std::array< std::array< double, 3 >, GaussLegendreTet< 4 >::NPoints > initGLTet4X()
static const double p
static const double u
static const double r
static const double s
static const double v
static const double t
static MATHLIB_EXPORT const unsigned NPoints
static MATHLIB_EXPORT const unsigned NPoints
static MATHLIB_EXPORT const unsigned NPoints
static MATHLIB_EXPORT const unsigned NPoints
static MATHLIB_EXPORT const double W[NPoints]
static MATHLIB_EXPORT const std::array< std::array< double, 3 >, NPoints > X