25template < std::
floating_po
int T >
29 const int local_subdomain_id,
37 for (
int x = x_cell; x <= x_cell + 1; x++ )
39 for (
int y = y_cell; y <= y_cell + 1; y++ )
41 for (
int d = 0; d < 3; d++ )
43 quad_surface_coords[x - x_cell][y - y_cell]( d ) = lateral_grid( local_subdomain_id, x, y, d );
49 wedge_surf_phy_coords[0][0] = quad_surface_coords[0][0];
50 wedge_surf_phy_coords[0][1] = quad_surface_coords[1][0];
51 wedge_surf_phy_coords[0][2] = quad_surface_coords[0][1];
53 wedge_surf_phy_coords[1][0] = quad_surface_coords[1][1];
54 wedge_surf_phy_coords[1][1] = quad_surface_coords[0][1];
55 wedge_surf_phy_coords[1][2] = quad_surface_coords[1][0];
58template < std::
floating_po
int T >
62 const int local_subdomain_id,
70 for (
int x = x_cell; x <= x_cell + 1; x++ )
72 for (
int y = y_cell; y <= y_cell + 1; y++ )
74 for (
int d = 0; d < 3; d++ )
76 quad_surface_coords[x - x_cell][y - y_cell]( d ) = lateral_grid( local_subdomain_id, x, y, d );
82 wedge_surf_phy_coords[0] = quad_surface_coords[0][0];
83 wedge_surf_phy_coords[1] = quad_surface_coords[1][0];
84 wedge_surf_phy_coords[2] = quad_surface_coords[0][1];
87template < std::
floating_po
int T >
91 const int local_subdomain_id,
99 for (
int x = x_cell; x <= x_cell + 1; x++ )
101 for (
int y = y_cell; y <= y_cell + 1; y++ )
103 for (
int d = 0; d < 3; d++ )
105 quad_surface_coords[x - x_cell][y - y_cell]( d ) = lateral_grid( local_subdomain_id, x, y, d );
111 wedge_surf_phy_coords[0] = quad_surface_coords[1][1];
112 wedge_surf_phy_coords[1] = quad_surface_coords[0][1];
113 wedge_surf_phy_coords[2] = quad_surface_coords[1][0];
125template < std::
floating_po
int T,
int NumQuadPo
ints >
134 for (
int q = 0; q < NumQuadPoints; q++ )
137 wedge_surf_phy_coords[wedge][0],
138 wedge_surf_phy_coords[wedge][1],
139 wedge_surf_phy_coords[wedge][2],
141 quad_points[q]( 1 ) );
143 det_jac_lat[wedge][q] = Kokkos::abs(
jac_lat.det() );
145 jac_lat_inv_t[wedge][q] =
jac_lat.inv().transposed();
157template < std::
floating_po
int T,
int NumQuadPo
ints >
165 for (
int q = 0; q < NumQuadPoints; q++ )
168 wedge_surf_phy_coords[wedge][0],
169 wedge_surf_phy_coords[wedge][1],
170 wedge_surf_phy_coords[wedge][2],
172 quad_points[q]( 1 ) );
174 det_jac_lat[wedge][q] = Kokkos::abs(
jac_lat.det() );
207template < std::
floating_po
int T,
int NumQuadPo
ints >
218 for (
int q = 0; q < NumQuadPoints; q++ )
220 g_rad[wedge][node_idx][q] =
221 jac_lat_inv_t[wedge][q] *
223 grad_shape_lat_xi< T >( node_idx ) *
shape_rad( node_idx, quad_points[q]( 2 ) ),
224 grad_shape_lat_eta< T >( node_idx ) *
shape_rad( node_idx, quad_points[q]( 2 ) ),
227 g_lat[wedge][node_idx][q] =
228 jac_lat_inv_t[wedge][q] *
246template < std::
floating_po
int T,
int NumQuadPo
ints >
254 const int quad_point_idx )
256 return r_inv * g_rad[wedge_idx][node_idx][quad_point_idx] +
257 grad_shape_rad< T >( node_idx ) * grad_r_inv * g_lat[wedge_idx][node_idx][quad_point_idx];
269template < std::
floating_po
int T,
int NumQuadPo
ints >
275 const int quad_point_idx )
277 return r * r * grad_r * det_jac_lat[wedge_idx][quad_point_idx];
305template < std::
floating_po
int T >
308 const int local_subdomain_id,
314 local_coefficients[0]( 0 ) = global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell );
315 local_coefficients[0]( 1 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell );
316 local_coefficients[0]( 2 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell );
317 local_coefficients[0]( 3 ) = global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell + 1 );
318 local_coefficients[0]( 4 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1 );
319 local_coefficients[0]( 5 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1 );
321 local_coefficients[1]( 0 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell );
322 local_coefficients[1]( 1 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell );
323 local_coefficients[1]( 2 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell );
324 local_coefficients[1]( 3 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell + 1 );
325 local_coefficients[1]( 4 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1 );
326 local_coefficients[1]( 5 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1 );
355template < std::
floating_po
int T,
int VecDim >
358 const int local_subdomain_id,
365 local_coefficients[0]( 0 ) = global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell, d );
366 local_coefficients[0]( 1 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell, d );
367 local_coefficients[0]( 2 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell, d );
368 local_coefficients[0]( 3 ) = global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell + 1, d );
369 local_coefficients[0]( 4 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1, d );
370 local_coefficients[0]( 5 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1, d );
372 local_coefficients[1]( 0 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell, d );
373 local_coefficients[1]( 1 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell, d );
374 local_coefficients[1]( 2 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell, d );
375 local_coefficients[1]( 3 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell + 1, d );
376 local_coefficients[1]( 4 ) = global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1, d );
377 local_coefficients[1]( 5 ) = global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1, d );
406template < std::
floating_po
int T >
409 const int local_subdomain_id,
416 &global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell ), local_coefficients[0]( 0 ) );
418 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell ),
419 local_coefficients[0]( 1 ) + local_coefficients[1]( 2 ) );
421 &global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell ),
422 local_coefficients[0]( 2 ) + local_coefficients[1]( 1 ) );
424 &global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell + 1 ), local_coefficients[0]( 3 ) );
426 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1 ),
427 local_coefficients[0]( 4 ) + local_coefficients[1]( 5 ) );
429 &global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1 ),
430 local_coefficients[0]( 5 ) + local_coefficients[1]( 4 ) );
432 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell ), local_coefficients[1]( 0 ) );
434 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell + 1 ), local_coefficients[1]( 3 ) );
464template < std::
floating_po
int T,
int VecDim >
467 const int local_subdomain_id,
475 &global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell, d ), local_coefficients[0]( 0 ) );
477 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell, d ),
478 local_coefficients[0]( 1 ) + local_coefficients[1]( 2 ) );
480 &global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell, d ),
481 local_coefficients[0]( 2 ) + local_coefficients[1]( 1 ) );
483 &global_coefficients( local_subdomain_id, x_cell, y_cell, r_cell + 1, d ), local_coefficients[0]( 3 ) );
485 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell, r_cell + 1, d ),
486 local_coefficients[0]( 4 ) + local_coefficients[1]( 5 ) );
488 &global_coefficients( local_subdomain_id, x_cell, y_cell + 1, r_cell + 1, d ),
489 local_coefficients[0]( 5 ) + local_coefficients[1]( 4 ) );
491 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell, d ), local_coefficients[1]( 0 ) );
493 &global_coefficients( local_subdomain_id, x_cell + 1, y_cell + 1, r_cell + 1, d ), local_coefficients[1]( 3 ) );
600KOKKOS_INLINE_FUNCTION
604 constexpr int indices[2][2][2] = { { { 0, 1 }, { 2, 3 } }, { { 3, 2 }, { 1, 0 } } };
605 const int x_mod = x_cell_fine % 2;
606 const int y_mod = y_cell_fine % 2;
607 return indices[wedge_idx_fine][y_mod][x_mod];
617template <
typename ScalarT > KOKKOS_INLINE_FUNCTION
621 if ( doo_from == doo_to )
629 for (
int dim = 0; dim < 3; ++dim )
639 for (
int dim = 0; dim < 3; ++dim )
648 for (
int i = 0; i < 18; ++i) {
649 dofs(i) = tmp_dofs(i);
Features for wedge elements.
constexpr int num_nodes_per_wedge_surface
Definition kernel_helpers.hpp:6
void atomically_add_local_wedge_scalar_coefficients(const grid::Grid4DDataScalar< T > &global_coefficients, const int local_subdomain_id, const int x_cell, const int y_cell, const int r_cell, const dense::Vec< T, 6 >(&local_coefficients)[2])
Performs an atomic add of the two local wedge coefficient vectors of a hex cell into the global coeff...
Definition kernel_helpers.hpp:407
constexpr void lateral_parts_of_grad_phi(dense::Vec< T, 3 >(&g_rad)[num_wedges_per_hex_cell][num_nodes_per_wedge][NumQuadPoints], dense::Vec< T, 3 >(&g_lat)[num_wedges_per_hex_cell][num_nodes_per_wedge][NumQuadPoints], const dense::Mat< T, 3, 3 > jac_lat_inv_t[num_wedges_per_hex_cell][NumQuadPoints], const dense::Vec< T, 3 > quad_points[NumQuadPoints])
Computes the radially independent parts of the physical shape function gradients.
Definition kernel_helpers.hpp:208
constexpr int fine_lateral_wedge_idx(const int x_cell_fine, const int y_cell_fine, const int wedge_idx_fine)
Returns the lateral wedge index with respect to a coarse grid wedge from the fine wedge indices.
Definition kernel_helpers.hpp:601
constexpr dense::Vec< T, 3 > grad_shape_full(const dense::Vec< T, 3 > g_rad[num_wedges_per_hex_cell][num_nodes_per_wedge][NumQuadPoints], const dense::Vec< T, 3 > g_lat[num_wedges_per_hex_cell][num_nodes_per_wedge][NumQuadPoints], const T r_inv, const T grad_r_inv, const int wedge_idx, const int node_idx, const int quad_point_idx)
Computes and returns J^-T grad(N_j).
Definition kernel_helpers.hpp:247
constexpr T det_full(const T det_jac_lat[num_wedges_per_hex_cell][NumQuadPoints], const T r, const T grad_r, const int wedge_idx, const int quad_point_idx)
Computes |det(J)|.
Definition kernel_helpers.hpp:270
constexpr T shape_rad(const int node_idx, const T zeta)
Radial shape function.
Definition integrands.hpp:86
void wedge_0_surface_physical_coords(dense::Vec< T, 3 > *wedge_surf_phy_coords, const grid::Grid3DDataVec< T, 3 > &lateral_grid, const int local_subdomain_id, const int x_cell, const int y_cell)
Definition kernel_helpers.hpp:59
constexpr void jacobian_lat_inverse_transposed_and_determinant(dense::Mat< T, 3, 3 >(&jac_lat_inv_t)[num_wedges_per_hex_cell][NumQuadPoints], T(&det_jac_lat)[num_wedges_per_hex_cell][NumQuadPoints], const dense::Vec< T, 3 > wedge_surf_phy_coords[num_wedges_per_hex_cell][num_nodes_per_wedge_surface], const dense::Vec< T, 3 > quad_points[NumQuadPoints])
Computes the transposed inverse of the Jacobian of the lateral forward map from the reference triangl...
Definition kernel_helpers.hpp:126
DoFOrdering
Definition kernel_helpers.hpp:611
void wedge_surface_physical_coords(dense::Vec< T, 3 >(&wedge_surf_phy_coords)[num_wedges_per_hex_cell][num_nodes_per_wedge_surface], const grid::Grid3DDataVec< T, 3 > &lateral_grid, const int local_subdomain_id, const int x_cell, const int y_cell)
Extracts the (unit sphere) surface vertex coords of the two wedges of a hex cell.
Definition kernel_helpers.hpp:26
constexpr void reorder_local_dofs(const DoFOrdering doo_from, const DoFOrdering doo_to, dense::Vec< ScalarT, 18 > &dofs)
Definition kernel_helpers.hpp:619
constexpr T shape_lat(const int node_idx, const T xi, const T eta)
Lateral shape function.
Definition integrands.hpp:118
void atomically_add_local_wedge_vector_coefficients(const grid::Grid4DDataVec< T, VecDim > &global_coefficients, const int local_subdomain_id, const int x_cell, const int y_cell, const int r_cell, const int d, const dense::Vec< T, 6 > local_coefficients[2])
Performs an atomic add of the two local wedge coefficient vectors of a hex cell into the global coeff...
Definition kernel_helpers.hpp:465
constexpr int num_wedges_per_hex_cell
Definition kernel_helpers.hpp:5
void extract_local_wedge_scalar_coefficients(dense::Vec< T, 6 >(&local_coefficients)[2], const int local_subdomain_id, const int x_cell, const int y_cell, const int r_cell, const grid::Grid4DDataScalar< T > &global_coefficients)
Extracts the local vector coefficients for the two wedges of a hex cell from the global coefficient v...
Definition kernel_helpers.hpp:306
void extract_local_wedge_vector_coefficients(dense::Vec< T, 6 >(&local_coefficients)[2], const int local_subdomain_id, const int x_cell, const int y_cell, const int r_cell, const int d, const grid::Grid4DDataVec< T, VecDim > &global_coefficients)
Extracts the local vector coefficients for the two wedges of a hex cell from the global coefficient v...
Definition kernel_helpers.hpp:356
constexpr int num_nodes_per_wedge
Definition kernel_helpers.hpp:7
constexpr dense::Mat< T, 3, 3 > jac_lat(const dense::Vec< T, 3 > &p1_phy, const dense::Vec< T, 3 > &p2_phy, const dense::Vec< T, 3 > &p3_phy, const T xi, const T eta)
Definition integrands.hpp:620
constexpr void jacobian_lat_determinant(T(&det_jac_lat)[num_wedges_per_hex_cell][NumQuadPoints], const dense::Vec< T, 3 > wedge_surf_phy_coords[num_wedges_per_hex_cell][num_nodes_per_wedge_surface], const dense::Vec< T, 3 > quad_points[NumQuadPoints])
Like jacobian_lat_inverse_transposed_and_determinant() but only computes the determinant (cheaper if ...
Definition kernel_helpers.hpp:158
void wedge_1_surface_physical_coords(dense::Vec< T, 3 > *wedge_surf_phy_coords, const grid::Grid3DDataVec< T, 3 > &lateral_grid, const int local_subdomain_id, const int x_cell, const int y_cell)
Definition kernel_helpers.hpp:88
Kokkos::View< ScalarType ***[VecDim], Layout > Grid3DDataVec
Definition grid_types.hpp:40
Kokkos::View< ScalarType ****[VecDim], Layout > Grid4DDataVec
Definition grid_types.hpp:43
Kokkos::View< ScalarType ****, Layout > Grid4DDataScalar
Definition grid_types.hpp:25