9#include <deal.II/base/config.h>
11#include <deal.II/base/ndarray.h>
12#include <deal.II/base/polynomial.h>
13#include <deal.II/base/utilities.h>
14#include <deal.II/matrix_free/tensor_product_point_kernels.h>
16#include <deal.II/matrix_free/shape_info.h>
30 template <
int dim,
typename Number,
typename Number2,
bool add>
34 const dealii::Point<dim, Number> &p)
36 static_assert(dim >= 0 && dim <= 3,
"Only dim=0,1,2,3 implemented");
43 }
else if (dim == 1) {
44 const auto x0 = Number(1.) - p[0], x1 = p[0];
47 values[0] += value * x0;
48 values[1] += value * x1;
50 values[0] = value * x0;
51 values[1] = value * x1;
53 }
else if (dim == 2) {
54 const auto x0 = Number(1.) - p[0], x1 = p[0], y0 = Number(1.) - p[1],
57 const auto test_value_y0 = value * y0;
58 const auto test_value_y1 = value * y1;
61 values[0] += x0 * test_value_y0;
62 values[1] += x1 * test_value_y0;
63 values[2] += x0 * test_value_y1;
64 values[3] += x1 * test_value_y1;
66 values[0] = x0 * test_value_y0;
67 values[1] = x1 * test_value_y0;
68 values[2] = x0 * test_value_y1;
69 values[3] = x1 * test_value_y1;
71 }
else if (dim == 3) {
72 const auto x0 = Number(1.) - p[0], x1 = p[0], y0 = Number(1.) - p[1],
73 y1 = p[1], z0 = Number(1.) - p[2], z1 = p[2];
75 const auto test_value_z0 = value * z0;
76 const auto test_value_z1 = value * z1;
78 const auto test_value_y00 = test_value_z0 * y0;
79 const auto test_value_y01 = test_value_z0 * y1;
80 const auto test_value_y10 = test_value_z1 * y0;
81 const auto test_value_y11 = test_value_z1 * y1;
84 values[0] += x0 * test_value_y00;
85 values[1] += x1 * test_value_y00;
86 values[2] += x0 * test_value_y01;
87 values[3] += x1 * test_value_y01;
88 values[4] += x0 * test_value_y10;
89 values[5] += x1 * test_value_y10;
90 values[6] += x0 * test_value_y11;
91 values[7] += x1 * test_value_y11;
93 values[0] = x0 * test_value_y00;
94 values[1] = x1 * test_value_y00;
95 values[2] = x0 * test_value_y01;
96 values[3] = x1 * test_value_y01;
97 values[4] = x0 * test_value_y10;
98 values[5] = x1 * test_value_y10;
99 values[6] = x0 * test_value_y11;
100 values[7] = x1 * test_value_y11;
105 template <
bool is_linear,
int dim,
typename Number,
typename Number2>
107 const dealii::ndarray<Number, 2, dim> *shapes,
108 const unsigned int n_shapes,
109 const Number2 &value,
111 const dealii::Point<dim, Number> &p,
116 integrate_add_tensor_product_value_linear<dim, Number, Number2, true>(
119 dealii::internal::integrate_add_tensor_product_value_shapes<dim,
123 shapes, n_shapes, value, values);
129 false>(value, values, p);
131 dealii::internal::integrate_add_tensor_product_value_shapes<dim,
135 shapes, n_shapes, value, values);
void integrate_add_tensor_product_value_linear(const Number2 &value, Number2 *values, const dealii::Point< dim, Number > &p)
void integrate_tensor_product_value(const dealii::ndarray< Number, 2, dim > *shapes, const unsigned int n_shapes, const Number2 &value, Number2 *values, const dealii::Point< dim, Number > &p, const bool do_add)
DEAL_II_ALWAYS_INLINE FT add(const FT &flux_left_ij, const FT &flux_right_ij)