14#ifndef dealii_matrix_free_evaluation_kernels_hanging_nodes_h
15#define dealii_matrix_free_evaluation_kernels_hanging_nodes_h
29# define DEAL_II_ALWAYS_INLINE_RELEASE
31# define DEAL_II_ALWAYS_INLINE_RELEASE DEAL_II_ALWAYS_INLINE
116 template <
int dim,
int fe_degree,
typename Number>
124 template <
int structdim,
125 unsigned int direction,
130 const unsigned int outer_stride,
131 const unsigned int given_degree,
132 const Number mask_weight,
133 const Number mask_write,
137 static constexpr unsigned int max_n_points_1D = 40;
139 static_assert(structdim == 1 || structdim == 2,
140 "Only 1D and 2d interpolation implemented");
141 Number temp[fe_degree != -1 ? fe_degree + 1 : max_n_points_1D];
143 const unsigned int points =
144 (fe_degree != -1 ? fe_degree : given_degree) + 1;
150 const unsigned int end_of_outer_loop = structdim == 1 ? 2 : points - 1;
151 for (
unsigned int g = 1; g < end_of_outer_loop; ++g)
153 const unsigned int my_offset =
154 offset + (structdim > 1 ? g * outer_stride : 0);
159 for (
unsigned int k = 0; k < points; ++k)
160 temp[k] = values[my_offset + k * stride];
163 for (
unsigned int k = 0; k < points / 2; ++k)
165 const unsigned int kmirror = points - 1 - k;
166 Number sum0 = Number(), sum1 = Number(), sum2 = Number(),
168 for (
unsigned int h = 0; h < points; ++h)
170 const unsigned int hmirror = points - 1 - h;
174 const Number w0 = weights[(
transpose ? 1 : points) * kmirror +
176 const Number w1 = weights[(
transpose ? 1 : points) * k +
178 sum0 += temp[h] * w0;
179 sum1 += temp[h] * w1;
180 sum2 += temp[hmirror] * w1;
181 sum3 += temp[hmirror] * w0;
183 values[my_offset + k * stride] =
185 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
186 values[my_offset + kmirror * stride] =
189 (sum2 + mask_weight * (sum3 - sum2) - temp[kmirror]);
195 const unsigned int k = points / 2;
196 Number sum0 = temp[k] * weights[(
transpose ? 1 : points) * k +
199 for (
unsigned int h = 0; h < points / 2; ++h)
201 const unsigned int hmirror = points - 1 - h;
202 const Number w0 = weights[(
transpose ? 1 : points) * k +
204 const Number w1 = weights[(
transpose ? 1 : points) * k +
206 sum0 += temp[h] * w0;
207 sum0 += temp[hmirror] * w1;
208 sum1 += temp[h] * w1;
209 sum1 += temp[hmirror] * w0;
211 values[my_offset + k * stride] =
213 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
219 template <
bool transpose,
typename Number2>
222 const unsigned int n_components,
225 Number::size()> &constraint_mask,
228 const unsigned int given_degree =
229 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
232 shape_info.
data.front().subface_interpolation_matrices[0].data();
234 const unsigned int points = given_degree + 1;
243 for (
unsigned int v = 0; v < Number::size(); ++v)
245 const auto kind = constraint_mask[v];
246 const bool subcell_x = (kind >> 0) & 1;
247 const bool subcell_y = (kind >> 1) & 1;
248 const bool face_x = (kind >> 3) & 1;
249 const bool face_y = (kind >> 4) & 1;
253 const unsigned int side = !subcell_y;
254 mask_write[0][side][v] = 1;
255 do_face[0][side] =
true;
256 mask_weights[0][v] = subcell_x;
261 const unsigned int side = !subcell_x;
262 mask_write[1][side][v] = 1;
263 do_face[1][side] =
true;
264 mask_weights[1][v] = subcell_y;
270 const std::array<unsigned int, 2> offsets = {
271 {0, (points - 1) * points}};
272 for (
unsigned int c = 0; c < n_components; ++c)
273 for (
unsigned int face = 0; face < 2; ++face)
274 if (do_face[0][face])
275 interpolate<1, 0, transpose>(offsets[face],
281 values + c * n_dofs);
286 const std::array<unsigned int, 2> offsets = {{0, points - 1}};
287 for (
unsigned int c = 0; c < n_components; ++c)
288 for (
unsigned int face = 0; face < 2; ++face)
289 if (do_face[1][face])
290 interpolate<1, 1, transpose>(offsets[face],
296 values + c * n_dofs);
301 const unsigned int p0 = 0;
302 const unsigned int p1 = points - 1;
303 const unsigned int p2 = points * points - points;
304 const unsigned int p3 = points * points - 1;
305 const unsigned int p4 = points * points * points - points * points;
306 const unsigned int p5 =
307 points * points * points - points * points + points - 1;
308 const unsigned int p6 = points * points * points - points;
316 for (
unsigned int v = 0; v < Number::size(); ++v)
318 const auto kind = constraint_mask[v];
320 const bool subcell_x = (kind >> 0) & 1;
321 const bool subcell_y = (kind >> 1) & 1;
322 const bool subcell_z = (kind >> 2) & 1;
323 const bool face_x = ((kind >> 3) & 1) ? (kind >> 5) & 1 : 0;
324 const bool face_y = ((kind >> 3) & 1) ? (kind >> 6) & 1 : 0;
325 const bool face_z = ((kind >> 3) & 1) ? (kind >> 7) & 1 : 0;
326 const bool edge_x = ((kind >> 4) & 1) ? (kind >> 5) & 1 : 0;
327 const bool edge_y = ((kind >> 4) & 1) ? (kind >> 6) & 1 : 0;
328 const bool edge_z = ((kind >> 4) & 1) ? (kind >> 7) & 1 : 0;
331 mask_weights[0][v] = 1;
333 mask_weights[1][v] = 1;
335 mask_weights[2][v] = 1;
339 const unsigned int side = !subcell_x;
341 mask_face[1][side][v] = process_face[1][side] =
true;
342 mask_edge[1][side][v] = process_edge[1][side] =
true;
343 mask_edge[1][2 + side][v] = process_edge[1][2 + side] =
true;
344 mask_face[2][side][v] = process_face[2][side] =
true;
345 mask_edge[2][side][v] = process_edge[2][side] =
true;
346 mask_edge[2][2 + side][v] = process_edge[2][2 + side] =
true;
350 const unsigned int side = !subcell_y;
352 mask_face[0][side][v] = process_face[0][side] =
true;
353 mask_edge[0][side][v] = process_edge[0][side] =
true;
354 mask_edge[0][2 + side][v] = process_edge[0][2 + side] =
true;
355 mask_face[2][2 + side][v] = process_face[2][2 + side] =
true;
356 mask_edge[2][2 * side][v] = process_edge[2][2 * side] =
true;
357 mask_edge[2][2 * side + 1][v] =
358 process_edge[2][2 * side + 1] =
true;
362 const unsigned int side = !subcell_z;
364 mask_face[0][2 + side][v] = process_face[0][2 + side] =
true;
365 mask_edge[0][2 * side][v] = process_edge[0][2 * side] =
true;
366 mask_edge[0][2 * side + 1][v] =
367 process_edge[0][2 * side + 1] =
true;
368 mask_face[1][2 + side][v] = process_face[1][2 + side] =
true;
369 mask_edge[1][2 * side][v] = process_edge[1][2 * side] =
true;
370 mask_edge[1][2 * side + 1][v] =
371 process_edge[1][2 * side + 1] =
true;
375 const unsigned int index = (!subcell_z) * 2 + (!subcell_y);
376 mask_edge[0][
index][v] = process_edge[0][
index] =
true;
380 const unsigned int index = (!subcell_z) * 2 + (!subcell_x);
381 mask_edge[1][
index][v] = process_edge[1][
index] =
true;
385 const unsigned int index = (!subcell_y) * 2 + (!subcell_x);
386 mask_edge[2][
index][v] = process_edge[2][
index] =
true;
391 if (given_degree > 1)
393 const std::array<unsigned int, 4> face_offsets = {
395 const std::array<unsigned int, 2> outer_strides = {
396 {points * points, points}};
397 for (
unsigned int c = 0; c < n_components; ++c)
398 for (
unsigned int face = 0; face < 4; ++face)
399 if (process_face[0][face])
400 interpolate<2, 0, transpose>(face_offsets[face],
401 outer_strides[face / 2],
406 values + c * n_dofs);
409 const std::array<unsigned int, 4> edge_offsets = {{p0, p2, p4, p6}};
410 for (
unsigned int c = 0; c < n_components; ++c)
411 for (
unsigned int edge = 0; edge < 4; ++edge)
412 if (process_edge[0][edge])
413 interpolate<1, 0, transpose>(edge_offsets[edge],
419 values + c * n_dofs);
423 if (given_degree > 1)
425 const std::array<unsigned int, 4> face_offsets = {
427 const std::array<unsigned int, 2> outer_strides = {
428 {points * points, 1}};
429 for (
unsigned int c = 0; c < n_components; ++c)
430 for (
unsigned int face = 0; face < 4; ++face)
431 if (process_face[1][face])
432 interpolate<2, 1, transpose>(face_offsets[face],
433 outer_strides[face / 2],
438 values + c * n_dofs);
442 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p4, p5}};
443 for (
unsigned int c = 0; c < n_components; ++c)
444 for (
unsigned int edge = 0; edge < 4; ++edge)
445 if (process_edge[1][edge])
446 interpolate<1, 1, transpose>(edge_offsets[edge],
452 values + c * n_dofs);
456 if (given_degree > 1)
458 const std::array<unsigned int, 4> face_offsets = {
460 const std::array<unsigned int, 2> outer_strides = {{points, 1}};
461 for (
unsigned int c = 0; c < n_components; ++c)
462 for (
unsigned int face = 0; face < 4; ++face)
463 if (process_face[2][face])
464 interpolate<2, 2, transpose>(face_offsets[face],
465 outer_strides[face / 2],
470 values + c * n_dofs);
474 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p2, p3}};
475 for (
unsigned int c = 0; c < n_components; ++c)
476 for (
unsigned int edge = 0; edge < 4; ++edge)
477 if (process_edge[2][edge])
478 interpolate<1, 2, transpose>(edge_offsets[edge],
484 values + c * n_dofs);
494 template <
typename T1, VectorizationTypes VT>
497 template <
typename T1>
504 template <
typename T>
505 static inline const std::array<AlignedVector<interpolation_type>, 2> &
508 return shape_info.data.front().subface_interpolation_matrices_scalar;
515 T1::size()> mask_new,
516 const unsigned int v)
565 const typename T1::value_type &
value,
572 template <
typename T1>
579 template <
typename T>
580 static inline const std::array<AlignedVector<T1>, 2> &
583 return shape_info.data.front().subface_interpolation_matrices;
608 T1::size()> mask_new,
609 const unsigned int v)
615 return {result, T1(1.0) - result};
636 result = result * i.second +
value * i.first;
640 template <
typename T1>
647 template <
typename T>
648 static inline const std::array<AlignedVector<T1>, 2> &
651 return shape_info.data.front().subface_interpolation_matrices;
676 T1::size()> mask_new,
677 const unsigned int v)
681 for (
unsigned int i = 0; i < T1::size(); ++i)
682 result[i] = mask_new[v] ==
mask[i];
684 return {result, T1(1.0) - result};
693 auto new_mask =
mask;
695 std::sort(new_mask.begin(), new_mask.end());
696 std::fill(std::unique(new_mask.begin(), new_mask.end()),
712 result = result * i.second +
value * i.first;
716 template <
typename T1>
723 template <
typename T>
724 static inline const std::array<AlignedVector<T1>, 2> &
727 return shape_info.data.front().subface_interpolation_matrices;
753 T1::size()> mask_new,
754 const unsigned int v)
797 template <
typename T,
828 template <
unsigned int direction,
unsigned int d,
bool skip_borders>
831 const unsigned int dof_offset,
838 static constexpr unsigned int max_n_points_1D = 40;
841 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
843 const unsigned int points =
848 const unsigned int stride = fe_degree != -1 ?
856 const unsigned int stride2 =
857 ((direction == 0 && d == 1) || (direction == 1 && d == 0)) ?
859 (((direction == 0 && d == 2) || (direction == 2 && d == 0)) ? points :
862 for (
unsigned int g = (skip_borders ? 1 : 0);
863 g < points - (skip_borders ? 1 : 0);
867 for (
unsigned int k = 0; k < points; ++k)
869 values[dof_offset + k * stride + stride2 * g],
v);
872 for (
unsigned int k = 0; k < points; ++k)
877 for (
unsigned int h = 1; h < points; ++h)
884 values[dof_offset + k * stride + stride2 * g], sum,
v);
889 template <
unsigned int direction>
892 const unsigned int p,
899 static constexpr unsigned int max_n_points_1D = 40;
902 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
904 const unsigned int points =
909 const unsigned int stride = fe_degree != -1 ?
914 for (
unsigned int k = 0; k < points; ++k)
920 for (
unsigned int k = 0; k < points; ++k)
925 for (
unsigned int h = 1; h < points; ++h)
937 template <
bool do_x,
bool do_y,
bool do_z>
963 template <
bool do_x,
bool do_y,
bool do_z>
967 static_assert((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
968 (!do_x && !do_y && do_z),
969 "Only one face can be chosen.");
971 static const unsigned int direction = do_x ? 0 : (do_y ? 1 : 2);
975 interpolate_3D_face<0, direction, false>(
976 t.face(direction, type),
983 interpolate_3D_face<1, direction, false>(
984 t.face(direction, type),
991 interpolate_3D_face<2, direction, false>(
992 t.face(direction, type),
999 template <
bool do_x,
bool do_y,
bool do_z>
1003 static_assert(((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
1004 (!do_x && !do_y && do_z)) ==
false,
1005 "Only one face can be chosen.");
1009 const auto inpterolation_matrix =
1014 interpolate_3D_face<0, 1, true>(
1018 interpolate_3D_face<0, 2, true>(
1022 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
1024 ((do_x && !do_y && do_z) ?
1029 inpterolation_matrix,
1033 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
1035 ((do_x && !do_y && do_z) ?
1040 inpterolation_matrix,
1047 inpterolation_matrix,
1053 const auto inpterolation_matrix =
1058 interpolate_3D_face<1, 0, true>(
1062 interpolate_3D_face<1, 2, true>(
1066 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1068 ((!do_x && do_y && do_z) ?
1073 inpterolation_matrix,
1076 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1078 ((!do_x && do_y && do_z) ?
1083 inpterolation_matrix,
1090 inpterolation_matrix,
1096 const auto inpterolation_matrix =
1100 interpolate_3D_face<2, 0, true>(
1104 interpolate_3D_face<2, 1, true>(
1108 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1110 ((!do_x && do_y && do_z) ?
1115 inpterolation_matrix,
1118 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1120 ((!do_x && do_y && do_z) ?
1125 inpterolation_matrix,
1132 inpterolation_matrix,
1171 template <
typename Number,
1182 FEEvaluationImplHangingNodesScalarEntityInterpolationImpl<
1183 HelperType::dynamic,
1201 const unsigned int &given_degree,
1209 2> &interpolation_matrices,
1227 interpolation_matrices,
1229 , points(given_degree + 1)
1231 static_assert(fe_degree == -1,
"Only working for fe_degree = -1.");
1238 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1240 return line_array[i][j][k];
1244 face(
unsigned int i,
unsigned int j)
const
1246 return face_array[i][j];
1253 unsigned int l)
const
1255 return lines_plane_array[i][j][k][l];
1259 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1261 return lines_array[i][j][k][l];
1265 const ::ndarray<unsigned int, 3, 2, 2> line_array = {
1266 {{{{{points * points * points - points, points *points - points}},
1267 {{points * points * points - points * points, 0}}}},
1268 {{{{points * points * points - points * points + points - 1,
1270 {{points * points * points - points * points, 0}}}},
1271 {{{{points * points - 1, points - 1}},
1272 {{points * points - points, 0}}}}}};
1274 const ::ndarray<unsigned int, 3, 2> face_array = {
1276 {{points * points - points, 0}},
1277 {{points * points * points - points * points, 0}}}};
1279 const ::ndarray<unsigned int, 3, 2, 2, 4> lines_plane_array = {
1280 {{{{{{{points * points - points,
1281 points *points *points - points,
1283 points *points *points - points *points + points - 1}},
1285 points *points *points - points *points,
1287 points *points *points - points *points + points - 1}}}},
1288 {{{{points * points - points,
1289 points *points *points - points,
1291 points *points *points - points *points}},
1293 points *points *points - points *points,
1295 points *points *points - points *points}}}}}},
1296 {{{{{{points * points * points - points * points,
1297 points *points *points - points,
1299 points *points - 1}},
1300 {{0, points *points - points, points - 1, points *points - 1}}}},
1301 {{{{points * points * points - points * points,
1302 points *points *points - points,
1304 points *points - points}},
1305 {{0, points *points - points, 0, points *points - points}}}}}},
1306 {{{{{{points * points * points - points * points,
1307 points *points *points - points *points + points - 1,
1308 points *points - points,
1309 points *points - 1}},
1310 {{0, points - 1, points *points - points, points *points - 1}}}},
1311 {{{{points * points * points - points * points,
1312 points *points *points - points *points + points - 1,
1315 {{0, points - 1, 0, points - 1}}}}}}}};
1317 const ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1318 {{{{{{{points * points - points,
1319 points *points *points - points *points,
1320 points *points *points - points}},
1321 {{0, points *points - points, points *points *points - points}}}},
1323 points *points *points - points *points,
1324 points *points *points - points}},
1326 points *points - points,
1327 points *points *points - points *points}}}}}},
1329 points *points *points - points *points,
1330 points *points *points - points *points + points - 1}},
1333 points *points *points - points *points + points - 1}}}},
1335 points *points *points - points *points,
1336 points *points *points - points *points + points - 1}},
1337 {{0, points - 1, points *points *points - points *points}}}}}},
1338 {{{{{{points - 1, points *points - points, points *points - 1}},
1339 {{0, points - 1, points *points - 1}}}},
1340 {{{{0, points *points - points, points *points - 1}},
1341 {{0, points - 1, points *points - points}}}}}}}};
1353 template <
typename Number,
1364 FEEvaluationImplHangingNodesScalarEntityInterpolationImpl<
1365 HelperType::constant,
1383 const unsigned int &given_degree,
1391 2> &interpolation_matrices,
1409 interpolation_matrices,
1412 static_assert(fe_degree != -1,
"Only working for fe_degree != -1.");
1418 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1420 static constexpr unsigned int points = fe_degree + 1;
1422 static constexpr ::ndarray<unsigned int, 3, 2, 2> line_array = {
1423 {{{{{points * points * points - points, points * points - points}},
1424 {{points * points * points - points * points, 0}}}},
1425 {{{{points * points * points - points * points + points - 1,
1427 {{points * points * points - points * points, 0}}}},
1428 {{{{points * points - 1, points - 1}},
1429 {{points * points - points, 0}}}}}};
1431 return line_array[i][j][k];
1435 face(
unsigned int i,
unsigned int j)
const
1437 static constexpr unsigned int points = fe_degree + 1;
1439 static constexpr ::ndarray<unsigned int, 3, 2> face_array = {
1441 {{points * points - points, 0}},
1442 {{points * points * points - points * points, 0}}}};
1444 return face_array[i][j];
1451 unsigned int l)
const
1453 static constexpr unsigned int points = fe_degree + 1;
1455 static constexpr ::ndarray<unsigned int, 3, 2, 2, 4>
1456 lines_plane_array = {
1457 {{{{{{{points * points - points,
1458 points * points * points - points,
1460 points * points * points - points * points + points - 1}},
1462 points * points * points - points * points,
1464 points * points * points - points * points + points - 1}}}},
1465 {{{{points * points - points,
1466 points * points * points - points,
1468 points * points * points - points * points}},
1470 points * points * points - points * points,
1472 points * points * points - points * points}}}}}},
1473 {{{{{{points * points * points - points * points,
1474 points * points * points - points,
1476 points * points - 1}},
1478 points * points - points,
1480 points * points - 1}}}},
1481 {{{{points * points * points - points * points,
1482 points * points * points - points,
1484 points * points - points}},
1485 {{0, points * points - points, 0, points * points - points}}}}}},
1486 {{{{{{points * points * points - points * points,
1487 points * points * points - points * points + points - 1,
1488 points * points - points,
1489 points * points - 1}},
1492 points * points - points,
1493 points * points - 1}}}},
1494 {{{{points * points * points - points * points,
1495 points * points * points - points * points + points - 1,
1498 {{0, points - 1, 0, points - 1}}}}}}}};
1500 return lines_plane_array[i][j][k][l];
1504 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1506 static constexpr unsigned int points = fe_degree + 1;
1508 static constexpr ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1509 {{{{{{{points * points - points,
1510 points * points * points - points * points,
1511 points * points * points - points}},
1513 points * points - points,
1514 points * points * points - points}}}},
1516 points * points * points - points * points,
1517 points * points * points - points}},
1519 points * points - points,
1520 points * points * points - points * points}}}}}},
1522 points * points * points - points * points,
1523 points * points * points - points * points + points - 1}},
1526 points * points * points - points * points + points - 1}}}},
1528 points * points * points - points * points,
1529 points * points * points - points * points + points - 1}},
1530 {{0, points - 1, points * points * points - points * points}}}}}},
1531 {{{{{{points - 1, points * points - points, points * points - 1}},
1532 {{0, points - 1, points * points - 1}}}},
1533 {{{{0, points * points - points, points * points - 1}},
1534 {{0, points - 1, points * points - points}}}}}}}};
1536 return lines_array[i][j][k][l];
1546 template <
int dim,
int fe_degree,
typename Number>
1558 template <
unsigned int s
ide,
bool transpose>
1561 const unsigned int given_degree,
1567 static constexpr unsigned int max_n_points_1D = 40;
1570 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
1572 const unsigned int points =
1573 (fe_degree != -1 ? fe_degree : given_degree) + 1;
1577 const unsigned int d = side / 2;
1578 const unsigned int s = side % 2;
1581 const unsigned int stride =
1588 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1589 for (
unsigned int j = 0; j < r2; ++j, ++k)
1591 values[i * offset + stride + j], v);
1595 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1596 for (
unsigned int j = 0; j < r2; ++j, ++k)
1599 for (
unsigned int h = 0; h < points; ++h)
1606 values[i * offset + stride + j], sum, v);
1611 template <
bool transpose,
typename Number2>
1614 const unsigned int n_desired_components,
1617 Number::size()> &constraint_mask,
1620 const unsigned int given_degree =
1621 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
1623 const auto &interpolation_matrices =
1626 const auto constraint_mask_sorted =
1629 for (
unsigned int c = 0; c < n_desired_components; ++c)
1631 for (
unsigned int v = 0; v < Number::size(); ++v)
1633 const auto mask = constraint_mask_sorted[v];
1643 constraint_mask_sorted,
1648 const bool subcell_x = (
mask >> 0) & 1;
1649 const bool subcell_y = (
mask >> 1) & 1;
1650 const bool face_x = (
mask >> 3) & 1;
1651 const bool face_y = (
mask >> 4) & 1;
1656 const auto *weights =
1657 interpolation_matrices[!subcell_x].data();
1660 interpolate_2D<2, transpose>(given_degree,
1665 interpolate_2D<3, transpose>(given_degree,
1674 const auto *weights =
1675 interpolation_matrices[!subcell_y].data();
1678 interpolate_2D<0, transpose>(given_degree,
1683 interpolate_2D<1, transpose>(given_degree,
1691 const bool type_x = (
mask >> 0) & 1;
1692 const bool type_y = (
mask >> 1) & 1;
1693 const bool type_z = (
mask >> 2) & 1;
1695 const auto flag_0 = (
mask >> 3) & 3;
1696 const auto flag_1 = (
mask >> 5) & 7;
1697 const auto faces = (flag_0 & 0b01) ? flag_1 : 0;
1698 const auto edges = (flag_0 & 0b10) ? flag_1 : 0;
1707 helper(given_degree,
1712 interpolation_matrices,
1722 .template process_faces_fast<true, false, false>();
1726 .template process_faces_fast<false, true, false>();
1729 helper.template process_faces<true, true, false>();
1733 .template process_faces_fast<false, false, true>();
1736 helper.template process_faces<true, false, true>();
1739 helper.template process_faces<false, true, true>();
1742 helper.template process_faces<true, true, true>();
1752 helper.template process_edge<true, false, false>();
1755 helper.template process_edge<false, true, false>();
1758 helper.template process_edge<true, true, false>();
1761 helper.template process_edge<false, false, true>();
1764 helper.template process_edge<true, false, true>();
1767 helper.template process_edge<false, true, true>();
1770 helper.template process_edge<true, true, true>();
1787 template <
int dim,
typename Number>
1791 template <
int fe_degree,
typename Number2>
1793 run(
const unsigned int n_desired_components,
1797 Number::size()> &c_mask,
1807 RunnerType::template run_internal<true>(n_desired_components,
1812 RunnerType::template run_internal<false>(n_desired_components,
1820 template <
int fe_degree>
1824 return ((Number::size() > 2) && (fe_degree == -1 || fe_degree > 2)) ?
1833#undef DEAL_II_ALWAYS_INLINE_RELEASE
static void run_internal(const unsigned int n_desired_components, const MatrixFreeFunctions::ShapeInfo< Number2 > &shape_info, const std::array< MatrixFreeFunctions::compressed_constraint_kind, Number::size()> &constraint_mask, Number *values)
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_components, const MatrixFreeFunctions::ShapeInfo< Number2 > &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 Number2 *DEAL_II_RESTRICT weights, Number *DEAL_II_RESTRICT values)
DEAL_II_ALWAYS_INLINE_RELEASE FEEvaluationImplHangingNodesScalarEntityInterpolationImpl(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 line(unsigned int i, unsigned int j, unsigned int k) const
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int face(unsigned int i, unsigned int j) 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 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
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 FEEvaluationImplHangingNodesScalarEntityInterpolationImpl(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)
const unsigned int points
DEAL_II_ALWAYS_INLINE_RELEASE unsigned int face(unsigned int i, unsigned int j) const
DEAL_II_ALWAYS_INLINE_RELEASE void process_faces() const
DEAL_II_ALWAYS_INLINE_RELEASE void process_faces_fast() const
const std::array< AlignedVector< typename Trait< Number, VectorizationType >::interpolation_type >, 2 > & interpolation_matrices
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)
const unsigned int & given_degree
DEAL_II_ALWAYS_INLINE_RELEASE FEEvaluationImplHangingNodesScalarEntityInterpolation(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)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_ALWAYS_INLINE_RELEASE
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
#define AssertIndexRange(index, range)
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 bool run(const unsigned int n_desired_components, const MatrixFreeFunctions::ShapeInfo< Number2 > &shape_info, const bool transpose, const std::array< MatrixFreeFunctions::compressed_constraint_kind, Number::size()> &c_mask, Number *values)
static constexpr FEEvaluationImplHangingNodesRunnerTypes used_runner_type()
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)