17#ifndef dealii_matrix_free_evaluation_kernels_hanging_nodes_h
18#define dealii_matrix_free_evaluation_kernels_hanging_nodes_h
32# define DEAL_II_ALWAYS_INLINE_RELEASE
34# define DEAL_II_ALWAYS_INLINE_RELEASE DEAL_II_ALWAYS_INLINE
84 template <
int dim,
int fe_degree,
typename Number>
92 template <
int structdim,
unsigned int direction,
bool transpose>
95 const unsigned int outer_stride,
96 const unsigned int given_degree,
97 const Number mask_weight,
98 const Number mask_write,
102 static constexpr unsigned int max_n_points_1D = 40;
104 static_assert(structdim == 1 || structdim == 2,
105 "Only 1D and 2d interpolation implemented");
106 Number temp[fe_degree != -1 ? fe_degree + 1 : max_n_points_1D];
108 const unsigned int points =
109 (fe_degree != -1 ? fe_degree : given_degree) + 1;
115 const unsigned int end_of_outer_loop = structdim == 1 ? 2 : points - 1;
116 for (
unsigned int g = 1; g < end_of_outer_loop; ++g)
118 const unsigned int my_offset =
119 offset + (structdim > 1 ? g * outer_stride : 0);
122 for (
unsigned int k = 0; k < points; ++k)
123 temp[k] = values[my_offset + k * stride];
126 for (
unsigned int k = 0; k < points / 2; ++k)
128 const unsigned int kmirror = points - 1 - k;
129 Number sum0 = Number(), sum1 = Number(), sum2 = Number(),
131 for (
unsigned int h = 0; h < points; ++h)
133 const unsigned int hmirror = points - 1 - h;
137 const Number w0 = weights[(
transpose ? 1 : points) * kmirror +
139 const Number w1 = weights[(
transpose ? 1 : points) * k +
141 sum0 += temp[h] * w0;
142 sum1 += temp[h] * w1;
143 sum2 += temp[hmirror] * w1;
144 sum3 += temp[hmirror] * w0;
146 values[my_offset + k * stride] =
148 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
149 values[my_offset + kmirror * stride] =
152 (sum2 + mask_weight * (sum3 - sum2) - temp[kmirror]);
158 const unsigned int k = points / 2;
159 Number sum0 = temp[k] * weights[(
transpose ? 1 : points) * k +
162 for (
unsigned int h = 0; h < points / 2; ++h)
164 const unsigned int hmirror = points - 1 - h;
165 const Number w0 = weights[(
transpose ? 1 : points) * k +
167 const Number w1 = weights[(
transpose ? 1 : points) * k +
169 sum0 += temp[h] * w0;
170 sum0 += temp[hmirror] * w1;
171 sum1 += temp[h] * w1;
172 sum1 += temp[hmirror] * w0;
174 values[my_offset + k * stride] =
176 mask_write * (sum0 + mask_weight * (sum1 - sum0) - temp[k]);
182 template <
bool transpose>
185 const unsigned int n_components,
188 Number::size()> & constraint_mask,
191 const unsigned int given_degree =
192 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
195 shape_info.
data.front().subface_interpolation_matrices[0].data();
197 const unsigned int points = given_degree + 1;
206 for (
unsigned int v = 0; v < Number::size(); ++v)
208 const auto kind = constraint_mask[v];
209 const bool subcell_x = (kind >> 0) & 1;
210 const bool subcell_y = (kind >> 1) & 1;
211 const bool face_x = (kind >> 3) & 1;
212 const bool face_y = (kind >> 4) & 1;
216 const unsigned int side = !subcell_y;
217 mask_write[0][side][v] = 1;
218 do_face[0][side] =
true;
219 mask_weights[0][v] = subcell_x;
224 const unsigned int side = !subcell_x;
225 mask_write[1][side][v] = 1;
226 do_face[1][side] =
true;
227 mask_weights[1][v] = subcell_y;
233 const std::array<unsigned int, 2> offsets = {
234 {0, (points - 1) * points}};
235 for (
unsigned int c = 0; c < n_components; ++c)
236 for (
unsigned int face = 0; face < 2; ++face)
237 if (do_face[0][face])
238 interpolate<1, 0, transpose>(offsets[face],
244 values + c * n_dofs);
249 const std::array<unsigned int, 2> offsets = {{0, points - 1}};
250 for (
unsigned int c = 0; c < n_components; ++c)
251 for (
unsigned int face = 0; face < 2; ++face)
252 if (do_face[1][face])
253 interpolate<1, 1, transpose>(offsets[face],
259 values + c * n_dofs);
264 const unsigned int p0 = 0;
265 const unsigned int p1 = points - 1;
266 const unsigned int p2 = points * points - points;
267 const unsigned int p3 = points * points - 1;
268 const unsigned int p4 = points * points * points - points * points;
269 const unsigned int p5 =
270 points * points * points - points * points + points - 1;
271 const unsigned int p6 = points * points * points - points;
279 for (
unsigned int v = 0; v < Number::size(); ++v)
281 const auto kind = constraint_mask[v];
283 const bool subcell_x = (kind >> 0) & 1;
284 const bool subcell_y = (kind >> 1) & 1;
285 const bool subcell_z = (kind >> 2) & 1;
286 const bool face_x = ((kind >> 3) & 1) ? (kind >> 5) & 1 : 0;
287 const bool face_y = ((kind >> 3) & 1) ? (kind >> 6) & 1 : 0;
288 const bool face_z = ((kind >> 3) & 1) ? (kind >> 7) & 1 : 0;
289 const bool edge_x = ((kind >> 4) & 1) ? (kind >> 5) & 1 : 0;
290 const bool edge_y = ((kind >> 4) & 1) ? (kind >> 6) & 1 : 0;
291 const bool edge_z = ((kind >> 4) & 1) ? (kind >> 7) & 1 : 0;
294 mask_weights[0][v] = 1;
296 mask_weights[1][v] = 1;
298 mask_weights[2][v] = 1;
302 const unsigned int side = !subcell_x;
304 mask_face[1][side][v] = process_face[1][side] =
true;
305 mask_edge[1][side][v] = process_edge[1][side] =
true;
306 mask_edge[1][2 + side][v] = process_edge[1][2 + side] =
true;
307 mask_face[2][side][v] = process_face[2][side] =
true;
308 mask_edge[2][side][v] = process_edge[2][side] =
true;
309 mask_edge[2][2 + side][v] = process_edge[2][2 + side] =
true;
313 const unsigned int side = !subcell_y;
315 mask_face[0][side][v] = process_face[0][side] =
true;
316 mask_edge[0][side][v] = process_edge[0][side] =
true;
317 mask_edge[0][2 + side][v] = process_edge[0][2 + side] =
true;
318 mask_face[2][2 + side][v] = process_face[2][2 + side] =
true;
319 mask_edge[2][2 * side][v] = process_edge[2][2 * side] =
true;
320 mask_edge[2][2 * side + 1][v] =
321 process_edge[2][2 * side + 1] =
true;
325 const unsigned int side = !subcell_z;
327 mask_face[0][2 + side][v] = process_face[0][2 + side] =
true;
328 mask_edge[0][2 * side][v] = process_edge[0][2 * side] =
true;
329 mask_edge[0][2 * side + 1][v] =
330 process_edge[0][2 * side + 1] =
true;
331 mask_face[1][2 + side][v] = process_face[1][2 + side] =
true;
332 mask_edge[1][2 * side][v] = process_edge[1][2 * side] =
true;
333 mask_edge[1][2 * side + 1][v] =
334 process_edge[1][2 * side + 1] =
true;
338 const unsigned int index = (!subcell_z) * 2 + (!subcell_y);
339 mask_edge[0][
index][v] = process_edge[0][
index] =
true;
343 const unsigned int index = (!subcell_z) * 2 + (!subcell_x);
344 mask_edge[1][
index][v] = process_edge[1][
index] =
true;
348 const unsigned int index = (!subcell_y) * 2 + (!subcell_x);
349 mask_edge[2][
index][v] = process_edge[2][
index] =
true;
354 if (given_degree > 1)
356 const std::array<unsigned int, 4> face_offsets = {
358 const std::array<unsigned int, 2> outer_strides = {
359 {points * points, points}};
360 for (
unsigned int c = 0; c < n_components; ++c)
361 for (
unsigned int face = 0; face < 4; ++face)
362 if (process_face[0][face])
363 interpolate<2, 0, transpose>(face_offsets[face],
364 outer_strides[face / 2],
369 values + c * n_dofs);
372 const std::array<unsigned int, 4> edge_offsets = {{p0, p2, p4, p6}};
373 for (
unsigned int c = 0; c < n_components; ++c)
374 for (
unsigned int edge = 0; edge < 4; ++edge)
375 if (process_edge[0][edge])
376 interpolate<1, 0, transpose>(edge_offsets[edge],
382 values + c * n_dofs);
386 if (given_degree > 1)
388 const std::array<unsigned int, 4> face_offsets = {
390 const std::array<unsigned int, 2> outer_strides = {
391 {points * points, 1}};
392 for (
unsigned int c = 0; c < n_components; ++c)
393 for (
unsigned int face = 0; face < 4; ++face)
394 if (process_face[1][face])
395 interpolate<2, 1, transpose>(face_offsets[face],
396 outer_strides[face / 2],
401 values + c * n_dofs);
405 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p4, p5}};
406 for (
unsigned int c = 0; c < n_components; ++c)
407 for (
unsigned int edge = 0; edge < 4; ++edge)
408 if (process_edge[1][edge])
409 interpolate<1, 1, transpose>(edge_offsets[edge],
415 values + c * n_dofs);
419 if (given_degree > 1)
421 const std::array<unsigned int, 4> face_offsets = {
423 const std::array<unsigned int, 2> outer_strides = {{points, 1}};
424 for (
unsigned int c = 0; c < n_components; ++c)
425 for (
unsigned int face = 0; face < 4; ++face)
426 if (process_face[2][face])
427 interpolate<2, 2, transpose>(face_offsets[face],
428 outer_strides[face / 2],
433 values + c * n_dofs);
437 const std::array<unsigned int, 4> edge_offsets = {{p0, p1, p2, p3}};
438 for (
unsigned int c = 0; c < n_components; ++c)
439 for (
unsigned int edge = 0; edge < 4; ++edge)
440 if (process_edge[2][edge])
441 interpolate<1, 2, transpose>(edge_offsets[edge],
447 values + c * n_dofs);
457 template <
typename T1, VectorizationTypes VT>
460 template <
typename T1>
467 template <
typename T>
468 static inline const std::array<AlignedVector<interpolation_type>, 2> &
471 return shape_info.data.front().subface_interpolation_matrices_scalar;
478 T1::size()> mask_new,
479 const unsigned int v)
528 const typename T1::value_type &
value,
535 template <
typename T1>
542 template <
typename T>
543 static inline const std::array<AlignedVector<T1>, 2> &
546 return shape_info.data.front().subface_interpolation_matrices;
571 T1::size()> mask_new,
572 const unsigned int v)
578 return {result, T1(1.0) - result};
599 result = result * i.second +
value * i.first;
603 template <
typename T1>
610 template <
typename T>
611 static inline const std::array<AlignedVector<T1>, 2> &
614 return shape_info.data.front().subface_interpolation_matrices;
639 T1::size()> mask_new,
640 const unsigned int v)
644 for (
unsigned int i = 0; i < T1::size(); ++i)
645 result[i] = mask_new[v] ==
mask[i];
647 return {result, T1(1.0) - result};
656 auto new_mask =
mask;
658 std::sort(new_mask.begin(), new_mask.end());
659 std::fill(std::unique(new_mask.begin(), new_mask.end()),
675 result = result * i.second +
value * i.first;
679 template <
typename T1>
686 template <
typename T>
687 static inline const std::array<AlignedVector<T1>, 2> &
690 return shape_info.data.front().subface_interpolation_matrices;
716 T1::size()> mask_new,
717 const unsigned int v)
750 template <
typename T,
781 template <
unsigned int direction,
unsigned int d,
bool skip_borders>
784 const unsigned int dof_offset,
791 static constexpr unsigned int max_n_points_1D = 40;
794 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
796 const unsigned int points =
801 const unsigned int stride = fe_degree != -1 ?
809 const unsigned int stride2 =
810 ((direction == 0 && d == 1) || (direction == 1 && d == 0)) ?
812 (((direction == 0 && d == 2) || (direction == 2 && d == 0)) ? points :
815 for (
unsigned int g = (skip_borders ? 1 : 0);
816 g < points - (skip_borders ? 1 : 0);
820 for (
unsigned int k = 0; k < points; ++k)
822 values[dof_offset + k * stride + stride2 * g],
v);
825 for (
unsigned int k = 0; k < points; ++k)
830 for (
unsigned int h = 1; h < points; ++h)
837 values[dof_offset + k * stride + stride2 * g], sum,
v);
842 template <
unsigned int direction>
845 const unsigned int p,
852 static constexpr unsigned int max_n_points_1D = 40;
855 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
857 const unsigned int points =
862 const unsigned int stride = fe_degree != -1 ?
867 for (
unsigned int k = 0; k < points; ++k)
873 for (
unsigned int k = 0; k < points; ++k)
878 for (
unsigned int h = 1; h < points; ++h)
890 template <
bool do_x,
bool do_y,
bool do_z>
916 template <
bool do_x,
bool do_y,
bool do_z>
920 static_assert((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
921 (!do_x && !do_y && do_z),
922 "Only one face can be chosen.");
924 static const unsigned int direction = do_x ? 0 : (do_y ? 1 : 2);
928 interpolate_3D_face<0, direction, false>(
929 t.face(direction, type),
936 interpolate_3D_face<1, direction, false>(
937 t.face(direction, type),
944 interpolate_3D_face<2, direction, false>(
945 t.face(direction, type),
952 template <
bool do_x,
bool do_y,
bool do_z>
956 static_assert(((do_x && !do_y && !do_z) || (!do_x && do_y && !do_z) ||
957 (!do_x && !do_y && do_z)) ==
false,
958 "Only one face can be chosen.");
962 const auto inpterolation_matrix =
967 interpolate_3D_face<0, 1, true>(
971 interpolate_3D_face<0, 2, true>(
975 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
977 ((do_x && !do_y && do_z) ?
982 inpterolation_matrix,
986 interpolate_3D_edge<0>((do_x && do_y && !do_z) ?
988 ((do_x && !do_y && do_z) ?
993 inpterolation_matrix,
1000 inpterolation_matrix,
1006 const auto inpterolation_matrix =
1011 interpolate_3D_face<1, 0, true>(
1015 interpolate_3D_face<1, 2, true>(
1019 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1021 ((!do_x && do_y && do_z) ?
1026 inpterolation_matrix,
1029 interpolate_3D_edge<1>((do_x && do_y && !do_z) ?
1031 ((!do_x && do_y && do_z) ?
1036 inpterolation_matrix,
1043 inpterolation_matrix,
1049 const auto inpterolation_matrix =
1053 interpolate_3D_face<2, 0, true>(
1057 interpolate_3D_face<2, 1, true>(
1061 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1063 ((!do_x && do_y && do_z) ?
1068 inpterolation_matrix,
1071 interpolate_3D_edge<2>((do_x && !do_y && do_z) ?
1073 ((!do_x && do_y && do_z) ?
1078 inpterolation_matrix,
1085 inpterolation_matrix,
1128 template <
typename Number,
1149 const bool & type_x,
1150 const bool & type_y,
1151 const bool & type_z,
1156 2> & interpolation_matrices,
1172 interpolation_matrices,
1174 , points(given_degree + 1)
1176 static_assert(fe_degree == -1,
"Only working for fe_degree = -1.");
1182 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1184 return line_array[i][j][k];
1188 face(
unsigned int i,
unsigned int j)
const
1190 return face_array[i][j];
1197 unsigned int l)
const
1199 return lines_plane_array[i][j][k][l];
1203 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1205 return lines_array[i][j][k][l];
1209 const ::ndarray<unsigned int, 3, 2, 2> line_array = {
1210 {{{{{points * points * points - points, points *points - points}},
1211 {{points * points * points - points * points, 0}}}},
1212 {{{{points * points * points - points * points + points - 1,
1214 {{points * points * points - points * points, 0}}}},
1215 {{{{points * points - 1, points - 1}},
1216 {{points * points - points, 0}}}}}};
1218 const ::ndarray<unsigned int, 3, 2> face_array = {
1220 {{points * points - points, 0}},
1221 {{points * points * points - points * points, 0}}}};
1223 const ::ndarray<unsigned int, 3, 2, 2, 4> lines_plane_array = {
1224 {{{{{{{points * points - points,
1225 points *points *points - points,
1227 points *points *points - points *points + points - 1}},
1229 points *points *points - points *points,
1231 points *points *points - points *points + points - 1}}}},
1232 {{{{points * points - points,
1233 points *points *points - points,
1235 points *points *points - points *points}},
1237 points *points *points - points *points,
1239 points *points *points - points *points}}}}}},
1240 {{{{{{points * points * points - points * points,
1241 points *points *points - points,
1243 points *points - 1}},
1244 {{0, points *points - points, points - 1, points *points - 1}}}},
1245 {{{{points * points * points - points * points,
1246 points *points *points - points,
1248 points *points - points}},
1249 {{0, points *points - points, 0, points *points - points}}}}}},
1250 {{{{{{points * points * points - points * points,
1251 points *points *points - points *points + points - 1,
1252 points * points - points,
1253 points * points - 1}},
1254 {{0, points - 1, points *points - points, points *points - 1}}}},
1255 {{{{points * points * points - points * points,
1256 points *points *points - points *points + points - 1,
1259 {{0, points - 1, 0, points - 1}}}}}}}};
1261 const ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1262 {{{{{{{points * points - points,
1263 points *points *points - points *points,
1264 points *points *points - points}},
1265 {{0, points *points - points, points *points *points - points}}}},
1267 points *points *points - points *points,
1268 points *points *points - points}},
1270 points *points - points,
1271 points *points *points - points *points}}}}}},
1273 points *points *points - points *points,
1274 points *points *points - points *points + points - 1}},
1277 points *points *points - points *points + points - 1}}}},
1279 points *points *points - points *points,
1280 points *points *points - points *points + points - 1}},
1281 {{0, points - 1, points *points *points - points *points}}}}}},
1282 {{{{{{points - 1, points *points - points, points *points - 1}},
1283 {{0, points - 1, points *points - 1}}}},
1284 {{{{0, points *points - points, points *points - 1}},
1285 {{0, points - 1, points *points - points}}}}}}}};
1288 template <
typename Number,
1309 const bool & type_x,
1310 const bool & type_y,
1311 const bool & type_z,
1316 2> & interpolation_matrices,
1332 interpolation_matrices,
1335 static_assert(fe_degree != -1,
"Only working for fe_degree != -1.");
1340 line(
unsigned int i,
unsigned int j,
unsigned int k)
const
1342 static constexpr unsigned int points = fe_degree + 1;
1344 static constexpr ::ndarray<unsigned int, 3, 2, 2> line_array = {
1345 {{{{{points * points * points - points, points * points - points}},
1346 {{points * points * points - points * points, 0}}}},
1347 {{{{points * points * points - points * points + points - 1,
1349 {{points * points * points - points * points, 0}}}},
1350 {{{{points * points - 1, points - 1}},
1351 {{points * points - points, 0}}}}}};
1353 return line_array[i][j][k];
1357 face(
unsigned int i,
unsigned int j)
const
1359 static constexpr unsigned int points = fe_degree + 1;
1361 static constexpr ::ndarray<unsigned int, 3, 2> face_array = {
1363 {{points * points - points, 0}},
1364 {{points * points * points - points * points, 0}}}};
1366 return face_array[i][j];
1373 unsigned int l)
const
1375 static constexpr unsigned int points = fe_degree + 1;
1377 static constexpr ::ndarray<unsigned int, 3, 2, 2, 4>
1378 lines_plane_array = {
1379 {{{{{{{points * points - points,
1380 points * points * points - points,
1382 points * points * points - points * points + points - 1}},
1384 points * points * points - points * points,
1386 points * points * points - points * points + points - 1}}}},
1387 {{{{points * points - points,
1388 points * points * points - points,
1390 points * points * points - points * points}},
1392 points * points * points - points * points,
1394 points * points * points - points * points}}}}}},
1395 {{{{{{points * points * points - points * points,
1396 points * points * points - points,
1398 points * points - 1}},
1400 points * points - points,
1402 points * points - 1}}}},
1403 {{{{points * points * points - points * points,
1404 points * points * points - points,
1406 points * points - points}},
1407 {{0, points * points - points, 0, points * points - points}}}}}},
1408 {{{{{{points * points * points - points * points,
1409 points * points * points - points * points + points - 1,
1410 points * points - points,
1411 points * points - 1}},
1414 points * points - points,
1415 points * points - 1}}}},
1416 {{{{points * points * points - points * points,
1417 points * points * points - points * points + points - 1,
1420 {{0, points - 1, 0, points - 1}}}}}}}};
1422 return lines_plane_array[i][j][k][l];
1426 lines(
unsigned int i,
unsigned int j,
unsigned int k,
unsigned int l)
const
1428 static constexpr unsigned int points = fe_degree + 1;
1430 static constexpr ::ndarray<unsigned int, 3, 2, 2, 3> lines_array = {
1431 {{{{{{{points * points - points,
1432 points * points * points - points * points,
1433 points * points * points - points}},
1435 points * points - points,
1436 points * points * points - points}}}},
1438 points * points * points - points * points,
1439 points * points * points - points}},
1441 points * points - points,
1442 points * points * points - points * points}}}}}},
1444 points * points * points - points * points,
1445 points * points * points - points * points + points - 1}},
1448 points * points * points - points * points + points - 1}}}},
1450 points * points * points - points * points,
1451 points * points * points - points * points + points - 1}},
1452 {{0, points - 1, points * points * points - points * points}}}}}},
1453 {{{{{{points - 1, points * points - points, points * points - 1}},
1454 {{0, points - 1, points * points - 1}}}},
1455 {{{{0, points * points - points, points * points - 1}},
1456 {{0, points - 1, points * points - points}}}}}}}};
1458 return lines_array[i][j][k][l];
1463 template <
int dim,
int fe_degree,
typename Number>
1475 template <
unsigned int s
ide,
bool transpose>
1478 const unsigned int given_degree,
1484 static constexpr unsigned int max_n_points_1D = 40;
1487 temp[fe_degree != -1 ? (fe_degree + 1) : max_n_points_1D];
1489 const unsigned int points =
1490 (fe_degree != -1 ? fe_degree : given_degree) + 1;
1494 const unsigned int d = side / 2;
1495 const unsigned int s = side % 2;
1498 const unsigned int stride =
1505 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1506 for (
unsigned int j = 0; j < r2; ++j, ++k)
1508 values[i * offset + stride + j], v);
1512 for (
unsigned int i = 0, k = 0; i < r1; ++i)
1513 for (
unsigned int j = 0; j < r2; ++j, ++k)
1516 for (
unsigned int h = 0; h < points; ++h)
1523 values[i * offset + stride + j], sum, v);
1528 template <
bool transpose>
1531 const unsigned int n_desired_components,
1534 Number::size()> & constraint_mask,
1537 const unsigned int given_degree =
1538 fe_degree != -1 ? fe_degree : shape_info.
data.front().fe_degree;
1540 const auto &interpolation_matrices =
1543 const auto constraint_mask_sorted =
1546 for (
unsigned int c = 0; c < n_desired_components; ++c)
1548 for (
unsigned int v = 0; v < Number::size(); ++v)
1550 const auto mask = constraint_mask_sorted[v];
1560 constraint_mask_sorted,
1565 const bool subcell_x = (
mask >> 0) & 1;
1566 const bool subcell_y = (
mask >> 1) & 1;
1567 const bool face_x = (
mask >> 3) & 1;
1568 const bool face_y = (
mask >> 4) & 1;
1573 const auto *weights =
1574 interpolation_matrices[!subcell_x].data();
1577 interpolate_2D<2, transpose>(given_degree,
1582 interpolate_2D<3, transpose>(given_degree,
1591 const auto *weights =
1592 interpolation_matrices[!subcell_y].data();
1595 interpolate_2D<0, transpose>(given_degree,
1600 interpolate_2D<1, transpose>(given_degree,
1608 const bool type_x = (
mask >> 0) & 1;
1609 const bool type_y = (
mask >> 1) & 1;
1610 const bool type_z = (
mask >> 2) & 1;
1612 const auto flag_0 = (
mask >> 3) & 3;
1613 const auto flag_1 = (
mask >> 5) & 7;
1614 const auto faces = (flag_0 & 0b01) ? flag_1 : 0;
1615 const auto edges = (flag_0 & 0b10) ? flag_1 : 0;
1623 helper(given_degree,
1628 interpolation_matrices,
1638 .template process_faces_fast<true, false, false>();
1642 .template process_faces_fast<false, true, false>();
1645 helper.template process_faces<true, true, false>();
1649 .template process_faces_fast<false, false, true>();
1652 helper.template process_faces<true, false, true>();
1655 helper.template process_faces<false, true, true>();
1658 helper.template process_faces<true, true, true>();
1668 helper.template process_edge<true, false, false>();
1671 helper.template process_edge<false, true, false>();
1674 helper.template process_edge<true, true, false>();
1677 helper.template process_edge<false, false, true>();
1680 helper.template process_edge<true, false, true>();
1683 helper.template process_edge<false, true, true>();
1686 helper.template process_edge<true, true, true>();
1703 template <
int dim,
typename Number>
1707 template <
int fe_degree,
int n_q_po
ints_1d>
1709 run(
const unsigned int n_desired_components,
1713 Number::size()> & c_mask,
1723 RunnerType::template run_internal<true>(n_desired_components,
1728 RunnerType::template run_internal<false>(n_desired_components,
1736 template <
int fe_degree>
1740 return ((Number::size() > 2) && (fe_degree == -1 || fe_degree > 2)) ?
1749#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
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
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)