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,
92 unsigned int direction,
97 const unsigned int outer_stride,
98 const unsigned int given_degree,
99 const Number mask_weight,
100 const Number mask_write,
104 static constexpr unsigned int max_n_points_1D = 40;
106 static_assert(structdim == 1 || structdim == 2,
107 "Only 1D and 2d interpolation implemented");
108 Number temp[fe_degree != -1 ? fe_degree + 1 : max_n_points_1D];
110 const unsigned int points =
111 (fe_degree != -1 ? fe_degree : given_degree) + 1;
117 const unsigned int end_of_outer_loop = structdim == 1 ? 2 : points - 1;
118 for (
unsigned int g = 1; g < end_of_outer_loop; ++g)
120 const unsigned int my_offset =
121 offset + (structdim > 1 ? g * outer_stride : 0);
124 for (
unsigned int k = 0; k < points; ++k)
125 temp[k] = values[my_offset + k * stride];
128 for (
unsigned int k = 0; k < points / 2; ++k)
130 const unsigned int kmirror = points - 1 - k;
131 Number sum0 = Number(), sum1 = Number(), sum2 = Number(),
133 for (
unsigned int h = 0; h < points; ++h)
135 const unsigned int hmirror = points - 1 - h;
139 const Number w0 = weights[(
transpose ? 1 : points) * kmirror +
141 const Number w1 = weights[(
transpose ? 1 : points) * k +
143 sum0 += temp[h] * w0;
144 sum1 += temp[h] * w1;
145 sum2 += temp[hmirror] * w1;
146 sum3 += temp[hmirror] * w0;
148 values[my_offset + k * stride] =
150 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
151 values[my_offset + kmirror * stride] =
154 (sum2 + mask_weight * (sum3 - sum2) - temp[kmirror]);
160 const unsigned int k = points / 2;
161 Number sum0 = temp[k] * weights[(
transpose ? 1 : points) * k +
164 for (
unsigned int h = 0; h < points / 2; ++h)
166 const unsigned int hmirror = points - 1 - h;
167 const Number w0 = weights[(
transpose ? 1 : points) * k +
169 const Number w1 = weights[(
transpose ? 1 : points) * k +
171 sum0 += temp[h] * w0;
172 sum0 += temp[hmirror] * w1;
173 sum1 += temp[h] * w1;
174 sum1 += temp[hmirror] * w0;
176 values[my_offset + k * stride] =
178 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
184 template <
bool transpose,
typename Number2>
187 const unsigned int n_components,
190 Number::size()> &constraint_mask,
193 const unsigned int given_degree =
194 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
197 shape_info.
data.front().subface_interpolation_matrices[0].data();
199 const unsigned int points = given_degree + 1;
208 for (
unsigned int v = 0; v < Number::size(); ++v)
210 const auto kind = constraint_mask[v];
211 const bool subcell_x = (kind >> 0) & 1;
212 const bool subcell_y = (kind >> 1) & 1;
213 const bool face_x = (kind >> 3) & 1;
214 const bool face_y = (kind >> 4) & 1;
218 const unsigned int side = !subcell_y;
219 mask_write[0][side][v] = 1;
220 do_face[0][side] =
true;
221 mask_weights[0][v] = subcell_x;
226 const unsigned int side = !subcell_x;
227 mask_write[1][side][v] = 1;
228 do_face[1][side] =
true;
229 mask_weights[1][v] = subcell_y;
235 const std::array<unsigned int, 2> offsets = {
236 {0, (points - 1) * points}};
237 for (
unsigned int c = 0; c < n_components; ++c)
238 for (
unsigned int face = 0; face < 2; ++face)
239 if (do_face[0][face])
240 interpolate<1, 0, transpose>(offsets[face],
246 values + c * n_dofs);
251 const std::array<unsigned int, 2> offsets = {{0, points - 1}};
252 for (
unsigned int c = 0; c < n_components; ++c)
253 for (
unsigned int face = 0; face < 2; ++face)
254 if (do_face[1][face])
255 interpolate<1, 1, transpose>(offsets[face],
261 values + c * n_dofs);
266 const unsigned int p0 = 0;
267 const unsigned int p1 = points - 1;
268 const unsigned int p2 = points * points - points;
269 const unsigned int p3 = points * points - 1;
270 const unsigned int p4 = points * points * points - points * points;
271 const unsigned int p5 =
272 points * points * points - points * points + points - 1;
273 const unsigned int p6 = points * points * points - points;
281 for (
unsigned int v = 0; v < Number::size(); ++v)
283 const auto kind = constraint_mask[v];
285 const bool subcell_x = (kind >> 0) & 1;
286 const bool subcell_y = (kind >> 1) & 1;
287 const bool subcell_z = (kind >> 2) & 1;
288 const bool face_x = ((kind >> 3) & 1) ? (kind >> 5) & 1 : 0;
289 const bool face_y = ((kind >> 3) & 1) ? (kind >> 6) & 1 : 0;
290 const bool face_z = ((kind >> 3) & 1) ? (kind >> 7) & 1 : 0;
291 const bool edge_x = ((kind >> 4) & 1) ? (kind >> 5) & 1 : 0;
292 const bool edge_y = ((kind >> 4) & 1) ? (kind >> 6) & 1 : 0;
293 const bool edge_z = ((kind >> 4) & 1) ? (kind >> 7) & 1 : 0;
296 mask_weights[0][v] = 1;
298 mask_weights[1][v] = 1;
300 mask_weights[2][v] = 1;
304 const unsigned int side = !subcell_x;
306 mask_face[1][side][v] = process_face[1][side] =
true;
307 mask_edge[1][side][v] = process_edge[1][side] =
true;
308 mask_edge[1][2 + side][v] = process_edge[1][2 + side] =
true;
309 mask_face[2][side][v] = process_face[2][side] =
true;
310 mask_edge[2][side][v] = process_edge[2][side] =
true;
311 mask_edge[2][2 + side][v] = process_edge[2][2 + side] =
true;
315 const unsigned int side = !subcell_y;
317 mask_face[0][side][v] = process_face[0][side] =
true;
318 mask_edge[0][side][v] = process_edge[0][side] =
true;
319 mask_edge[0][2 + side][v] = process_edge[0][2 + side] =
true;
320 mask_face[2][2 + side][v] = process_face[2][2 + side] =
true;
321 mask_edge[2][2 * side][v] = process_edge[2][2 * side] =
true;
322 mask_edge[2][2 * side + 1][v] =
323 process_edge[2][2 * side + 1] =
true;
327 const unsigned int side = !subcell_z;
329 mask_face[0][2 + side][v] = process_face[0][2 + side] =
true;
330 mask_edge[0][2 * side][v] = process_edge[0][2 * side] =
true;
331 mask_edge[0][2 * side + 1][v] =
332 process_edge[0][2 * side + 1] =
true;
333 mask_face[1][2 + side][v] = process_face[1][2 + side] =
true;
334 mask_edge[1][2 * side][v] = process_edge[1][2 * side] =
true;
335 mask_edge[1][2 * side + 1][v] =
336 process_edge[1][2 * side + 1] =
true;
340 const unsigned int index = (!subcell_z) * 2 + (!subcell_y);
341 mask_edge[0][
index][v] = process_edge[0][
index] =
true;
345 const unsigned int index = (!subcell_z) * 2 + (!subcell_x);
346 mask_edge[1][
index][v] = process_edge[1][
index] =
true;
350 const unsigned int index = (!subcell_y) * 2 + (!subcell_x);
351 mask_edge[2][
index][v] = process_edge[2][
index] =
true;
356 if (given_degree > 1)
358 const std::array<unsigned int, 4> face_offsets = {
360 const std::array<unsigned int, 2> outer_strides = {
361 {points * points, points}};
362 for (
unsigned int c = 0; c < n_components; ++c)
363 for (
unsigned int face = 0; face < 4; ++face)
364 if (process_face[0][face])
365 interpolate<2, 0, transpose>(face_offsets[face],
366 outer_strides[face / 2],
371 values + c * n_dofs);
374 const std::array<unsigned int, 4> edge_offsets = {{p0, p2, p4, p6}};
375 for (
unsigned int c = 0; c < n_components; ++c)
376 for (
unsigned int edge = 0; edge < 4; ++edge)
377 if (process_edge[0][edge])
378 interpolate<1, 0, transpose>(edge_offsets[edge],
384 values + c * n_dofs);
388 if (given_degree > 1)
390 const std::array<unsigned int, 4> face_offsets = {
392 const std::array<unsigned int, 2> outer_strides = {
393 {points * points, 1}};
394 for (
unsigned int c = 0; c < n_components; ++c)
395 for (
unsigned int face = 0; face < 4; ++face)
396 if (process_face[1][face])
397 interpolate<2, 1, transpose>(face_offsets[face],
398 outer_strides[face / 2],
403 values + c * n_dofs);
407 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p4, p5}};
408 for (
unsigned int c = 0; c < n_components; ++c)
409 for (
unsigned int edge = 0; edge < 4; ++edge)
410 if (process_edge[1][edge])
411 interpolate<1, 1, transpose>(edge_offsets[edge],
417 values + c * n_dofs);
421 if (given_degree > 1)
423 const std::array<unsigned int, 4> face_offsets = {
425 const std::array<unsigned int, 2> outer_strides = {{points, 1}};
426 for (
unsigned int c = 0; c < n_components; ++c)
427 for (
unsigned int face = 0; face < 4; ++face)
428 if (process_face[2][face])
429 interpolate<2, 2, transpose>(face_offsets[face],
430 outer_strides[face / 2],
435 values + c * n_dofs);
439 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p2, p3}};
440 for (
unsigned int c = 0; c < n_components; ++c)
441 for (
unsigned int edge = 0; edge < 4; ++edge)
442 if (process_edge[2][edge])
443 interpolate<1, 2, transpose>(edge_offsets[edge],
449 values + c * n_dofs);
459 template <
typename T1, VectorizationTypes VT>
462 template <
typename T1>
469 template <
typename T>
470 static inline const std::array<AlignedVector<interpolation_type>, 2> &
473 return shape_info.data.front().subface_interpolation_matrices_scalar;
480 T1::size()> mask_new,
481 const unsigned int v)
530 const typename T1::value_type &
value,
537 template <
typename T1>
544 template <
typename T>
545 static inline const std::array<AlignedVector<T1>, 2> &
548 return shape_info.data.front().subface_interpolation_matrices;
573 T1::size()> mask_new,
574 const unsigned int v)
580 return {result, T1(1.0) - result};
601 result = result * i.second +
value * i.first;
605 template <
typename T1>
612 template <
typename T>
613 static inline const std::array<AlignedVector<T1>, 2> &
616 return shape_info.data.front().subface_interpolation_matrices;
641 T1::size()> mask_new,
642 const unsigned int v)
646 for (
unsigned int i = 0; i < T1::size(); ++i)
647 result[i] = mask_new[v] ==
mask[i];
649 return {result, T1(1.0) - result};
658 auto new_mask =
mask;
660 std::sort(new_mask.begin(), new_mask.end());
661 std::fill(std::unique(new_mask.begin(), new_mask.end()),
677 result = result * i.second +
value * i.first;
681 template <
typename T1>
688 template <
typename T>
689 static inline const std::array<AlignedVector<T1>, 2> &
692 return shape_info.data.front().subface_interpolation_matrices;
718 T1::size()> mask_new,
719 const unsigned int v)
752 template <
typename T,
783 template <
unsigned int direction,
unsigned int d,
bool skip_borders>
786 const unsigned int dof_offset,
793 static constexpr unsigned int max_n_points_1D = 40;
796 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
798 const unsigned int points =
803 const unsigned int stride = fe_degree != -1 ?
811 const unsigned int stride2 =
812 ((direction == 0 && d == 1) || (direction == 1 && d == 0)) ?
814 (((direction == 0 && d == 2) || (direction == 2 && d == 0)) ? points :
817 for (
unsigned int g = (skip_borders ? 1 : 0);
818 g < points - (skip_borders ? 1 : 0);
822 for (
unsigned int k = 0; k < points; ++k)
824 values[dof_offset + k * stride + stride2 * g],
v);
827 for (
unsigned int k = 0; k < points; ++k)
832 for (
unsigned int h = 1; h < points; ++h)
839 values[dof_offset + k * stride + stride2 * g], sum,
v);
844 template <
unsigned int direction>
847 const unsigned int p,
854 static constexpr unsigned int max_n_points_1D = 40;
857 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
859 const unsigned int points =
864 const unsigned int stride = fe_degree != -1 ?
869 for (
unsigned int k = 0; k < points; ++k)
875 for (
unsigned int k = 0; k < points; ++k)
880 for (
unsigned int h = 1; h < points; ++h)
892 template <
bool do_x,
bool do_y,
bool do_z>
918 template <
bool do_x,
bool do_y,
bool do_z>
922 static_assert((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
923 (!do_x && !do_y && do_z),
924 "Only one face can be chosen.");
926 static const unsigned int direction = do_x ? 0 : (do_y ? 1 : 2);
930 interpolate_3D_face<0, direction, false>(
931 t.face(direction, type),
938 interpolate_3D_face<1, direction, false>(
939 t.face(direction, type),
946 interpolate_3D_face<2, direction, false>(
947 t.face(direction, type),
954 template <
bool do_x,
bool do_y,
bool do_z>
958 static_assert(((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
959 (!do_x && !do_y && do_z)) ==
false,
960 "Only one face can be chosen.");
964 const auto inpterolation_matrix =
969 interpolate_3D_face<0, 1, true>(
973 interpolate_3D_face<0, 2, true>(
977 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
979 ((do_x && !do_y && do_z) ?
984 inpterolation_matrix,
988 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
990 ((do_x && !do_y && do_z) ?
995 inpterolation_matrix,
1002 inpterolation_matrix,
1008 const auto inpterolation_matrix =
1013 interpolate_3D_face<1, 0, true>(
1017 interpolate_3D_face<1, 2, true>(
1021 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1023 ((!do_x && do_y && do_z) ?
1028 inpterolation_matrix,
1031 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1033 ((!do_x && do_y && do_z) ?
1038 inpterolation_matrix,
1045 inpterolation_matrix,
1051 const auto inpterolation_matrix =
1055 interpolate_3D_face<2, 0, true>(
1059 interpolate_3D_face<2, 1, true>(
1063 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1065 ((!do_x && do_y && do_z) ?
1070 inpterolation_matrix,
1073 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1075 ((!do_x && do_y && do_z) ?
1080 inpterolation_matrix,
1087 inpterolation_matrix,
1130 template <
typename Number,
1158 2> &interpolation_matrices,
1174 interpolation_matrices,
1176 , points(given_degree + 1)
1178 static_assert(fe_degree == -1,
"Only working for fe_degree = -1.");
1184 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1186 return line_array[i][j][k];
1190 face(
unsigned int i,
unsigned int j)
const
1192 return face_array[i][j];
1199 unsigned int l)
const
1201 return lines_plane_array[i][j][k][l];
1205 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1207 return lines_array[i][j][k][l];
1211 const ::ndarray<unsigned int, 3, 2, 2> line_array = {
1212 {{{{{points * points * points - points, points *points - points}},
1213 {{points * points * points - points * points, 0}}}},
1214 {{{{points * points * points - points * points + points - 1,
1216 {{points * points * points - points * points, 0}}}},
1217 {{{{points * points - 1, points - 1}},
1218 {{points * points - points, 0}}}}}};
1220 const ::ndarray<unsigned int, 3, 2> face_array = {
1222 {{points * points - points, 0}},
1223 {{points * points * points - points * points, 0}}}};
1225 const ::ndarray<unsigned int, 3, 2, 2, 4> lines_plane_array = {
1226 {{{{{{{points * points - points,
1227 points *points *points - points,
1229 points *points *points - points *points + points - 1}},
1231 points *points *points - points *points,
1233 points *points *points - points *points + points - 1}}}},
1234 {{{{points * points - points,
1235 points *points *points - points,
1237 points *points *points - points *points}},
1239 points *points *points - points *points,
1241 points *points *points - points *points}}}}}},
1242 {{{{{{points * points * points - points * points,
1243 points *points *points - points,
1245 points *points - 1}},
1246 {{0, points *points - points, points - 1, points *points - 1}}}},
1247 {{{{points * points * points - points * points,
1248 points *points *points - points,
1250 points *points - points}},
1251 {{0, points *points - points, 0, points *points - points}}}}}},
1252 {{{{{{points * points * points - points * points,
1253 points *points *points - points *points + points - 1,
1254 points *points - points,
1255 points *points - 1}},
1256 {{0, points - 1, points *points - points, points *points - 1}}}},
1257 {{{{points * points * points - points * points,
1258 points *points *points - points *points + points - 1,
1261 {{0, points - 1, 0, points - 1}}}}}}}};
1263 const ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1264 {{{{{{{points * points - points,
1265 points *points *points - points *points,
1266 points *points *points - points}},
1267 {{0, points *points - points, points *points *points - points}}}},
1269 points *points *points - points *points,
1270 points *points *points - points}},
1272 points *points - points,
1273 points *points *points - points *points}}}}}},
1275 points *points *points - points *points,
1276 points *points *points - points *points + points - 1}},
1279 points *points *points - points *points + points - 1}}}},
1281 points *points *points - points *points,
1282 points *points *points - points *points + points - 1}},
1283 {{0, points - 1, points *points *points - points *points}}}}}},
1284 {{{{{{points - 1, points *points - points, points *points - 1}},
1285 {{0, points - 1, points *points - 1}}}},
1286 {{{{0, points *points - points, points *points - 1}},
1287 {{0, points - 1, points *points - points}}}}}}}};
1290 template <
typename Number,
1318 2> &interpolation_matrices,
1334 interpolation_matrices,
1337 static_assert(fe_degree != -1,
"Only working for fe_degree != -1.");
1342 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1344 static constexpr unsigned int points = fe_degree + 1;
1346 static constexpr ::ndarray<unsigned int, 3, 2, 2> line_array = {
1347 {{{{{points * points * points - points, points * points - points}},
1348 {{points * points * points - points * points, 0}}}},
1349 {{{{points * points * points - points * points + points - 1,
1351 {{points * points * points - points * points, 0}}}},
1352 {{{{points * points - 1, points - 1}},
1353 {{points * points - points, 0}}}}}};
1355 return line_array[i][j][k];
1359 face(
unsigned int i,
unsigned int j)
const
1361 static constexpr unsigned int points = fe_degree + 1;
1363 static constexpr ::ndarray<unsigned int, 3, 2> face_array = {
1365 {{points * points - points, 0}},
1366 {{points * points * points - points * points, 0}}}};
1368 return face_array[i][j];
1375 unsigned int l)
const
1377 static constexpr unsigned int points = fe_degree + 1;
1379 static constexpr ::ndarray<unsigned int, 3, 2, 2, 4>
1380 lines_plane_array = {
1381 {{{{{{{points * points - points,
1382 points * points * points - points,
1384 points * points * points - points * points + points - 1}},
1386 points * points * points - points * points,
1388 points * points * points - points * points + points - 1}}}},
1389 {{{{points * points - points,
1390 points * points * points - points,
1392 points * points * points - points * points}},
1394 points * points * points - points * points,
1396 points * points * points - points * points}}}}}},
1397 {{{{{{points * points * points - points * points,
1398 points * points * points - points,
1400 points * points - 1}},
1402 points * points - points,
1404 points * points - 1}}}},
1405 {{{{points * points * points - points * points,
1406 points * points * points - points,
1408 points * points - points}},
1409 {{0, points * points - points, 0, points * points - points}}}}}},
1410 {{{{{{points * points * points - points * points,
1411 points * points * points - points * points + points - 1,
1412 points * points - points,
1413 points * points - 1}},
1416 points * points - points,
1417 points * points - 1}}}},
1418 {{{{points * points * points - points * points,
1419 points * points * points - points * points + points - 1,
1422 {{0, points - 1, 0, points - 1}}}}}}}};
1424 return lines_plane_array[i][j][k][l];
1428 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1430 static constexpr unsigned int points = fe_degree + 1;
1432 static constexpr ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1433 {{{{{{{points * points - points,
1434 points * points * points - points * points,
1435 points * points * points - points}},
1437 points * points - points,
1438 points * points * points - points}}}},
1440 points * points * points - points * points,
1441 points * points * points - points}},
1443 points * points - points,
1444 points * points * points - points * points}}}}}},
1446 points * points * points - points * points,
1447 points * points * points - points * points + points - 1}},
1450 points * points * points - points * points + points - 1}}}},
1452 points * points * points - points * points,
1453 points * points * points - points * points + points - 1}},
1454 {{0, points - 1, points * points * points - points * points}}}}}},
1455 {{{{{{points - 1, points * points - points, points * points - 1}},
1456 {{0, points - 1, points * points - 1}}}},
1457 {{{{0, points * points - points, points * points - 1}},
1458 {{0, points - 1, points * points - points}}}}}}}};
1460 return lines_array[i][j][k][l];
1465 template <
int dim,
int fe_degree,
typename Number>
1477 template <
unsigned int s
ide,
bool transpose>
1480 const unsigned int given_degree,
1486 static constexpr unsigned int max_n_points_1D = 40;
1489 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
1491 const unsigned int points =
1492 (fe_degree != -1 ? fe_degree : given_degree) + 1;
1496 const unsigned int d = side / 2;
1497 const unsigned int s = side % 2;
1500 const unsigned int stride =
1507 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1508 for (
unsigned int j = 0; j < r2; ++j, ++k)
1510 values[i * offset + stride + j], v);
1514 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1515 for (
unsigned int j = 0; j < r2; ++j, ++k)
1518 for (
unsigned int h = 0; h < points; ++h)
1525 values[i * offset + stride + j], sum, v);
1530 template <
bool transpose,
typename Number2>
1533 const unsigned int n_desired_components,
1536 Number::size()> &constraint_mask,
1539 const unsigned int given_degree =
1540 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
1542 const auto &interpolation_matrices =
1545 const auto constraint_mask_sorted =
1548 for (
unsigned int c = 0; c < n_desired_components; ++c)
1550 for (
unsigned int v = 0; v < Number::size(); ++v)
1552 const auto mask = constraint_mask_sorted[v];
1562 constraint_mask_sorted,
1567 const bool subcell_x = (
mask >> 0) & 1;
1568 const bool subcell_y = (
mask >> 1) & 1;
1569 const bool face_x = (
mask >> 3) & 1;
1570 const bool face_y = (
mask >> 4) & 1;
1575 const auto *weights =
1576 interpolation_matrices[!subcell_x].data();
1579 interpolate_2D<2, transpose>(given_degree,
1584 interpolate_2D<3, transpose>(given_degree,
1593 const auto *weights =
1594 interpolation_matrices[!subcell_y].data();
1597 interpolate_2D<0, transpose>(given_degree,
1602 interpolate_2D<1, transpose>(given_degree,
1610 const bool type_x = (
mask >> 0) & 1;
1611 const bool type_y = (
mask >> 1) & 1;
1612 const bool type_z = (
mask >> 2) & 1;
1614 const auto flag_0 = (
mask >> 3) & 3;
1615 const auto flag_1 = (
mask >> 5) & 7;
1616 const auto faces = (flag_0 & 0b01) ? flag_1 : 0;
1617 const auto edges = (flag_0 & 0b10) ? flag_1 : 0;
1625 helper(given_degree,
1630 interpolation_matrices,
1640 .template process_faces_fast<true, false, false>();
1644 .template process_faces_fast<false, true, false>();
1647 helper.template process_faces<true, true, false>();
1651 .template process_faces_fast<false, false, true>();
1654 helper.template process_faces<true, false, true>();
1657 helper.template process_faces<false, true, true>();
1660 helper.template process_faces<true, true, true>();
1670 helper.template process_edge<true, false, false>();
1673 helper.template process_edge<false, true, false>();
1676 helper.template process_edge<true, true, false>();
1679 helper.template process_edge<false, false, true>();
1682 helper.template process_edge<true, false, true>();
1685 helper.template process_edge<false, true, true>();
1688 helper.template process_edge<true, true, true>();
1705 template <
int dim,
typename Number>
1709 template <
int fe_degree,
typename Number2>
1711 run(
const unsigned int n_desired_components,
1715 Number::size()> &c_mask,
1725 RunnerType::template run_internal<true>(n_desired_components,
1730 RunnerType::template run_internal<false>(n_desired_components,
1738 template <
int fe_degree>
1742 return ((Number::size() > 2) && (fe_degree == -1 || fe_degree > 2)) ?
1751#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 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 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)