IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties > Class Template Reference

#include <ParticleSpatialOverlapLayout.h>

+ Inheritance diagram for ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >:
+ Collaboration diagram for ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >:

Classes

class  ParticleNeighborData
 

Public Types

using Base = ParticleSpatialLayout< T, Dim, Mesh, PositionProperties... >
 
using size_type = detail::size_type
 
using index_t = typename hash_type::value_type
 
using particle_neighbor_list_type = hash_type
 
using neighbor_list = typename FieldLayout_t::neighbor_list
 Array of N rank lists, where N = number of hypercubes for the dimension Dim.
 
using locate_type_nd = Kokkos::View< index_t *[1<< Dim], position_memory_space >
 
using bool_type = typename detail::ViewType< bool, 1, position_memory_space >::view_type
 
using hash_type = detail::hash_type< position_memory_space >
 
using locate_type = typename detail::ViewType< int, 1, position_memory_space >::view_type
 
using FieldLayout_t = typename ippl::FieldLayout< Dim >
 
using RegionLayout_t = typename detail::RegionLayout< T, Dim, Mesh, position_memory_space >::uniform_type
 
using vector_type = typename Base::vector_type
 
using region_view_type = typename RegionLayout_t::view_type
 Type of the Kokkos view containing the local regions.
 
using region_type = typename region_view_type::value_type
 Type of a single Region object.
 
- Public Types inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
using Base = detail::ParticleLayout< T, Dim, PositionProperties... >
 
using hash_type = detail::hash_type< position_memory_space >
 
using locate_type = typename detail::ViewType< int, 1, position_memory_space >::view_type
 
using bool_type = typename detail::ViewType< bool, 1, position_memory_space >::view_type
 
using vector_type = typename Base::vector_type
 
using RegionLayout_t = typename detail::RegionLayout< T, Dim, Mesh, position_memory_space >::uniform_type
 
using FieldLayout_t = typename ippl::FieldLayout< Dim >
 
using size_type = detail::size_type
 
- Public Types inherited from ippl::detail::ParticleLayout< T, Dim, PositionProperties... >
typedef T value_type
 
typedef std::int64_t index_type
 
typedef Vector< T, Dim > vector_type
 
using particle_position_type = ParticleAttrib< vector_type, PositionProperties... >
 
using position_memory_space = typename particle_position_type::memory_space
 
using position_execution_space = typename particle_position_type::execution_space
 
typedef std::array< BC, 2 *Dim > bc_container_type
 

Public Member Functions

 ParticleSpatialOverlapLayout (FieldLayout< Dim > &fl, Mesh &mesh, const T &rcutoff)
 
void updateLayout (FieldLayout< Dim > &, Mesh &)
 
template<class ParticleContainer >
void update (ParticleContainer &pc)
 updates particles by exchanging them across ranks according to their positions. then constructs the particle neighbor list structure
 
template<typename ExecutionSpace , typename Functor >
void forEachPair (Functor &&f) const
 call functor for each combination i, j. make sure to call update first
 
ParticleNeighborData getParticleNeighborData () const
 
size_type numberOfSends (int rank, const locate_type &ranks)
 utility function to compute how many particles to sent to a given rank
 
void fillHash (int rank, const locate_type &ranks, const locate_type &offsets, hash_type &hash)
 utility function to collect all indices of particles to send to given rank
 
template<typename ParticleContainer >
std::pair< detail::size_type, detail::size_type > locateParticles (const ParticleContainer &pc, locate_type &ranks, locate_type &rankOffsets, bool_type &invalid, locate_type &nSends_dview, locate_type &sends_dview) const
 This function determines to which rank particles need to be sent after the iteration step. It starts by first scanning direct rank neighbors, and only does a global scan if particles are far away from the current rank. It then calculates how many particles need to be sent to each rank and how many ranks are sent to in total.
 
locate_type getFlatNeighbors (const neighbor_list &neighbors) const
 utility function to get a flat view of all neighbor processes
 
locate_type getNonNeighborRanks (const locate_type &neighbors_view) const
 utility function to get a view of all non-neighboring ranks
 
void initializeCells ()
 initializes all data necessary for the cells
 
template<class ParticleContainer >
void particleExchange (ParticleContainer &pc)
 exchange particles by scanning neighbor ranks first, only scan other ranks if needed. assumes overlap is smaller than half the smallest region width.
 
template<class ParticleContainer >
void buildCells (ParticleContainer &pc)
 builds the cell structure, sorts the particles according to the cells and makes sure only local particles are counted towards pc.getLocalNum()
 
template<class ParticleContainer >
void createPeriodicGhostParticles (ParticleContainer &pc)
 copies particles close to the boundary and offsets them to their closest periodic image
 
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION constexpr bool isCloseToBoundary (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &globalRegion, Kokkos::Array< bool, Dim > periodic, T overlap)
 
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION constexpr bool positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &region, T overlap)
 
template<std::size_t... Idx>
constexpr bool isLocalCellIndex (const std::index_sequence< Idx... > &, const CellIndex_t &index, const Vector< size_type, Dim > &numCells)
 
- Public Member Functions inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
 ParticleSpatialLayout (FieldLayout< Dim > &, Mesh &, bool fem=false)
 
void updateLayout (FieldLayout< Dim > &, Mesh &)
 
template<class ParticleContainer >
void update (ParticleContainer &pc)
 
const RegionLayout_t & getRegionLayout () const
 
template<typename ParticleContainer >
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
 
void fillHash (int rank, const locate_type &ranks, hash_type &hash)
 
size_t numberOfSends (int rank, const locate_type &ranks)
 
template<size_t... Idx>
KOKKOS_INLINE_FUNCTION constexpr bool positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &region)
 
template<typename ParticleContainer >
std::pair< detail::size_type, detail::size_type > locateParticles (const ParticleContainer &pc, locate_type &ranks, bool_type &invalid, locate_type &nSends_dview, locate_type &sends_dview) const
 This function determines to which rank particles need to be sent after the iteration step. It starts by first scanning direct rank neighbors, and only does a global scan if there are still unfound particles. It then calculates how many particles need to be sent to each rank and how many ranks are sent to in total.
 
- Public Member Functions inherited from ippl::detail::ParticleLayout< T, Dim, PositionProperties... >
void update (PBase &)
 
void setParticleBC (bc_container_type bcs)
 
void setParticleBC (BC bc)
 
const bc_container_type & getParticleBC () const
 
void applyBC (const particle_position_type &R, const NDRegion< T, Dim > &nr)
 

Static Public Member Functions

static KOKKOS_FUNCTION particle_neighbor_list_type getParticleNeighbors (index_t particleIndex, const ParticleNeighborData &particleNeighborData)
 Function to get particle neighbors depending on index (possible inside Kokkos parallel region) make sure to call update first.
 
static KOKKOS_FUNCTION particle_neighbor_list_type getParticleNeighbors (const vector_type &pos, const ParticleNeighborData &particleNeighborData)
 Function to get particle neighbors depending on position (possible inside Kokkos parallel region) make sure to call update first.
 

Protected Types

using CellIndex_t = Vector< size_type, Dim >
 
using FlatCellIndex_t = typename CellIndex_t::value_type
 
using cell_particle_neighbor_list_type = Kokkos::Array< size_type, detail::countHypercubes(Dim)>
 
- Protected Types inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
using region_view_type = typename RegionLayout_t::view_type
 Type of the Kokkos view containing the local regions.
 
using region_type = typename region_view_type::value_type
 Type of a single Region object.
 
using neighbor_list = typename FieldLayout_t::neighbor_list
 Array of N rank lists, where N = number of hypercubes for the dimension Dim.
 

Static Protected Member Functions

template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool isCloseToBoundary (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &region, Kokkos::Array< bool, Dim > periodic, T overlap)
 determines whether a position is within overlap to the boundary of a region
 
KOKKOS_INLINE_FUNCTION static constexpr FlatCellIndex_t toFlatCellIndex (const CellIndex_t &cellIndex, const Vector< size_type, Dim > &cellStrides, hash_type cellPermutationForward)
 convert a nd-cell-index to flat cell index
 
KOKKOS_INLINE_FUNCTION static constexpr CellIndex_t toCellIndex (FlatCellIndex_t nonPermutedIndex, const Vector< size_type, Dim > &numCells)
 compute the nd-cell-index from a flattened (non-permuted) index
 
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool isLocalCellIndex (const std::index_sequence< Idx... > &, const CellIndex_t &index, const Vector< size_type, Dim > &numCells)
 determines whether cell index is local cell index
 
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &region, T overlap)
 determines whether a position is in a region including its overlap
 
KOKKOS_INLINE_FUNCTION static constexpr CellIndex_t getCellIndex (const vector_type &pos, const region_type &region, const Vector< T, Dim > &cellWidth)
 get the nd-cell-index of a position
 
KOKKOS_INLINE_FUNCTION static constexpr cell_particle_neighbor_list_type getCellNeighbors (const CellIndex_t &cellIndex, const Vector< size_type, Dim > &cellStrides, const hash_type &cellPermutationForward)
 get all indices of cell neighbors of a given nd-cell-index
 
- Static Protected Member Functions inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
template<size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool positionInRegion (const std::index_sequence< Idx... > &, const vector_type &pos, const region_type &region)
 

Protected Attributes

const T rcutoff_m
 ! overlap in each dimension
 
Vector< size_type, Dim > numCells_m
 ! number of cells in each dimension
 
Vector< size_type, Dim > cellStrides_m
 ! strides to compute cell indices
 
Vector< T, Dim > cellWidth_m
 ! width of cells in each dimension
 
size_type totalCells_m
 ! the number of total cells
 
size_type numGhostCells_m
 ! the number of interior cells
 
size_type numLocalCells_m
 ! the number of ghost cells
 
size_type numLocalParticles_m
 ! the number of local particles (particles in local cells)
 
hash_type cellPermutationForward_m
 
hash_type cellPermutationBackward_m
 ! the inverse of cellPermutationForward_m
 
hash_type cellStartingIdx_m
 ! cell i contains particles cellStartingIdx_m(i), ..., cellStartingIdx_m(i + 1) - 1
 
hash_type cellIndex_m
 
hash_type cellParticleCount_m
 ! view of number of particles in each cell
 
- Protected Attributes inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
RegionLayout_t rlayout_m
 The RegionLayout which determines where our particles go.
 
FieldLayout_t & flayout_m
 The FieldLayout containing information on nearest neighbors.
 
std::vector< size_type > nRecvs_m
 
mpi::rma::Window< mpi::rma::Active > window_m
 

Static Protected Attributes

static constexpr size_type numGhostCellsPerDim_m = 1
 ! number of ghost cells
 

Additional Inherited Members

- Static Public Attributes inherited from ippl::detail::ParticleLayout< T, Dim, PositionProperties... >
static constexpr unsigned dim
 
- Protected Member Functions inherited from ippl::ParticleSpatialLayout< T, Dim, Mesh, PositionProperties >
size_type getNeighborSize (const neighbor_list &neighbors) const
 

Detailed Description

template<typename T, unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
class ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >

ParticleSpatialOverlapLayout class definition.

Template Parameters
Tvalue type
Dimdimension
Meshtype

Constructor & Destructor Documentation

◆ ParticleSpatialOverlapLayout()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::ParticleSpatialOverlapLayout ( FieldLayout< Dim > &  fl,
Mesh mesh,
const T &  rcutoff 
)
Parameters
flField layout
meshMesh
rcutoffOverlap of the regions in each dimension

Member Function Documentation

◆ buildCells()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<class ParticleContainer >
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::buildCells ( ParticleContainer &  pc)

builds the cell structure, sorts the particles according to the cells and makes sure only local particles are counted towards pc.getLocalNum()

Parameters
pcparticle container of which to sort the particles

◆ createPeriodicGhostParticles()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<class ParticleContainer >
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::createPeriodicGhostParticles ( ParticleContainer &  pc)

copies particles close to the boundary and offsets them to their closest periodic image

Parameters
pcparticle container of which to construct periodic ghost particles

◆ fillHash()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::fillHash ( int  rank,
const locate_type &  ranks,
const locate_type &  offsets,
hash_type &  hash 
)

utility function to collect all indices of particles to send to given rank

Parameters
rankrank to send to
ranksThe view containing which rank each particle belongs to
offsetsThe offsets to determine where the ranks of a particle start in ranks
hashthe view containing all particle indices to send

◆ forEachPair()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<typename ExecutionSpace , typename Functor >
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::forEachPair ( Functor &&  f) const

call functor for each combination i, j. make sure to call update first

Template Parameters
ExecutionSpaceSpace in which to generate all indices
Functortype of loop body
Parameters
floop body functor to call for all pair of indices i, j where i are all internal particle indices and j include ghost particles

◆ getCellIndex()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_INLINE_FUNCTION constexpr ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::CellIndex_t ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getCellIndex ( const vector_type &  pos,
const region_type region,
const Vector< T, Dim > &  cellWidth 
)
staticconstexprprotected

get the nd-cell-index of a position

Parameters
posposition to get the cell index for
regionregion of the cells
cellWidthin each dimension

◆ getCellNeighbors()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_INLINE_FUNCTION constexpr ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::cell_particle_neighbor_list_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getCellNeighbors ( const CellIndex_t cellIndex,
const Vector< size_type, Dim > &  cellStrides,
const hash_type &  cellPermutationForward 
)
staticconstexprprotected

get all indices of cell neighbors of a given nd-cell-index

Parameters
cellIndexto get the neighbors from
cellStridesin each dimension
cellPermutationForwardthe permutation to apply to all neighbors

◆ getFlatNeighbors()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::locate_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getFlatNeighbors ( const neighbor_list neighbors) const

utility function to get a flat view of all neighbor processes

Parameters
neighborsFieldLayouts neighbor_list
Returns
view of neighbor ranks

◆ getNonNeighborRanks()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::locate_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getNonNeighborRanks ( const locate_type &  neighbors_view) const

utility function to get a view of all non-neighboring ranks

Parameters
neighbors_viewview of all neighboring ranks
Returns
view of all non-neighboring ranks

◆ getParticleNeighborData()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::ParticleNeighborData ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getParticleNeighborData ( ) const
Returns
the proxy of the particle neighbor list data needed to get particle neighbors

◆ getParticleNeighbors() [1/2]

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_FUNCTION ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::particle_neighbor_list_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getParticleNeighbors ( const vector_type &  pos,
const ParticleNeighborData particleNeighborData 
)
static

Function to get particle neighbors depending on position (possible inside Kokkos parallel region) make sure to call update first.

Parameters
posposition of particle to get neighbors for
particleNeighborDataproxy of (own) data required for the calculation
Returns
view of all indices of neighbor particles of particle with given particleIndex

◆ getParticleNeighbors() [2/2]

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_FUNCTION ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::particle_neighbor_list_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::getParticleNeighbors ( index_t  particleIndex,
const ParticleNeighborData particleNeighborData 
)
static

Function to get particle neighbors depending on index (possible inside Kokkos parallel region) make sure to call update first.

Parameters
particleIndexindex of particle to get neighbors for
particleNeighborDataproxy of (own) data required for the calculation
Returns
view of all indices of neighbor particles of particle with given particleIndex

◆ isCloseToBoundary()

template<typename T , unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::isCloseToBoundary ( const std::index_sequence< Idx... > &  ,
const vector_type &  pos,
const region_type region,
Kokkos::Array< bool, Dim >  periodic,
overlap 
)
staticconstexprprotected

determines whether a position is within overlap to the boundary of a region

Parameters
posposition to query
regionregion of the position
periodicvector determining which dimensions to consider (as they are periodic)
overlapdistance to consider as close

◆ isLocalCellIndex()

template<typename T , unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::isLocalCellIndex ( const std::index_sequence< Idx... > &  ,
const CellIndex_t index,
const Vector< size_type, Dim > &  numCells 
)
staticconstexprprotected

determines whether cell index is local cell index

Parameters
indexto test
numCellsin each dimension

◆ locateParticles()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<typename ParticleContainer >
std::pair< detail::size_type, detail::size_type > ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::locateParticles ( const ParticleContainer &  pc,
locate_type &  ranks,
locate_type &  rankOffsets,
bool_type &  invalid,
locate_type &  nSends_dview,
locate_type &  sends_dview 
) const

This function determines to which rank particles need to be sent after the iteration step. It starts by first scanning direct rank neighbors, and only does a global scan if particles are far away from the current rank. It then calculates how many particles need to be sent to each rank and how many ranks are sent to in total.

Parameters
pcParticle Container
ranksA vector where each value refers to the new rank of the particle which rank values correspond to which particles is determined by rankOffsets
rankOffsetsA vector of offsets where rankOffset(i) determines where the ranks of particle i in ranks start.
invalidA vector marking the particles that need to be sent away, and thus locally deleted
nSends_dviewDevice view the length of number of ranks, where each value determines the number of particles sent to that rank from the current rank
sends_dviewDevice view for the number of ranks that are sent to from current rank
Returns
tuple with the number of particles sent away and the number of ranks sent to

outsideIds: Container of particle IDs that travelled outside of the neighborhood. counts: count assignments per particle

outsideCount: Tracks the number of particles that travelled outside of the neighborhood.

invalidCount: Tracks the number of particles that need to be sent to other ranks.

neighbors_view: Kokkos view with the IDs of the neighboring MPI ranks.

Begin Kokkos loop: Step 1: search in current rank Step 2: search in neighbors Step 3: save information on whether the particle was located Step 4: run additional loop on non-located particles

Step 4

pID: (local) ID of the particle that is currently being searched.

inRegion: Checks whether particle pID is inside region j.

pID: (local) ID of the particle that is currently being searched.

◆ numberOfSends()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
detail::size_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::numberOfSends ( int  rank,
const locate_type &  ranks 
)

utility function to compute how many particles to sent to a given rank

Parameters
rankrank to send to
ranksThe view containing which rank each particle belongs to
Returns
number of particles sent to rank

◆ particleExchange()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<class ParticleContainer >
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::particleExchange ( ParticleContainer &  pc)

exchange particles by scanning neighbor ranks first, only scan other ranks if needed. assumes overlap is smaller than half the smallest region width.

Parameters
pcparticle container of which to exchange particles

◆ positionInRegion()

template<typename T , unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
template<std::size_t... Idx>
KOKKOS_INLINE_FUNCTION static constexpr bool ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::positionInRegion ( const std::index_sequence< Idx... > &  ,
const vector_type &  pos,
const region_type region,
overlap 
)
staticconstexprprotected

determines whether a position is in a region including its overlap

Parameters
posposition to query
regionregion to test
overlapoverlap of the region in every dimension

◆ toCellIndex()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_INLINE_FUNCTION constexpr ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::CellIndex_t ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::toCellIndex ( FlatCellIndex_t  nonPermutedIndex,
const Vector< size_type, Dim > &  numCells 
)
staticconstexprprotected

compute the nd-cell-index from a flattened (non-permuted) index

Parameters
nonPermutedIndexthe flat index to transform
numCellsin each dimension

◆ toFlatCellIndex()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
KOKKOS_INLINE_FUNCTION constexpr ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties... >::FlatCellIndex_t ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::toFlatCellIndex ( const CellIndex_t cellIndex,
const Vector< size_type, Dim > &  cellStrides,
hash_type  cellPermutationForward 
)
staticconstexprprotected

convert a nd-cell-index to flat cell index

Parameters
cellIndexto convert
cellStridescell strides to flatten the cell index with
cellPermutationForwardthe permutation to apply to the flattened index

◆ update()

template<typename T , unsigned Dim, class Mesh , typename... Properties>
template<class ParticleContainer >
void ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, Properties >::update ( ParticleContainer &  pc)

updates particles by exchanging them across ranks according to their positions. then constructs the particle neighbor list structure

Parameters
pcparticle container to update

Member Data Documentation

◆ cellIndex_m

template<typename T , unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
hash_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::cellIndex_m
protected

! view storing the cell index of each particle (TODO not needed if getParticleNeighbors depending on index is not required)

◆ cellPermutationForward_m

template<typename T , unsigned Dim, class Mesh = UniformCartesian<T, Dim>, typename... PositionProperties>
hash_type ippl::ParticleSpatialOverlapLayout< T, Dim, Mesh, PositionProperties >::cellPermutationForward_m
protected

To ensure the interior particles are at indices 0, ..., numLocalParticles_m - 1 the cells need to be permuted such that local cells are at the beginning and ghost cells at the end cellPermutationForward_m at cell index computed from actual position and cellStrides gives permuted index


The documentation for this class was generated from the following files: