23#ifndef IPPL_PARTICLE_SPATIAL_LAYOUT_H
24#define IPPL_PARTICLE_SPATIAL_LAYOUT_H
28#include "Types/IpplTypes.h"
30#include "Communicate/Window.h"
31#include "FieldLayout/FieldLayout.h"
32#include "Particle/ParticleBase.h"
33#include "Particle/ParticleLayout.h"
34#include "Region/RegionLayout.h"
44 template <
typename T,
unsigned Dim,
class Mesh = UniformCartesian<T, Dim>,
45 typename... PositionProperties>
49 using typename Base::position_memory_space,
typename Base::position_execution_space;
51 using hash_type = detail::hash_type<position_memory_space>;
52 using locate_type =
typename detail::ViewType<int, 1, position_memory_space>::view_type;
53 using bool_type =
typename detail::ViewType<bool, 1, position_memory_space>::view_type;
55 using vector_type =
typename Base::vector_type;
56 using RegionLayout_t =
57 typename detail::RegionLayout<T, Dim, Mesh, position_memory_space>::uniform_type;
60 using size_type = detail::size_type;
73 template <
class ParticleContainer>
74 void update(ParticleContainer& pc);
76 const RegionLayout_t& getRegionLayout()
const {
return rlayout_m; }
86 std::vector<size_type> nRecvs_m;
98 template <
size_t... Idx>
99 KOKKOS_INLINE_FUNCTION
constexpr static bool positionInRegion(
100 const std::index_sequence<Idx...>&,
const vector_type& pos,
const region_type& region);
123 template <
typename ParticleContainer>
125 locate_type& ranks, bool_type& invalid,
126 locate_type& nSends_dview,
127 locate_type& sends_dview)
const;
134 void fillHash(
int rank,
const locate_type& ranks, hash_type& hash);
144#include "Particle/ParticleSpatialLayout.hpp"
Definition FieldLayout.h:166
Definition ParticleSpatialLayout.h:46
RegionLayout_t rlayout_m
The RegionLayout which determines where our particles go.
Definition ParticleSpatialLayout.h:80
size_t numberOfSends(int rank, const locate_type &ranks)
Definition ParticleSpatialLayout.hpp:455
size_type getNeighborSize(const neighbor_list &neighbors) const
Definition ParticleSpatialLayout.hpp:240
typename region_view_type::value_type region_type
Type of a single Region object.
Definition ParticleSpatialLayout.h:94
void fillHash(int rank, const locate_type &ranks, hash_type &hash)
Definition ParticleSpatialLayout.hpp:432
typename RegionLayout_t::view_type region_view_type
Type of the Kokkos view containing the local regions.
Definition ParticleSpatialLayout.h:92
std::pair< size_type, size_type > locateParticles(const ParticleContainer &pc, locate_type &ranks, bool_type &invalid, locate_type &nSends_dview, locate_type &sends_dview) const
typename FieldLayout_t::neighbor_list neighbor_list
Array of N rank lists, where N = number of hypercubes for the dimension Dim.
Definition ParticleSpatialLayout.h:96
FieldLayout_t & flayout_m
The FieldLayout containing information on nearest neighbors.
Definition ParticleSpatialLayout.h:83
Definition ParticleLayout.h:44