17 const Real & azi_1 = azi_pair.first;
18 const Real & azi_2 = azi_pair.second;
20 Point x0 = Point(0.0, 0.0, 0.0), x1 = Point(1.0, 0.0, 0.0),
21 x2 = Point(std::cos(azi_1 + azi_2), std::sin(azi_1 + azi_2), 0.0),
22 x3 = Point(0.5, 0.0, 0.0), x4 = Point(std::cos(azi_1), std::sin(azi_1), 0.0),
23 x5 = Point(std::cos(azi_1 + azi_2) / 2.0, std::sin(azi_1 + azi_2) / 2.0, 0.0);
28 Point a1 = 4 * x0 + 4 * x1 - 8 * x3, b1 = 4 * x0 - 4 * x3 + 4 * x4 - 4 * x5,
29 c1 = -3 * x0 - 1 * x1 + 4 * x3, b2 = 4 * x0 + 4 * x2 - 8 * x5,
30 c2 = -3 * x0 - 1 * x2 + 4 * x5;
33 const unsigned int N = 7;
36 const static Real w1 =
Real(31) / 480 +
Real(std::sqrt(15.0L) / 2400),
37 w2 =
Real(31) / 480 -
Real(std::sqrt(15.0L) / 2400),
38 q1 =
Real(2) / 7 +
Real(std::sqrt(15.0L) / 21),
39 q2 =
Real(2) / 7 -
Real(std::sqrt(15.0L) / 21);
41 const static Real xi[
N] = {
Real(1) / 3, q1, q1, 1 - 2 * q1, q2, q2, 1 - 2 * q2};
42 const static Real eta[
N] = {
Real(1) / 3, q1, 1 - 2 * q1, q1, q2, 1 - 2 * q2, q2};
43 const static Real wts[
N] = {
Real(9) / 80, w1, w1, w1, w2, w2, w2};
47 for (
unsigned int q = 0; q <
N; ++q)
48 vol += wts[q] *
cross_norm(xi[q] * a1 + eta[q] * b1 + c1, xi[q] * b1 + eta[q] * b2 + c2);
55 const bool full_circle,
56 const unsigned int order,
57 const bool is_first_value_vertex)
60 Real tmp_acc_azi = 0.0;
64 std::vector<Real> azi_interval_list;
65 for (
unsigned int i = 1; i < azimuthal_list.size(); i++)
66 azi_interval_list.push_back((azimuthal_list[i] - azimuthal_list[i - 1]) / 180.0 * M_PI);
68 azi_interval_list.push_back((azimuthal_list.front() + 360.0 - azimuthal_list.back()) / 180.0 *
75 tmp_acc += std::sin(azi_interval_list[i]);
76 tmp_acc_azi += azi_interval_list[i];
84 std::vector<std::pair<Real, Real>> azi_interval_list;
85 for (
unsigned int i = is_first_value_vertex ? 2 : 3; i < azimuthal_list.size(); i += 2)
86 azi_interval_list.push_back(
87 std::make_pair((azimuthal_list[i - 1] - azimuthal_list[i - 2]) / 180.0 * M_PI,
88 (azimuthal_list[i] - azimuthal_list[i - 1]) / 180.0 * M_PI));
92 if (is_first_value_vertex)
93 azi_interval_list.push_back(std::make_pair(
94 (azimuthal_list.back() - azimuthal_list[azimuthal_list.size() - 2]) / 180.0 * M_PI,
95 (azimuthal_list.front() + 360.0 - azimuthal_list.back()) / 180.0 * M_PI));
97 azi_interval_list.push_back(
98 std::make_pair((azimuthal_list.front() + 360.0 - azimuthal_list.back()) / 180.0 * M_PI,
99 (azimuthal_list[1] - azimuthal_list.front()) / 180.0 * M_PI));
102 for (
const auto i :
index_range(azi_interval_list))
105 tmp_acc_azi += azi_interval_list[i].first + azi_interval_list[i].second;
108 return std::sqrt(tmp_acc_azi / tmp_acc);
Real dummyTRI6VolCalculator(const std::pair< Real, Real > &azi_pair)
Based on a pair of azimuthal angles, calculates the volume of a TRI6 element with one vertex at the o...
T cross_norm(const TypeVector< T > &b, const TypeVector< T > &c)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real radiusCorrectionFactor(const std::vector< Real > &azimuthal_list, const bool full_circle=true, const unsigned int order=1, const bool is_first_value_vertex=true)
Makes radial correction to preserve ring area.
auto index_range(const T &sizable)