Loading...
Searching...
No Matches
wedge/quadrature/quadrature.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "terra/dense/vec.hpp"
5
6/// @namespace terra::fe::wedge::quadrature
7/// @brief Quadrature rules for the reference wedge.
8///
9/// Taken from https://people.sc.fsu.edu/~jburkardt/datasets/quadrature_rules_wedge/quadrature_rules_wedge.html
10///
11/// Reference:
12/// \code
13/// Carlos Felippa,
14/// A compendium of FEM integration formulas for symbolic work,
15/// Engineering Computation,
16/// Volume 21, Number 8, 2004, pages 867-890.
17/// \endcode
18///
19/// Reference wedge:
20///
21/// \f[
22/// \begin{align}
23/// 0 \leq X \\
24/// 0 \leq Y \\
25/// X + Y \leq 1 \\
26/// -1 \leq Z \leq 1
27/// \end{align}
28/// \f]
29///
31
33
34template < std::floating_point T >
35KOKKOS_INLINE_FUNCTION constexpr void
37{
38 quad_points[0] = { 1.0 / 3.0, 1.0 / 3.0, 0.0 };
39}
40
41template < std::floating_point T >
42KOKKOS_INLINE_FUNCTION constexpr void
44{
45 quad_weights[0] = 1.0;
46}
47
49
50template < std::floating_point T >
51KOKKOS_INLINE_FUNCTION constexpr void
53{
54 quad_points[0] = { 1.0 / 3.0, 1.0 / 3.0, 1.0/Kokkos::sqrt(3) };
55 quad_points[1] = { 1.0 / 3.0, 1.0 / 3.0, -1.0/Kokkos::sqrt(3) };
56}
57
58template < std::floating_point T >
59KOKKOS_INLINE_FUNCTION constexpr void
61{
62 quad_weights[0] = 0.5;
63 quad_weights[1] = 0.5;
64}
65
67
68template < std::floating_point T >
69KOKKOS_INLINE_FUNCTION constexpr void
71{
72 quad_points[0] = { 0.6666666666666666, 0.1666666666666667, -0.5773502691896257 };
73 quad_points[1] = { 0.1666666666666667, 0.6666666666666666, -0.5773502691896257 };
74 quad_points[2] = { 0.1666666666666667, 0.1666666666666667, -0.5773502691896257 };
75 quad_points[3] = { 0.6666666666666666, 0.1666666666666667, 0.5773502691896257 };
76 quad_points[4] = { 0.1666666666666667, 0.6666666666666666, 0.5773502691896257 };
77 quad_points[5] = { 0.1666666666666667, 0.1666666666666667, 0.5773502691896257 };
78}
79
80template < std::floating_point T >
81KOKKOS_INLINE_FUNCTION constexpr void quad_felippa_3x2_quad_points_ptr( dense::Vec< T, 3 >* quad_points )
82{
83 quad_points[0] = { 0.6666666666666666, 0.1666666666666667, -0.5773502691896257 };
84 quad_points[1] = { 0.1666666666666667, 0.6666666666666666, -0.5773502691896257 };
85 quad_points[2] = { 0.1666666666666667, 0.1666666666666667, -0.5773502691896257 };
86 quad_points[3] = { 0.6666666666666666, 0.1666666666666667, 0.5773502691896257 };
87 quad_points[4] = { 0.1666666666666667, 0.6666666666666666, 0.5773502691896257 };
88 quad_points[5] = { 0.1666666666666667, 0.1666666666666667, 0.5773502691896257 };
89}
90
91template < std::floating_point T >
92KOKKOS_INLINE_FUNCTION constexpr void
94{
95 quad_weights[0] = 0.1666666666666667;
96 quad_weights[1] = 0.1666666666666667;
97 quad_weights[2] = 0.1666666666666667;
98 quad_weights[3] = 0.1666666666666667;
99 quad_weights[4] = 0.1666666666666667;
100 quad_weights[5] = 0.1666666666666667;
101}
102
103template < std::floating_point T >
104KOKKOS_INLINE_FUNCTION constexpr void quad_felippa_3x2_quad_weights_ptr( T* quad_weights )
105{
106 quad_weights[0] = 0.1666666666666667;
107 quad_weights[1] = 0.1666666666666667;
108 quad_weights[2] = 0.1666666666666667;
109 quad_weights[3] = 0.1666666666666667;
110 quad_weights[4] = 0.1666666666666667;
111 quad_weights[5] = 0.1666666666666667;
112}
113
114} // namespace terra::fe::wedge::quadrature
Quadrature rules for the reference wedge.
constexpr void quad_felippa_3x2_quad_weights(T(&quad_weights)[quad_felippa_3x2_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:93
constexpr int quad_felippa_3x2_num_quad_points
Definition wedge/quadrature/quadrature.hpp:66
constexpr int quad_felippa_1x2_num_quad_points
Definition wedge/quadrature/quadrature.hpp:48
constexpr void quad_felippa_3x2_quad_points_ptr(dense::Vec< T, 3 > *quad_points)
Definition wedge/quadrature/quadrature.hpp:81
constexpr void quad_felippa_3x2_quad_points(dense::Vec< T, 3 >(&quad_points)[quad_felippa_3x2_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:70
constexpr void quad_felippa_1x1_quad_points(dense::Vec< T, 3 >(&quad_points)[quad_felippa_1x1_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:36
constexpr void quad_felippa_1x2_quad_weights(T(&quad_weights)[quad_felippa_1x2_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:60
constexpr void quad_felippa_3x2_quad_weights_ptr(T *quad_weights)
Definition wedge/quadrature/quadrature.hpp:104
constexpr void quad_felippa_1x1_quad_weights(T(&quad_weights)[quad_felippa_1x1_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:43
constexpr int quad_felippa_1x1_num_quad_points
Definition wedge/quadrature/quadrature.hpp:32
constexpr void quad_felippa_1x2_quad_points(dense::Vec< T, 3 >(&quad_points)[quad_felippa_1x2_num_quad_points])
Definition wedge/quadrature/quadrature.hpp:52