16#ifndef dealii_matrix_free_evaluation_kernels_hanging_nodes_h
17#define dealii_matrix_free_evaluation_kernels_hanging_nodes_h
31# define DEAL_II_ALWAYS_INLINE_RELEASE
33# define DEAL_II_ALWAYS_INLINE_RELEASE DEAL_II_ALWAYS_INLINE
83 template <
int dim,
int fe_degree,
typename Number>
91 template <
int structdim,
unsigned int direction,
bool transpose>
94 const unsigned int outer_stride,
95 const unsigned int given_degree,
96 const Number mask_weight,
97 const Number mask_write,
101 static constexpr unsigned int max_n_points_1D = 40;
103 static_assert(structdim == 1 || structdim == 2,
104 "Only 1D and 2d interpolation implemented");
105 Number temp[fe_degree != -1 ? fe_degree + 1 : max_n_points_1D];
107 const unsigned int points =
108 (fe_degree != -1 ? fe_degree : given_degree) + 1;
114 const unsigned int end_of_outer_loop = structdim == 1 ? 2 : points - 1;
115 for (
unsigned int g = 1; g < end_of_outer_loop; ++g)
117 const unsigned int my_offset =
118 offset + (structdim > 1 ? g * outer_stride : 0);
121 for (
unsigned int k = 0; k < points; ++k)
122 temp[k] = values[my_offset + k * stride];
125 for (
unsigned int k = 0; k < points / 2; ++k)
127 const unsigned int kmirror = points - 1 - k;
128 Number sum0 = Number(), sum1 = Number(), sum2 = Number(),
130 for (
unsigned int h = 0; h < points; ++h)
132 const unsigned int hmirror = points - 1 - h;
136 const Number w0 = weights[(
transpose ? 1 : points) * kmirror +
138 const Number w1 = weights[(
transpose ? 1 : points) * k +
140 sum0 += temp[h] * w0;
141 sum1 += temp[h] * w1;
142 sum2 += temp[hmirror] * w1;
143 sum3 += temp[hmirror] * w0;
145 values[my_offset + k * stride] =
147 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
148 values[my_offset + kmirror * stride] =
151 (sum2 + mask_weight * (sum3 - sum2) - temp[kmirror]);
157 const unsigned int k = points / 2;
158 Number sum0 = temp[k] * weights[(
transpose ? 1 : points) * k +
161 for (
unsigned int h = 0; h < points / 2; ++h)
163 const unsigned int hmirror = points - 1 - h;
164 const Number w0 = weights[(
transpose ? 1 : points) * k +
166 const Number w1 = weights[(
transpose ? 1 : points) * k +
168 sum0 += temp[h] * w0;
169 sum0 += temp[hmirror] * w1;
170 sum1 += temp[h] * w1;
171 sum1 += temp[hmirror] * w0;
173 values[my_offset + k * stride] =
175 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
181 template <
bool transpose>
184 const unsigned int n_components,
187 Number::size()> &constraint_mask,
190 const unsigned int given_degree =
191 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
194 shape_info.
data.front().subface_interpolation_matrices[0].data();
196 const unsigned int points = given_degree + 1;
205 for (
unsigned int v = 0; v < Number::size(); ++v)
207 const auto kind = constraint_mask[v];
208 const bool subcell_x = (kind >> 0) & 1;
209 const bool subcell_y = (kind >> 1) & 1;
210 const bool face_x = (kind >> 3) & 1;
211 const bool face_y = (kind >> 4) & 1;
215 const unsigned int side = !subcell_y;
216 mask_write[0][side][v] = 1;
217 do_face[0][side] =
true;
218 mask_weights[0][v] = subcell_x;
223 const unsigned int side = !subcell_x;
224 mask_write[1][side][v] = 1;
225 do_face[1][side] =
true;
226 mask_weights[1][v] = subcell_y;
232 const std::array<unsigned int, 2> offsets = {
233 {0, (points - 1) * points}};
234 for (
unsigned int c = 0; c < n_components; ++c)
235 for (
unsigned int face = 0; face < 2; ++face)
236 if (do_face[0][face])
237 interpolate<1, 0, transpose>(offsets[face],
243 values + c * n_dofs);
248 const std::array<unsigned int, 2> offsets = {{0, points - 1}};
249 for (
unsigned int c = 0; c < n_components; ++c)
250 for (
unsigned int face = 0; face < 2; ++face)
251 if (do_face[1][face])
252 interpolate<1, 1, transpose>(offsets[face],
258 values + c * n_dofs);
263 const unsigned int p0 = 0;
264 const unsigned int p1 = points - 1;
265 const unsigned int p2 = points * points - points;
266 const unsigned int p3 = points * points - 1;
267 const unsigned int p4 = points * points * points - points * points;
268 const unsigned int p5 =
269 points * points * points - points * points + points - 1;
270 const unsigned int p6 = points * points * points - points;
278 for (
unsigned int v = 0; v < Number::size(); ++v)
280 const auto kind = constraint_mask[v];
282 const bool subcell_x = (kind >> 0) & 1;
283 const bool subcell_y = (kind >> 1) & 1;
284 const bool subcell_z = (kind >> 2) & 1;
285 const bool face_x = ((kind >> 3) & 1) ? (kind >> 5) & 1 : 0;
286 const bool face_y = ((kind >> 3) & 1) ? (kind >> 6) & 1 : 0;
287 const bool face_z = ((kind >> 3) & 1) ? (kind >> 7) & 1 : 0;
288 const bool edge_x = ((kind >> 4) & 1) ? (kind >> 5) & 1 : 0;
289 const bool edge_y = ((kind >> 4) & 1) ? (kind >> 6) & 1 : 0;
290 const bool edge_z = ((kind >> 4) & 1) ? (kind >> 7) & 1 : 0;
293 mask_weights[0][v] = 1;
295 mask_weights[1][v] = 1;
297 mask_weights[2][v] = 1;
301 const unsigned int side = !subcell_x;
303 mask_face[1][side][v] = process_face[1][side] =
true;
304 mask_edge[1][side][v] = process_edge[1][side] =
true;
305 mask_edge[1][2 + side][v] = process_edge[1][2 + side] =
true;
306 mask_face[2][side][v] = process_face[2][side] =
true;
307 mask_edge[2][side][v] = process_edge[2][side] =
true;
308 mask_edge[2][2 + side][v] = process_edge[2][2 + side] =
true;
312 const unsigned int side = !subcell_y;
314 mask_face[0][side][v] = process_face[0][side] =
true;
315 mask_edge[0][side][v] = process_edge[0][side] =
true;
316 mask_edge[0][2 + side][v] = process_edge[0][2 + side] =
true;
317 mask_face[2][2 + side][v] = process_face[2][2 + side] =
true;
318 mask_edge[2][2 * side][v] = process_edge[2][2 * side] =
true;
319 mask_edge[2][2 * side + 1][v] =
320 process_edge[2][2 * side + 1] =
true;
324 const unsigned int side = !subcell_z;
326 mask_face[0][2 + side][v] = process_face[0][2 + side] =
true;
327 mask_edge[0][2 * side][v] = process_edge[0][2 * side] =
true;
328 mask_edge[0][2 * side + 1][v] =
329 process_edge[0][2 * side + 1] =
true;
330 mask_face[1][2 + side][v] = process_face[1][2 + side] =
true;
331 mask_edge[1][2 * side][v] = process_edge[1][2 * side] =
true;
332 mask_edge[1][2 * side + 1][v] =
333 process_edge[1][2 * side + 1] =
true;
337 const unsigned int index = (!subcell_z) * 2 + (!subcell_y);
338 mask_edge[0][
index][v] = process_edge[0][
index] =
true;
342 const unsigned int index = (!subcell_z) * 2 + (!subcell_x);
343 mask_edge[1][
index][v] = process_edge[1][
index] =
true;
347 const unsigned int index = (!subcell_y) * 2 + (!subcell_x);
348 mask_edge[2][
index][v] = process_edge[2][
index] =
true;
353 if (given_degree > 1)
355 const std::array<unsigned int, 4> face_offsets = {
357 const std::array<unsigned int, 2> outer_strides = {
358 {points * points, points}};
359 for (
unsigned int c = 0; c < n_components; ++c)
360 for (
unsigned int face = 0; face < 4; ++face)
361 if (process_face[0][face])
362 interpolate<2, 0, transpose>(face_offsets[face],
363 outer_strides[face / 2],
368 values + c * n_dofs);
371 const std::array<unsigned int, 4> edge_offsets = {{p0, p2, p4, p6}};
372 for (
unsigned int c = 0; c < n_components; ++c)
373 for (
unsigned int edge = 0; edge < 4; ++edge)
374 if (process_edge[0][edge])
375 interpolate<1, 0, transpose>(edge_offsets[edge],
381 values + c * n_dofs);
385 if (given_degree > 1)
387 const std::array<unsigned int, 4> face_offsets = {
389 const std::array<unsigned int, 2> outer_strides = {
390 {points * points, 1}};
391 for (
unsigned int c = 0; c < n_components; ++c)
392 for (
unsigned int face = 0; face < 4; ++face)
393 if (process_face[1][face])
394 interpolate<2, 1, transpose>(face_offsets[face],
395 outer_strides[face / 2],
400 values + c * n_dofs);
404 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p4, p5}};
405 for (
unsigned int c = 0; c < n_components; ++c)
406 for (
unsigned int edge = 0; edge < 4; ++edge)
407 if (process_edge[1][edge])
408 interpolate<1, 1, transpose>(edge_offsets[edge],
414 values + c * n_dofs);
418 if (given_degree > 1)
420 const std::array<unsigned int, 4> face_offsets = {
422 const std::array<unsigned int, 2> outer_strides = {{points, 1}};
423 for (
unsigned int c = 0; c < n_components; ++c)
424 for (
unsigned int face = 0; face < 4; ++face)
425 if (process_face[2][face])
426 interpolate<2, 2, transpose>(face_offsets[face],
427 outer_strides[face / 2],
432 values + c * n_dofs);
436 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p2, p3}};
437 for (
unsigned int c = 0; c < n_components; ++c)
438 for (
unsigned int edge = 0; edge < 4; ++edge)
439 if (process_edge[2][edge])
440 interpolate<1, 2, transpose>(edge_offsets[edge],
446 values + c * n_dofs);
456 template <
typename T1, VectorizationTypes VT>
459 template <
typename T1>
466 template <
typename T>
467 static inline const std::array<AlignedVector<interpolation_type>, 2> &
470 return shape_info.data.front().subface_interpolation_matrices_scalar;
477 T1::size()> mask_new,
478 const unsigned int v)
527 const typename T1::value_type &
value,
534 template <
typename T1>
541 template <
typename T>
542 static inline const std::array<AlignedVector<T1>, 2> &
545 return shape_info.data.front().subface_interpolation_matrices;
570 T1::size()> mask_new,
571 const unsigned int v)
577 return {result, T1(1.0) - result};
598 result = result * i.second +
value * i.first;
602 template <
typename T1>
609 template <
typename T>
610 static inline const std::array<AlignedVector<T1>, 2> &
613 return shape_info.data.front().subface_interpolation_matrices;
638 T1::size()> mask_new,
639 const unsigned int v)
643 for (
unsigned int i = 0; i < T1::size(); ++i)
644 result[i] = mask_new[v] ==
mask[i];
646 return {result, T1(1.0) - result};
655 auto new_mask =
mask;
657 std::sort(new_mask.begin(), new_mask.end());
658 std::fill(std::unique(new_mask.begin(), new_mask.end()),
674 result = result * i.second +
value * i.first;
678 template <
typename T1>
685 template <
typename T>
686 static inline const std::array<AlignedVector<T1>, 2> &
689 return shape_info.data.front().subface_interpolation_matrices;
715 T1::size()> mask_new,
716 const unsigned int v)
749 template <
typename T,
780 template <
unsigned int direction,
unsigned int d,
bool skip_borders>
783 const unsigned int dof_offset,
790 static constexpr unsigned int max_n_points_1D = 40;
793 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
795 const unsigned int points =
800 const unsigned int stride = fe_degree != -1 ?
808 const unsigned int stride2 =
809 ((direction == 0 && d == 1) || (direction == 1 && d == 0)) ?
811 (((direction == 0 && d == 2) || (direction == 2 && d == 0)) ? points :
814 for (
unsigned int g = (skip_borders ? 1 : 0);
815 g < points - (skip_borders ? 1 : 0);
819 for (
unsigned int k = 0; k < points; ++k)
821 values[dof_offset + k * stride + stride2 * g],
v);
824 for (
unsigned int k = 0; k < points; ++k)
829 for (
unsigned int h = 1; h < points; ++h)
836 values[dof_offset + k * stride + stride2 * g], sum,
v);
841 template <
unsigned int direction>
844 const unsigned int p,
851 static constexpr unsigned int max_n_points_1D = 40;
854 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
856 const unsigned int points =
861 const unsigned int stride = fe_degree != -1 ?
866 for (
unsigned int k = 0; k < points; ++k)
872 for (
unsigned int k = 0; k < points; ++k)
877 for (
unsigned int h = 1; h < points; ++h)
889 template <
bool do_x,
bool do_y,
bool do_z>
915 template <
bool do_x,
bool do_y,
bool do_z>
919 static_assert((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
920 (!do_x && !do_y && do_z),
921 "Only one face can be chosen.");
923 static const unsigned int direction = do_x ? 0 : (do_y ? 1 : 2);
927 interpolate_3D_face<0, direction, false>(
928 t.face(direction, type),
935 interpolate_3D_face<1, direction, false>(
936 t.face(direction, type),
943 interpolate_3D_face<2, direction, false>(
944 t.face(direction, type),
951 template <
bool do_x,
bool do_y,
bool do_z>
955 static_assert(((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
956 (!do_x && !do_y && do_z)) ==
false,
957 "Only one face can be chosen.");
961 const auto inpterolation_matrix =
966 interpolate_3D_face<0, 1, true>(
970 interpolate_3D_face<0, 2, true>(
974 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
976 ((do_x && !do_y && do_z) ?
981 inpterolation_matrix,
985 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
987 ((do_x && !do_y && do_z) ?
992 inpterolation_matrix,
999 inpterolation_matrix,
1005 const auto inpterolation_matrix =
1010 interpolate_3D_face<1, 0, true>(
1014 interpolate_3D_face<1, 2, true>(
1018 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1020 ((!do_x && do_y && do_z) ?
1025 inpterolation_matrix,
1028 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1030 ((!do_x && do_y && do_z) ?
1035 inpterolation_matrix,
1042 inpterolation_matrix,
1048 const auto inpterolation_matrix =
1052 interpolate_3D_face<2, 0, true>(
1056 interpolate_3D_face<2, 1, true>(
1060 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1062 ((!do_x && do_y && do_z) ?
1067 inpterolation_matrix,
1070 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1072 ((!do_x && do_y && do_z) ?
1077 inpterolation_matrix,
1084 inpterolation_matrix,
1127 template <
typename Number,
1155 2> &interpolation_matrices,
1171 interpolation_matrices,
1173 , points(given_degree + 1)
1175 static_assert(fe_degree == -1,
"Only working for fe_degree = -1.");
1181 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1183 return line_array[i][j][k];
1187 face(
unsigned int i,
unsigned int j)
const
1189 return face_array[i][j];
1196 unsigned int l)
const
1198 return lines_plane_array[i][j][k][l];
1202 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1204 return lines_array[i][j][k][l];
1208 const ::ndarray<unsigned int, 3, 2, 2> line_array = {
1209 {{{{{points * points * points - points, points *points - points}},
1210 {{points * points * points - points * points, 0}}}},
1211 {{{{points * points * points - points * points + points - 1,
1213 {{points * points * points - points * points, 0}}}},
1214 {{{{points * points - 1, points - 1}},
1215 {{points * points - points, 0}}}}}};
1217 const ::ndarray<unsigned int, 3, 2> face_array = {
1219 {{points * points - points, 0}},
1220 {{points * points * points - points * points, 0}}}};
1222 const ::ndarray<unsigned int, 3, 2, 2, 4> lines_plane_array = {
1223 {{{{{{{points * points - points,
1224 points *points *points - points,
1226 points *points *points - points *points + points - 1}},
1228 points *points *points - points *points,
1230 points *points *points - points *points + points - 1}}}},
1231 {{{{points * points - points,
1232 points *points *points - points,
1234 points *points *points - points *points}},
1236 points *points *points - points *points,
1238 points *points *points - points *points}}}}}},
1239 {{{{{{points * points * points - points * points,
1240 points *points *points - points,
1242 points *points - 1}},
1243 {{0, points *points - points, points - 1, points *points - 1}}}},
1244 {{{{points * points * points - points * points,
1245 points *points *points - points,
1247 points *points - points}},
1248 {{0, points *points - points, 0, points *points - points}}}}}},
1249 {{{{{{points * points * points - points * points,
1250 points *points *points - points *points + points - 1,
1251 points *points - points,
1252 points *points - 1}},
1253 {{0, points - 1, points *points - points, points *points - 1}}}},
1254 {{{{points * points * points - points * points,
1255 points *points *points - points *points + points - 1,
1258 {{0, points - 1, 0, points - 1}}}}}}}};
1260 const ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1261 {{{{{{{points * points - points,
1262 points *points *points - points *points,
1263 points *points *points - points}},
1264 {{0, points *points - points, points *points *points - points}}}},
1266 points *points *points - points *points,
1267 points *points *points - points}},
1269 points *points - points,
1270 points *points *points - points *points}}}}}},
1272 points *points *points - points *points,
1273 points *points *points - points *points + points - 1}},
1276 points *points *points - points *points + points - 1}}}},
1278 points *points *points - points *points,
1279 points *points *points - points *points + points - 1}},
1280 {{0, points - 1, points *points *points - points *points}}}}}},
1281 {{{{{{points - 1, points *points - points, points *points - 1}},
1282 {{0, points - 1, points *points - 1}}}},
1283 {{{{0, points *points - points, points *points - 1}},
1284 {{0, points - 1, points *points - points}}}}}}}};
1287 template <
typename Number,
1315 2> &interpolation_matrices,
1331 interpolation_matrices,
1334 static_assert(fe_degree != -1,
"Only working for fe_degree != -1.");
1339 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1341 static constexpr unsigned int points = fe_degree + 1;
1343 static constexpr ::ndarray<unsigned int, 3, 2, 2> line_array = {
1344 {{{{{points * points * points - points, points * points - points}},
1345 {{points * points * points - points * points, 0}}}},
1346 {{{{points * points * points - points * points + points - 1,
1348 {{points * points * points - points * points, 0}}}},
1349 {{{{points * points - 1, points - 1}},
1350 {{points * points - points, 0}}}}}};
1352 return line_array[i][j][k];
1356 face(
unsigned int i,
unsigned int j)
const
1358 static constexpr unsigned int points = fe_degree + 1;
1360 static constexpr ::ndarray<unsigned int, 3, 2> face_array = {
1362 {{points * points - points, 0}},
1363 {{points * points * points - points * points, 0}}}};
1365 return face_array[i][j];
1372 unsigned int l)
const
1374 static constexpr unsigned int points = fe_degree + 1;
1376 static constexpr ::ndarray<unsigned int, 3, 2, 2, 4>
1377 lines_plane_array = {
1378 {{{{{{{points * points - points,
1379 points * points * points - points,
1381 points * points * points - points * points + points - 1}},
1383 points * points * points - points * points,
1385 points * points * points - points * points + points - 1}}}},
1386 {{{{points * points - points,
1387 points * points * points - points,
1389 points * points * points - points * points}},
1391 points * points * points - points * points,
1393 points * points * points - points * points}}}}}},
1394 {{{{{{points * points * points - points * points,
1395 points * points * points - points,
1397 points * points - 1}},
1399 points * points - points,
1401 points * points - 1}}}},
1402 {{{{points * points * points - points * points,
1403 points * points * points - points,
1405 points * points - points}},
1406 {{0, points * points - points, 0, points * points - points}}}}}},
1407 {{{{{{points * points * points - points * points,
1408 points * points * points - points * points + points - 1,
1409 points * points - points,
1410 points * points - 1}},
1413 points * points - points,
1414 points * points - 1}}}},
1415 {{{{points * points * points - points * points,
1416 points * points * points - points * points + points - 1,
1419 {{0, points - 1, 0, points - 1}}}}}}}};
1421 return lines_plane_array[i][j][k][l];
1425 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1427 static constexpr unsigned int points = fe_degree + 1;
1429 static constexpr ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1430 {{{{{{{points * points - points,
1431 points * points * points - points * points,
1432 points * points * points - points}},
1434 points * points - points,
1435 points * points * points - points}}}},
1437 points * points * points - points * points,
1438 points * points * points - points}},
1440 points * points - points,
1441 points * points * points - points * points}}}}}},
1443 points * points * points - points * points,
1444 points * points * points - points * points + points - 1}},
1447 points * points * points - points * points + points - 1}}}},
1449 points * points * points - points * points,
1450 points * points * points - points * points + points - 1}},
1451 {{0, points - 1, points * points * points - points * points}}}}}},
1452 {{{{{{points - 1, points * points - points, points * points - 1}},
1453 {{0, points - 1, points * points - 1}}}},
1454 {{{{0, points * points - points, points * points - 1}},
1455 {{0, points - 1, points * points - points}}}}}}}};
1457 return lines_array[i][j][k][l];
1462 template <
int dim,
int fe_degree,
typename Number>
1474 template <
unsigned int s
ide,
bool transpose>
1477 const unsigned int given_degree,
1483 static constexpr unsigned int max_n_points_1D = 40;
1486 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
1488 const unsigned int points =
1489 (fe_degree != -1 ? fe_degree : given_degree) + 1;
1493 const unsigned int d = side / 2;
1494 const unsigned int s = side % 2;
1497 const unsigned int stride =
1504 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1505 for (
unsigned int j = 0; j < r2; ++j, ++k)
1507 values[i * offset + stride + j], v);
1511 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1512 for (
unsigned int j = 0; j < r2; ++j, ++k)
1515 for (
unsigned int h = 0; h < points; ++h)
1522 values[i * offset + stride + j], sum, v);
1527 template <
bool transpose>
1530 const unsigned int n_desired_components,
1533 Number::size()> &constraint_mask,
1536 const unsigned int given_degree =
1537 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
1539 const auto &interpolation_matrices =
1542 const auto constraint_mask_sorted =
1545 for (
unsigned int c = 0; c < n_desired_components; ++c)
1547 for (
unsigned int v = 0; v < Number::size(); ++v)
1549 const auto mask = constraint_mask_sorted[v];
1559 constraint_mask_sorted,
1564 const bool subcell_x = (
mask >> 0) & 1;
1565 const bool subcell_y = (
mask >> 1) & 1;
1566 const bool face_x = (
mask >> 3) & 1;
1567 const bool face_y = (
mask >> 4) & 1;
1572 const auto *weights =
1573 interpolation_matrices[!subcell_x].data();
1576 interpolate_2D<2, transpose>(given_degree,
1581 interpolate_2D<3, transpose>(given_degree,
1590 const auto *weights =
1591 interpolation_matrices[!subcell_y].data();
1594 interpolate_2D<0, transpose>(given_degree,
1599 interpolate_2D<1, transpose>(given_degree,
1607 const bool type_x = (
mask >> 0) & 1;
1608 const bool type_y = (
mask >> 1) & 1;
1609 const bool type_z = (
mask >> 2) & 1;
1611 const auto flag_0 = (
mask >> 3) & 3;
1612 const auto flag_1 = (
mask >> 5) & 7;
1613 const auto faces = (flag_0 & 0b01) ? flag_1 : 0;
1614 const auto edges = (flag_0 & 0b10) ? flag_1 : 0;
1622 helper(given_degree,
1627 interpolation_matrices,
1637 .template process_faces_fast<true, false, false>();
1641 .template process_faces_fast<false, true, false>();
1644 helper.template process_faces<true, true, false>();
1648 .template process_faces_fast<false, false, true>();
1651 helper.template process_faces<true, false, true>();
1654 helper.template process_faces<false, true, true>();
1657 helper.template process_faces<true, true, true>();
1667 helper.template process_edge<true, false, false>();
1670 helper.template process_edge<false, true, false>();
1673 helper.template process_edge<true, true, false>();
1676 helper.template process_edge<false, false, true>();
1679 helper.template process_edge<true, false, true>();
1682 helper.template process_edge<false, true, true>();
1685 helper.template process_edge<true, true, true>();
1702 template <
int dim,
typename Number>
1706 template <
int fe_degree>
1708 run(
const unsigned int n_desired_components,
1712 Number::size()> &c_mask,
1722 RunnerType::template run_internal<true>(n_desired_components,
1727 RunnerType::template run_internal<false>(n_desired_components,
1735 template <
int fe_degree>
1739 return ((Number::size() > 2) && (fe_degree == -1 || fe_degree > 2)) ?
1748#undef DEAL_II_ALWAYS_INLINE_RELEASE
static DEAL_II_ALWAYS_INLINE_RELEASE void interpolate_2D(const unsigned int given_degree, const typename Trait< Number, VectorizationType >::index_type v, const typename Trait< Number, VectorizationType >::interpolation_type *DEAL_II_RESTRICT weight, Number *DEAL_II_RESTRICT values)
static void run_internal(const unsigned int n_desired_components, const MatrixFreeFunctions::ShapeInfo< Number > &shape_info, const std::array< MatrixFreeFunctions::compressed_constraint_kind, Number::size()> &constraint_mask, Number *values)
static void interpolate(const unsigned int offset, const unsigned int outer_stride, const unsigned int given_degree, const Number mask_weight, const Number mask_write, const Number *DEAL_II_RESTRICT weights, Number *DEAL_II_RESTRICT values)
static void run_internal(const unsigned int n_components, const MatrixFreeFunctions::ShapeInfo< Number > &shape_info, const std::array< MatrixFreeFunctions::compressed_constraint_kind, Number::size()> &constraint_mask, Number *values)
DEAL_II_ALWAYS_INLINE_RELEASE void process_faces() const
const std::array< AlignedVector< typename Trait< Number, VectorizationType >::interpolation_type >, 2 > & interpolation_matrices
DEAL_II_ALWAYS_INLINE_RELEASE HelperBase(const T &t, const unsigned int &given_degree, const bool &type_x, const bool &type_y, const bool &type_z, const typename Trait< Number, VectorizationType >::index_type &v, const std::array< AlignedVector< typename Trait< Number, VectorizationType >::interpolation_type >, 2 > &interpolation_matrices, Number *values)
static DEAL_II_ALWAYS_INLINE_RELEASE void interpolate_3D_edge(const unsigned int p, const unsigned int given_degree, const typename Trait< Number, VectorizationType >::index_type v, const typename Trait< Number, VectorizationType >::interpolation_type *DEAL_II_RESTRICT weight, Number *DEAL_II_RESTRICT values)
const unsigned int & given_degree
const Trait< Number, VectorizationType >::index_type & v
DEAL_II_ALWAYS_INLINE_RELEASE void process_edge() const
static DEAL_II_ALWAYS_INLINE_RELEASE void interpolate_3D_face(const unsigned int dof_offset, const unsigned int given_degree, const typename Trait< Number, VectorizationType >::index_type v, const typename Trait< Number, VectorizationType >::interpolation_type *DEAL_II_RESTRICT weight, Number *DEAL_II_RESTRICT values)
DEAL_II_ALWAYS_INLINE_RELEASE void process_faces_fast() const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int lines_plane(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
DEAL_II_ALWAYS_INLINE_RELEASE Helper(const unsigned int &given_degree, const bool &type_x, const bool &type_y, const bool &type_z, const typename Trait< Number, VectorizationType >::index_type &v, const std::array< AlignedVector< typename Trait< Number, VectorizationType >::interpolation_type >, 2 > &interpolation_matrices, Number *values)
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int lines(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int face(unsigned int i, unsigned int j) const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int line(unsigned int i, unsigned int j, unsigned int k) const
DEAL_II_ALWAYS_INLINE_RELEASE Helper(const unsigned int &given_degree, const bool &type_x, const bool &type_y, const bool &type_z, const typename Trait< Number, VectorizationType >::index_type &v, const std::array< AlignedVector< typename Trait< Number, VectorizationType >::interpolation_type >, 2 > &interpolation_matrices, Number *values)
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int lines_plane(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int face(unsigned int i, unsigned int j) const
const unsigned int points
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int line(unsigned int i, unsigned int j, unsigned int k) const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int lines(unsigned int i, unsigned int j, unsigned int k, unsigned int l) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ALWAYS_INLINE_RELEASE
#define AssertIndexRange(index, range)
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
constexpr T pow(const T base, const int iexp)
std::uint8_t compressed_constraint_kind
constexpr compressed_constraint_kind unconstrained_compressed_constraint_kind
FEEvaluationImplHangingNodesRunnerTypes
typename internal::ndarray::HelperArray< T, Ns... >::type ndarray
static constexpr FEEvaluationImplHangingNodesRunnerTypes used_runner_type()
static bool run(const unsigned int n_desired_components, const MatrixFreeFunctions::ShapeInfo< Number > &shape_info, const bool transpose, const std::array< MatrixFreeFunctions::compressed_constraint_kind, Number::size()> &c_mask, Number *values)
unsigned int dofs_per_component_on_cell
std::vector< UnivariateShapeData< Number > > data
static const std::array< AlignedVector< T1 >, 2 > & get_interpolation_matrix(const T &shape_info)
static DEAL_II_ALWAYS_INLINE_RELEASE index_type create(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask, const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask_new, const unsigned int v)
static DEAL_II_ALWAYS_INLINE_RELEASE T1 get_value(const T1 &value, const index_type &)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_continue(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE void set_value(T1 &result, const T1 &value, const index_type &i)
std::pair< T1, T1 > index_type
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_break(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> create_mask(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask)
typename T1::value_type value_type
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_break(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static const std::array< AlignedVector< interpolation_type >, 2 > & get_interpolation_matrix(const T &shape_info)
static DEAL_II_ALWAYS_INLINE_RELEASE T1::value_type get_value(const T1 &value, const index_type &i)
static DEAL_II_ALWAYS_INLINE_RELEASE std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> create_mask(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask)
value_type interpolation_type
static DEAL_II_ALWAYS_INLINE_RELEASE void set_value(T1 &result, const typename T1::value_type &value, const index_type &i)
static DEAL_II_ALWAYS_INLINE_RELEASE unsigned int create(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask, const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask_new, const unsigned int v)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_continue(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE T1::value_type get_value(const typename T1::value_type &value, const index_type &i)
static const std::array< AlignedVector< T1 >, 2 > & get_interpolation_matrix(const T &shape_info)
static DEAL_II_ALWAYS_INLINE_RELEASE index_type create(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask, const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask_new, const unsigned int v)
std::pair< T1, T1 > index_type
static DEAL_II_ALWAYS_INLINE_RELEASE T1 get_value(const T1 &value, const index_type &)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_continue(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE void set_value(T1 &result, const T1 &value, const index_type &i)
static DEAL_II_ALWAYS_INLINE_RELEASE std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> create_mask(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_break(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE T1 create(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask, const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask_new, const unsigned int v)
static const std::array< AlignedVector< T1 >, 2 > & get_interpolation_matrix(const T &shape_info)
static DEAL_II_ALWAYS_INLINE_RELEASE T1 get_value(const T1 &value, const index_type &)
static DEAL_II_ALWAYS_INLINE_RELEASE std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> create_mask(const std::array< MatrixFreeFunctions::compressed_constraint_kind, T1::size()> mask)
static DEAL_II_ALWAYS_INLINE_RELEASE void set_value(T1 &result, const T1 &value, const index_type &i)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_break(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)
static DEAL_II_ALWAYS_INLINE_RELEASE bool do_continue(unsigned int v, const MatrixFreeFunctions::compressed_constraint_kind &kind)