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