17 #ifndef KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
18 #define KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
23 #include <Kokkos_Core.hpp>
36 struct MapGridUnitCube {
46 const size_t grid_max_y ,
47 const size_t grid_max_z ,
48 const double bubble_x ,
49 const double bubble_y ,
50 const double bubble_z )
59 template<
typename Scalar >
60 KOKKOS_INLINE_FUNCTION
74 coord_x = x + x * x * ( x - 1 ) * ( x - 1 ) *
m_a ;
75 coord_y = y + y * y * ( y - 1 ) * ( y - 1 ) *
m_b ;
76 coord_z = z + z * z * ( z - 1 ) * ( z - 1 ) *
m_c ;
94 template<
class Device ,
96 class CoordinateMap = MapGridUnitCube >
97 class BoxElemFixture {
113 Kokkos::View< double *[SpaceDim] , Device >
m_node_coord ;
132 KOKKOS_INLINE_FUNCTION
135 KOKKOS_INLINE_FUNCTION
138 KOKKOS_INLINE_FUNCTION
141 KOKKOS_INLINE_FUNCTION
144 KOKKOS_INLINE_FUNCTION
147 KOKKOS_INLINE_FUNCTION
151 KOKKOS_INLINE_FUNCTION
155 KOKKOS_INLINE_FUNCTION
163 KOKKOS_INLINE_FUNCTION
167 KOKKOS_INLINE_FUNCTION
171 KOKKOS_INLINE_FUNCTION
182 KOKKOS_INLINE_FUNCTION
193 for (
int i = 0 ; i <
ElemNode ; ++i ) {
212 for (
int i = 0 ; i <
ElemNode ; ++i ) {
222 const size_t global_size ,
223 const size_t global_rank ,
224 const size_t elem_nx ,
225 const size_t elem_ny ,
226 const size_t elem_nz ,
227 const double bubble_x = 1.1 ,
228 const double bubble_y = 1.2 ,
229 const double bubble_z = 1.3 )
230 :
m_box_part( Order , decompose , global_size , global_rank , elem_nx , elem_ny , elem_nz )
247 for (
int i = 0 ; i <
ElemNode ; ++i ) {
262 Kokkos::parallel_for( nwork , *
this );
268 KOKKOS_INLINE_FUNCTION
285 nodeGrid[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
286 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