77 const ::internal::MatrixFreeFunctions::ConstraintKinds
79 const unsigned int x_idx,
80 const unsigned int y_idx,
81 const unsigned int z_idx,
82 const ::internal::MatrixFreeFunctions::ConstraintKinds face1_type,
83 const ::internal::MatrixFreeFunctions::ConstraintKinds face2_type,
84 const ::internal::MatrixFreeFunctions::ConstraintKinds face1,
85 const ::internal::MatrixFreeFunctions::ConstraintKinds face2,
86 const ::internal::MatrixFreeFunctions::ConstraintKinds edge)
88 const unsigned int face1_idx = (direction == 0) ? y_idx :
89 (direction == 1) ? z_idx :
91 const unsigned int face2_idx = (direction == 0) ? z_idx :
92 (direction == 1) ? x_idx :
95 const bool on_face1 = ((constraint_mask & face1_type) !=
96 ::internal::MatrixFreeFunctions::
97 ConstraintKinds::unconstrained) ?
99 (face1_idx == fe_degree);
100 const bool on_face2 = ((constraint_mask & face2_type) !=
101 ::internal::MatrixFreeFunctions::
102 ConstraintKinds::unconstrained) ?
104 (face2_idx == fe_degree);
106 (((constraint_mask & face1) != ::internal::MatrixFreeFunctions::
107 ConstraintKinds::unconstrained) &&
109 (((constraint_mask & face2) != ::internal::MatrixFreeFunctions::
110 ConstraintKinds::unconstrained) &&
112 (((constraint_mask & edge) != ::internal::MatrixFreeFunctions::
113 ConstraintKinds::unconstrained) &&
114 on_face1 && on_face2));
126 const Kokkos::TeamPolicy<
127 MemorySpace::Default::kokkos_space::execution_space>::member_type
129 Kokkos::View<Number *, MemorySpace::Default::kokkos_space>
131 const ::internal::MatrixFreeFunctions::ConstraintKinds
135 constexpr unsigned int n_q_points_1d = fe_degree + 1;
136 constexpr unsigned int n_q_points =
Utilities::pow(n_q_points_1d, 2);
140 const bool constrained_face =
152 Number tmp[n_q_points];
153 Kokkos::parallel_for(
154 Kokkos::TeamThreadRange(team_member, n_q_points),
155 [&](
const int &q_point) {
156 const unsigned int x_idx = q_point % n_q_points_1d;
157 const unsigned int y_idx = q_point / n_q_points_1d;
159 const auto this_type =
165 const unsigned int interp_idx = (direction == 0) ? x_idx : y_idx;
171 const bool constrained_dof =
172 is_constrained_dof_2d<fe_degree, direction>(constraint_mask,
176 if (constrained_face && constrained_dof)
178 const bool type = (constraint_mask & this_type) !=
179 ::internal::MatrixFreeFunctions::
180 ConstraintKinds::unconstrained;
184 for (
unsigned int i = 0; i <= fe_degree; ++i)
186 const unsigned int real_idx =
187 (direction == 0) ? index2<n_q_points_1d>(i, y_idx) :
188 index2<n_q_points_1d>(x_idx, i);
192 constraint_weights[i * n_q_points_1d + interp_idx] :
193 constraint_weights[interp_idx * n_q_points_1d + i];
194 tmp[q_point] += w * values[real_idx];
199 for (
unsigned int i = 0; i <= fe_degree; ++i)
201 const unsigned int real_idx =
202 (direction == 0) ? index2<n_q_points_1d>(i, y_idx) :
203 index2<n_q_points_1d>(x_idx, i);
207 constraint_weights[(fe_degree - i) * n_q_points_1d +
208 fe_degree - interp_idx] :
209 constraint_weights[(fe_degree - interp_idx) *
212 tmp[q_point] += w * values[real_idx];
220 team_member.team_barrier();
221 Kokkos::parallel_for(Kokkos::TeamThreadRange(team_member, n_q_points),
222 [&](
const int &q_point) {
223 const unsigned int x_idx = q_point % n_q_points_1d;
224 const unsigned int y_idx = q_point / n_q_points_1d;
225 const bool constrained_dof =
226 is_constrained_dof_2d<fe_degree, direction>(
227 constraint_mask, x_idx, y_idx);
228 if (constrained_face && constrained_dof)
229 values[index2<fe_degree + 1>(x_idx, y_idx)] =
233 team_member.team_barrier();
245 const Kokkos::TeamPolicy<
246 MemorySpace::Default::kokkos_space::execution_space>::member_type
248 Kokkos::View<Number *, MemorySpace::Default::kokkos_space>
250 const ::internal::MatrixFreeFunctions::ConstraintKinds
254 constexpr unsigned int n_q_points_1d = fe_degree + 1;
255 constexpr unsigned int n_q_points =
Utilities::pow(n_q_points_1d, 3);
257 const auto this_type =
263 const auto face1_type =
269 const auto face2_type =
296 const auto constrained_face = constraint_mask & (face1 | face2 | edge);
298 Number tmp[n_q_points];
299 Kokkos::parallel_for(
300 Kokkos::TeamThreadRange(team_member, n_q_points),
301 [&](
const int &q_point) {
302 const unsigned int x_idx = q_point % n_q_points_1d;
303 const unsigned int y_idx = (q_point / n_q_points_1d) % n_q_points_1d;
304 const unsigned int z_idx = q_point / (n_q_points_1d * n_q_points_1d);
306 const unsigned int interp_idx = (direction == 0) ? x_idx :
307 (direction == 1) ? y_idx :
309 const bool constrained_dof =
310 is_constrained_dof_3d<fe_degree, direction>(constraint_mask,
320 if ((constrained_face != ::internal::MatrixFreeFunctions::
321 ConstraintKinds::unconstrained) &&
324 const bool type = (constraint_mask & this_type) !=
325 ::internal::MatrixFreeFunctions::
326 ConstraintKinds::unconstrained;
329 for (
unsigned int i = 0; i <= fe_degree; ++i)
331 const unsigned int real_idx =
333 index3<fe_degree + 1>(i, y_idx, z_idx) :
335 index3<fe_degree + 1>(x_idx, i, z_idx) :
336 index3<fe_degree + 1>(x_idx, y_idx, i);
340 constraint_weights[i * n_q_points_1d + interp_idx] :
341 constraint_weights[interp_idx * n_q_points_1d + i];
342 tmp[q_point] += w * values[real_idx];
347 for (
unsigned int i = 0; i <= fe_degree; ++i)
349 const unsigned int real_idx =
351 index3<n_q_points_1d>(i, y_idx, z_idx) :
353 index3<n_q_points_1d>(x_idx, i, z_idx) :
354 index3<n_q_points_1d>(x_idx, y_idx, i);
358 constraint_weights[(fe_degree - i) * n_q_points_1d +
359 fe_degree - interp_idx] :
360 constraint_weights[(fe_degree - interp_idx) *
363 tmp[q_point] += w * values[real_idx];
371 team_member.team_barrier();
373 Kokkos::parallel_for(
374 Kokkos::TeamThreadRange(team_member, n_q_points),
375 [&](
const int &q_point) {
376 const unsigned int x_idx = q_point % n_q_points_1d;
377 const unsigned int y_idx = (q_point / n_q_points_1d) % n_q_points_1d;
378 const unsigned int z_idx = q_point / (n_q_points_1d * n_q_points_1d);
379 const bool constrained_dof =
380 is_constrained_dof_3d<fe_degree, direction>(constraint_mask,
389 if ((constrained_face != ::internal::MatrixFreeFunctions::
390 ConstraintKinds::unconstrained) &&
392 values[index3<fe_degree + 1>(x_idx, y_idx, z_idx)] = tmp[q_point];
395 team_member.team_barrier();
414 const Kokkos::TeamPolicy<
415 MemorySpace::Default::kokkos_space::execution_space>::member_type
417 Kokkos::View<Number *, MemorySpace::Default::kokkos_space>
419 const ::internal::MatrixFreeFunctions::ConstraintKinds
423 if constexpr (dim == 2)
425 interpolate_boundary_2d<fe_degree, 0, transpose>(team_member,
430 interpolate_boundary_2d<fe_degree, 1, transpose>(team_member,
435 else if constexpr (dim == 3)
438 interpolate_boundary_3d<fe_degree, 0, transpose>(team_member,
443 interpolate_boundary_3d<fe_degree, 1, transpose>(team_member,
448 interpolate_boundary_3d<fe_degree, 2, transpose>(team_member,