17 #ifndef KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
18 #define KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
23 #include <Kokkos_Core.hpp>
46 const unsigned grid_max_y ,
47 const unsigned 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
66 Scalar & coord_z )
const
70 const double x = double(grid_x) / double(
m_max_x);
71 const double y = double(grid_y) / double(
m_max_y);
72 const double z = double(grid_z) / double(
m_max_z);
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 >
130 KOKKOS_INLINE_FUNCTION
133 KOKKOS_INLINE_FUNCTION
136 KOKKOS_INLINE_FUNCTION
139 KOKKOS_INLINE_FUNCTION
142 KOKKOS_INLINE_FUNCTION
145 KOKKOS_INLINE_FUNCTION
149 KOKKOS_INLINE_FUNCTION
150 unsigned node_grid(
unsigned inode ,
unsigned iaxis )
const
153 KOKKOS_INLINE_FUNCTION
161 KOKKOS_INLINE_FUNCTION
165 KOKKOS_INLINE_FUNCTION
169 KOKKOS_INLINE_FUNCTION
170 unsigned elem_node(
unsigned ielem ,
unsigned inode )
const
180 KOKKOS_INLINE_FUNCTION
220 const unsigned global_size ,
221 const unsigned global_rank ,
222 const unsigned elem_nx ,
223 const unsigned elem_ny ,
224 const unsigned elem_nz ,
225 const double bubble_x = 1.1 ,
226 const double bubble_y = 1.2 ,
227 const double bubble_z = 1.3 )
228 :
m_box_part( Order , decompose , global_size , global_rank , elem_nx , elem_ny , elem_nz )
260 Kokkos::parallel_for( nwork , *
this );
266 KOKKOS_INLINE_FUNCTION
283 node_grid[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
284 node_grid[2] = elem_node_scale * elem_grid[2] + m_elem_node_local[inode][2] ;
KOKKOS_INLINE_FUNCTION unsigned elem_node_local(unsigned inode, unsigned k) const
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_INLINE_FUNCTION unsigned send_node_count(unsigned msg) const
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
node_coord_type node_coord() const
Kokkos::View< unsigned *, Device > m_send_node_id
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]
Map a grid onto a unit cube with smooth nonlinear grading of the map.
Kokkos::View< unsigned *[2], Device > m_send_node
Kokkos::View< const unsigned *[SpaceDim], Device > node_grid_type
KOKKOS_INLINE_FUNCTION unsigned node_count_global() const
KOKKOS_INLINE_FUNCTION unsigned send_node_id(unsigned item) const
KOKKOS_INLINE_FUNCTION unsigned node_count_owned() const
Kokkos::View< unsigned *[ElemNode], Device > m_elem_node
KOKKOS_INLINE_FUNCTION unsigned elem_count() const
Kokkos::Example::BoxElemPart m_box_part
elem_node_type elem_node() const
Kokkos::View< unsigned *[2], Device > m_recv_node
KOKKOS_INLINE_FUNCTION void local_node_coord(size_t lid, unsigned coord[]) const
Kokkos::View< const unsigned *, Device > send_nodeid_type
KOKKOS_INLINE_FUNCTION unsigned elem_node(unsigned ielem, unsigned inode) const
Kokkos::Example::HexElement_TensorData< ElemNode > hex_data
KOKKOS_INLINE_FUNCTION unsigned node_count() const
KOKKOS_INLINE_FUNCTION unsigned node_grid_max(unsigned iaxis) const
KOKKOS_INLINE_FUNCTION size_t owns_node_count() const
KOKKOS_INLINE_FUNCTION void operator()(size_t i) const
KOKKOS_INLINE_FUNCTION double node_coord(unsigned inode, unsigned iaxis) const
Kokkos::View< double *[SpaceDim], Device > m_node_coord
node_grid_type node_grid() const
KOKKOS_INLINE_FUNCTION unsigned elem_count_global() const
KOKKOS_INLINE_FUNCTION size_t node_global_index(unsigned local) const
Kokkos::View< unsigned *[SpaceDim], Device > m_node_grid
send_nodeid_type send_nodeid() const
CoordinateMap m_coord_map
BoxElemFixture(const BoxElemPart::Decompose decompose, const unsigned global_size, const unsigned global_rank, const unsigned elem_nx, const unsigned elem_ny, const unsigned elem_nz, const double bubble_x=1.1, const double bubble_y=1.2, const double bubble_z=1.3)
MapGridUnitCube(const unsigned grid_max_x, const unsigned grid_max_y, const unsigned 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_INLINE_FUNCTION unsigned node_grid(unsigned inode, unsigned iaxis) const
SimpleFad< ValueT > max(const SimpleFad< ValueT > &a, const SimpleFad< ValueT > &b)
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.
comm_list_type recv_node() const
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...