44 #ifndef KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
45 #define KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
50 #include <Kokkos_Core.hpp>
63 struct MapGridUnitCube {
73 const size_t grid_max_y ,
74 const size_t grid_max_z ,
75 const double bubble_x ,
76 const double bubble_y ,
77 const double bubble_z )
86 template<
typename Scalar >
87 KOKKOS_INLINE_FUNCTION
101 coord_x = x + x * x * ( x - 1 ) * ( x - 1 ) *
m_a ;
102 coord_y = y + y * y * ( y - 1 ) * ( y - 1 ) *
m_b ;
103 coord_z = z + z * z * ( z - 1 ) * ( z - 1 ) *
m_c ;
121 template<
class Device ,
123 class CoordinateMap = MapGridUnitCube >
124 class BoxElemFixture {
140 Kokkos::View< double *[SpaceDim] , Device >
m_node_coord ;
159 KOKKOS_INLINE_FUNCTION
162 KOKKOS_INLINE_FUNCTION
165 KOKKOS_INLINE_FUNCTION
168 KOKKOS_INLINE_FUNCTION
171 KOKKOS_INLINE_FUNCTION
174 KOKKOS_INLINE_FUNCTION
178 KOKKOS_INLINE_FUNCTION
182 KOKKOS_INLINE_FUNCTION
190 KOKKOS_INLINE_FUNCTION
194 KOKKOS_INLINE_FUNCTION
198 KOKKOS_INLINE_FUNCTION
209 KOKKOS_INLINE_FUNCTION
220 for (
int i = 0 ; i <
ElemNode ; ++i ) {
239 for (
int i = 0 ; i <
ElemNode ; ++i ) {
249 const size_t global_size ,
250 const size_t global_rank ,
251 const size_t elem_nx ,
252 const size_t elem_ny ,
253 const size_t elem_nz ,
254 const double bubble_x = 1.1 ,
255 const double bubble_y = 1.2 ,
256 const double bubble_z = 1.3 )
257 :
m_box_part( Order , decompose , global_size , global_rank , elem_nx , elem_ny , elem_nz )
274 for (
int i = 0 ; i <
ElemNode ; ++i ) {
289 Kokkos::parallel_for( nwork , *
this );
295 KOKKOS_INLINE_FUNCTION
312 nodeGrid[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
313 nodeGrid[2] = elem_node_scale * elem_grid[2] + m_elem_node_local[inode][2] ;
Kokkos::View< size_t *[SpaceDim], Device > m_node_grid
KOKKOS_INLINE_FUNCTION void uses_elem_coord(size_t lid, unsigned c[]) const
Kokkos::View< const unsigned *[2], Device > comm_list_type
comm_list_type send_node() const
Kokkos::View< size_t *[ElemNode], Device > m_elem_node
KOKKOS_INLINE_FUNCTION size_t elem_node_local(size_t inode, int k) const
Kokkos::View< const size_t *[SpaceDim], Device > node_grid_type
KOKKOS_INLINE_FUNCTION unsigned send_node_count(unsigned msg) const
KOKKOS_INLINE_FUNCTION size_t elem_node(size_t ielem, size_t inode) const
Kokkos::View< const size_t *[2], Device > comm_list_type
KOKKOS_INLINE_FUNCTION unsigned local_node_id(const unsigned c[]) const
KOKKOS_INLINE_FUNCTION void operator()(int grid_x, int grid_y, int grid_z, Scalar &coord_x, Scalar &coord_y, Scalar &coord_z) const
KOKKOS_INLINE_FUNCTION size_t global_node_id(const unsigned c[]) const
KOKKOS_INLINE_FUNCTION size_t global_elem_count() const
Kokkos::View< size_t *[2], Device > m_recv_node
node_coord_type node_coord() const
Kokkos::View< const double *[SpaceDim], Device > node_coord_type
BoxElemFixture & operator=(const BoxElemFixture &rhs)
Kokkos::View< const unsigned *[ElemNode], Device > elem_node_type
unsigned char m_elem_node_local[ElemNode][4]
KOKKOS_INLINE_FUNCTION double node_coord(size_t inode, int iaxis) const
Kokkos::View< unsigned *[2], Device > m_recv_node
Kokkos::View< const unsigned *[SpaceDim], Device > node_grid_type
KOKKOS_INLINE_FUNCTION unsigned send_node_id(unsigned item) const
KOKKOS_INLINE_FUNCTION size_t elem_count_global() const
Kokkos::View< unsigned *[2], Device > m_send_node
KOKKOS_INLINE_FUNCTION size_t node_grid(size_t inode, int iaxis) const
Kokkos::Example::BoxElemPart m_box_part
elem_node_type elem_node() const
KOKKOS_INLINE_FUNCTION size_t node_grid_max(int iaxis) const
KOKKOS_INLINE_FUNCTION void local_node_coord(size_t lid, unsigned coord[]) const
Kokkos::View< const size_t *[ElemNode], Device > elem_node_type
Kokkos::View< const unsigned *, Device > send_nodeid_type
Kokkos::Example::HexElement_TensorData< ElemNode > hex_data
KOKKOS_INLINE_FUNCTION PCE< Storage > max(const typename PCE< Storage >::value_type &a, const PCE< Storage > &b)
BoxElemFixture(const BoxElemPart::Decompose decompose, const size_t global_size, const size_t global_rank, const size_t elem_nx, const size_t elem_ny, const size_t elem_nz, const double bubble_x=1.1, const double bubble_y=1.2, const double bubble_z=1.3)
KOKKOS_INLINE_FUNCTION size_t owns_node_count() const
Kokkos::View< unsigned *[ElemNode], Device > m_elem_node
KOKKOS_INLINE_FUNCTION size_t node_count_owned() const
KOKKOS_INLINE_FUNCTION void operator()(size_t i) const
KOKKOS_INLINE_FUNCTION size_t node_count() const
Kokkos::View< double *[SpaceDim], Device > m_node_coord
node_grid_type node_grid() const
KOKKOS_INLINE_FUNCTION size_t node_count_global() const
send_nodeid_type send_nodeid() const
CoordinateMap m_coord_map
KOKKOS_INLINE_FUNCTION size_t node_global_index(size_t local) const
Kokkos::View< size_t *, Device > m_send_node_id
MapGridUnitCube(const size_t grid_max_x, const size_t grid_max_y, const size_t grid_max_z, const double bubble_x, const double bubble_y, const double bubble_z)
KOKKOS_INLINE_FUNCTION unsigned send_node_rank(unsigned msg) const
Kokkos::View< const size_t *, Device > send_nodeid_type
KOKKOS_INLINE_FUNCTION unsigned recv_node_count(unsigned msg) const
KOKKOS_INLINE_FUNCTION unsigned global_coord_max(unsigned axis) const
KOKKOS_INLINE_FUNCTION unsigned recv_node_rank(unsigned msg) const
Partition a box of hexahedral elements among subdomains.
KOKKOS_INLINE_FUNCTION size_t elem_count() const
comm_list_type recv_node() const
Kokkos::View< size_t *[2], Device > m_send_node
Kokkos::View< unsigned *[SpaceDim], Device > m_node_grid
KOKKOS_INLINE_FUNCTION size_t global_node_count() const
KOKKOS_INLINE_FUNCTION BoxElemFixture(const BoxElemFixture &rhs)
Generate a distributed unstructured finite element mesh from a partitioned NX*NY*NZ box of elements...
Kokkos::View< unsigned *, Device > m_send_node_id