44 #ifndef KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
45 #define KOKKOS_EXAMPLE_BOXELEMFIXTURE_HPP
50 #include <Kokkos_Core.hpp>
73 const unsigned grid_max_y ,
74 const unsigned grid_max_z ,
75 const double bubble_x ,
76 const double bubble_y ,
77 const double bubble_z )
86 template<
typename Scalar >
93 Scalar & coord_z )
const
97 const double x = double(grid_x) / double(
m_max_x);
98 const double y = double(grid_y) / double(
m_max_y);
99 const double z = double(grid_z) / double(
m_max_z);
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 >
177 unsigned node_grid(
unsigned inode ,
unsigned iaxis )
const
197 unsigned elem_node(
unsigned ielem ,
unsigned inode )
const
218 for (
unsigned i = 0 ; i <
ElemNode ; ++i ) {
237 for (
unsigned i = 0 ; i <
ElemNode ; ++i ) {
247 const unsigned global_size ,
248 const unsigned global_rank ,
249 const unsigned elem_nx ,
250 const unsigned elem_ny ,
251 const unsigned elem_nz ,
252 const double bubble_x = 1.1 ,
253 const double bubble_y = 1.2 ,
254 const double bubble_z = 1.3 )
255 :
m_box_part( Order , decompose , global_size , global_rank , elem_nx , elem_ny , elem_nz )
272 for (
unsigned i = 0 ; i <
ElemNode ; ++i ) {
287 Kokkos::parallel_for( nwork , *
this );
310 node_grid[1] = elem_node_scale * elem_grid[1] + m_elem_node_local[inode][1] ;
311 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
#define KOKKOS_INLINE_FUNCTION
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...