1 #ifndef GRID_NODE_TR_MAPPING_HPP
2 #define GRID_NODE_TR_MAPPING_HPP
7 Kokkos::parallel_for(
"num_t_node_calc", Kokkos::RangePolicy<typename Device::execution_space>( 0,grid.
ntriangle ), KOKKOS_LAMBDA(
const int j){
8 for(
int k=0; k<3; k++){
10 Kokkos::atomic_add(&(num_t_node(ind)), 1);
16 Kokkos::parallel_reduce(
"max_num_t_node", Kokkos::RangePolicy<typename Device::execution_space>( 0,grid.
nnode ), KOKKOS_LAMBDA(
const int i_node,
int& maxnum_l){
17 maxnum_l = max(maxnum_l, num_t_node(i_node));
18 }, Kokkos::Max<int,HostType>(maxnum));
21 tr_node = View<int**,CLayout,Device>(
"tr_node",maxnum,grid.
nnode);
22 Kokkos::deep_copy(num_t_node, 0);
26 for(
int k=0; k<3; k++){
29 int local_place = Kokkos::atomic_fetch_add(&(num_t_node(ind)),1);
30 tr_node(local_place,ind)=j;
int ntriangle
Number of grid triangles.
Definition: grid.hpp:245
void grid_node_tr_mapping(const Grid< Device > &grid, View< int *, CLayout, Device > &num_t_node, View< int **, CLayout, Device > &tr_node)
Definition: grid_node_tr_mapping.hpp:5
KOKKOS_INLINE_FUNCTION int get_node_index(int triangle_index, int tri_vertex_index) const
Definition: grid.tpp:792
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252
int nnode
Number of grid nodes.
Definition: grid.hpp:246