IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ParticleContainer< T, Dim > Class Template Reference

#include <ParticleContainer.hpp>

Inheritance diagram for ParticleContainer< T, Dim >:
Collaboration diagram for ParticleContainer< T, Dim >:

Public Types

using vector_type
using index_type
using particle_position_type
using particle_index_type
using Layout_t
using attribute_type
using container_type
using attribute_container_type
using bc_container_type
using hash_container_type
using size_type

Public Member Functions

 ParticleContainer (Mesh_t< Dim > &mesh, FieldLayout_t< Dim > &FL)
 ~ParticleContainer ()
std::shared_ptr< PLayout_t< T, Dim > > getPL ()
void setPL (std::shared_ptr< PLayout_t< T, Dim > > &pl)
void registerAttributes ()
void setupBCs ()
detail::size_type packedSize (const size_type count) const
void initialize (Layout_t &layout)
size_type getLocalNum () const
void setLocalNum (size_type size)
size_type getTotalNum () const
Layout_tgetLayout ()
void setParticleBC (const bc_container_type &bcs)
void addAttribute (detail::ParticleAttribBase< MemorySpace > &pa)
attribute_type< MemorySpace > * getAttribute (size_t i)
void forAllAttributes (Functor &&f) const
unsigned getAttributeNum () const
void create (size_type nLocal)
void createWithID (index_type id)
void globalCreate (size_type nTotal)
void destroy (const Kokkos::View< bool *, Properties... > &invalid, const size_type destroyNum)
void update ()
void internalDestroy (const Kokkos::View< bool *, Properties... > &invalid, const size_type destroyNum)
void sendToRank (int rank, int tag, std::vector< MPI_Request > &requests, const HashType &hash)
void recvFromRank (int rank, int tag, size_type nRecvs)
void serialize (Archive &ar, size_type nsends)
void deserialize (Archive &ar, size_type nrecvs)

Public Attributes

ippl::ParticleAttrib< double > q
Base::particle_position_type P
Base::particle_position_type E
particle_position_type R
 view of particle positions
particle_index_type ID
 view of particle IDs

Protected Member Functions

void pack (const hash_container_type &hash)
void unpack (size_type nrecvs)

Private Types

using Base = ippl::ParticleBase<ippl::ParticleSpatialLayout<T, Dim>>

Private Member Functions

void setBCAllPeriodic ()

Private Attributes

PLayout_t< T, Dimpl_m
Layout_tlayout_m
 particle layout
size_type localNum_m
 processor local number of particles
size_type totalNum_m
 total number of particles (across all processes)
attribute_container_type attributes_m
 all attributes
index_type nextID_m
 next unique particle ID
index_type numNodes_m
 number of MPI ranks
hash_container_type deleteIndex_m
 buffers for particle partitioning
hash_container_type keepIndex_m

Static Private Attributes

static constexpr bool EnableIDs

Detailed Description

template<typename T, unsigned Dim = 3>
class ParticleContainer< T, Dim >

Definition at line 10 of file ParticleContainer.hpp.

Member Typedef Documentation

◆ attribute_container_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::attribute_container_type
inherited

Definition at line 104 of file ParticleBase.h.

◆ attribute_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::attribute_type
inherited

Definition at line 99 of file ParticleBase.h.

◆ Base

template<typename T, unsigned Dim = 3>
using ParticleContainer< T, Dim >::Base = ippl::ParticleBase<ippl::ParticleSpatialLayout<T, Dim>>
private

Definition at line 11 of file ParticleContainer.hpp.

◆ bc_container_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::bc_container_type
inherited

Definition at line 107 of file ParticleBase.h.

◆ container_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::container_type
inherited

Definition at line 102 of file ParticleBase.h.

◆ hash_container_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::hash_container_type
inherited

Definition at line 109 of file ParticleBase.h.

◆ index_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::index_type
inherited

Definition at line 92 of file ParticleBase.h.

◆ Layout_t

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::Layout_t
inherited

Definition at line 96 of file ParticleBase.h.

◆ particle_index_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::particle_index_type
inherited

Definition at line 94 of file ParticleBase.h.

◆ particle_position_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::particle_position_type
inherited

Definition at line 93 of file ParticleBase.h.

◆ size_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::size_type
inherited

Definition at line 111 of file ParticleBase.h.

◆ vector_type

using ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::vector_type
inherited

Definition at line 91 of file ParticleBase.h.

Constructor & Destructor Documentation

◆ ParticleContainer()

template<typename T, unsigned Dim = 3>
ParticleContainer< T, Dim >::ParticleContainer ( Mesh_t< Dim > & mesh,
FieldLayout_t< Dim > & FL )
inline

Definition at line 21 of file ParticleContainer.hpp.

◆ ~ParticleContainer()

template<typename T, unsigned Dim = 3>
ParticleContainer< T, Dim >::~ParticleContainer ( )
inline

Definition at line 28 of file ParticleContainer.hpp.

Member Function Documentation

◆ addAttribute()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::addAttribute ( detail::ParticleAttribBase< MemorySpace > & pa)
inherited

Add particle attribute

Parameters
paattribute to be added to ParticleBase

Definition at line 191 of file ParticleBase.hpp.

References attributes_m, ippl::Comm, deleteIndex_m, ippl::get(), and keepIndex_m.

Referenced by ParticleContainer< T, Dim >::registerAttributes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::create ( size_type nLocal)
inherited

Create nLocal processor local particles. This is a collective call, i.e. all MPI ranks must call this.

Parameters
nLocalnumber of local particles to be created

Definition at line 253 of file ParticleBase.hpp.

References forAllAttributes(), and keepIndex_m.

Referenced by initialize(), and ParticleBase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createWithID()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::createWithID ( index_type id)
inherited

Create a new particle with a given ID. This is a collective call. If a process passes a negative number, it does not create a particle.

Parameters
idparticle identity number

Definition at line 260 of file ParticleBase.hpp.

References deleteIndex_m, and keepIndex_m.

◆ deserialize()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::deserialize ( Archive & ar,
size_type nrecvs )
inherited

Deserialize to do MPI calls.

Parameters
ararchive

Definition at line 328 of file ParticleBase.hpp.

References forAllAttributes().

Here is the call graph for this function:

◆ destroy()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::destroy ( const Kokkos::View< bool *, Properties... > & invalid,
const size_type destroyNum )
inherited

Particle deletion Function. Partition the particles into a valid region and an invalid region, effectively deleting the invalid particles. This is a collective call.

Parameters
invalidView marking which indices are invalid
destroyNumTotal number of invalid particles

Definition at line 277 of file ParticleBase.hpp.

◆ forAllAttributes()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::forAllAttributes ( Functor && f) const
inlineinherited

Calls a given function for all attributes in the bunch

Template Parameters
MemorySpacethe memory space of the attributes to visit (void to visit all of them)
Functorthe functor type
Parameters
fa functor taking a single ParticleAttrib<MemorySpace>

Definition at line 211 of file ParticleBase.h.

Referenced by create(), deserialize(), and serialize().

Here is the caller graph for this function:

◆ getAttribute()

attribute_type< MemorySpace > * ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::getAttribute ( size_t i)
inlineinherited

Get particle attribute

Parameters
iattribute number in container
Returns
a pointer to the attribute

Definition at line 199 of file ParticleBase.h.

◆ getAttributeNum()

unsigned ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::getAttributeNum ( ) const
inlineinherited
Returns
the number of attributes

Definition at line 240 of file ParticleBase.h.

◆ getLayout()

Layout_t & ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::getLayout ( )
inlineinherited
Returns
particle layout

Definition at line 167 of file ParticleBase.h.

◆ getLocalNum()

size_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::getLocalNum ( ) const
inlineinherited
Returns
processor local number of particles

Definition at line 155 of file ParticleBase.h.

◆ getPL()

template<typename T, unsigned Dim = 3>
std::shared_ptr< PLayout_t< T, Dim > > ParticleContainer< T, Dim >::getPL ( )
inline

Definition at line 30 of file ParticleContainer.hpp.

◆ getTotalNum()

size_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::getTotalNum ( ) const
inlineinherited
Returns
total number of particles (across all processes)

Definition at line 162 of file ParticleBase.h.

◆ globalCreate()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::globalCreate ( size_type nTotal)
inherited

Create nTotal particles globally, equally distributed among all processors. This is a collective call.

Parameters
nTotalnumber of total particles to be created

Definition at line 267 of file ParticleBase.hpp.

◆ initialize()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::initialize ( Layout_t & layout)
inherited

Initialize the particle layout. Needs to be called when the ParticleBase instance is constructed with the default ctor.

Definition at line 150 of file ParticleBase.hpp.

References create().

Referenced by ParticleContainer< T, Dim >::ParticleContainer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ internalDestroy()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::internalDestroy ( const Kokkos::View< bool *, Properties... > & invalid,
const size_type destroyNum )
inherited

Definition at line 290 of file ParticleBase.hpp.

◆ pack()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::pack ( const hash_container_type & hash)
protectedinherited

Fill attributes of buffer.

Parameters
bufferto send
hashfunction to access index.

Definition at line 345 of file ParticleBase.hpp.

◆ packedSize()

detail::size_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::packedSize ( const size_type count) const
inherited

Definition at line 328 of file ParticleBase.hpp.

◆ recvFromRank()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::recvFromRank ( int rank,
int tag,
size_type nRecvs )
inherited

Receives particles from another rank

Parameters
rankthe source rank
tagthe MPI tag
recvNumthe number of messages already received (to distinguish the buffers)
nRecvsthe number of particles to receive

Definition at line 314 of file ParticleBase.hpp.

◆ registerAttributes()

template<typename T, unsigned Dim = 3>
void ParticleContainer< T, Dim >::registerAttributes ( )
inline

Definition at line 33 of file ParticleContainer.hpp.

Referenced by ParticleContainer().

Here is the caller graph for this function:

◆ sendToRank()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::sendToRank ( int rank,
int tag,
std::vector< MPI_Request > & requests,
const HashType & hash )
inherited

Sends particles to another rank

Template Parameters
HashTypethe hash view type
Parameters
rankthe destination rank
tagthe MPI tag
sendNumthe number of messages already sent (to distinguish the buffers)
requestsdestination vector in which to store the MPI requests for polling purposes
hasha hash view indicating which particles need to be sent to which rank

Definition at line 304 of file ParticleBase.hpp.

◆ serialize()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::serialize ( Archive & ar,
size_type nsends )
inherited

Serialize to do MPI calls.

Parameters
ararchive

Definition at line 321 of file ParticleBase.hpp.

References forAllAttributes().

Here is the call graph for this function:

◆ setBCAllPeriodic()

template<typename T, unsigned Dim = 3>
void ParticleContainer< T, Dim >::setBCAllPeriodic ( )
inlineprivate

Definition at line 46 of file ParticleContainer.hpp.

Referenced by setupBCs().

Here is the caller graph for this function:

◆ setLocalNum()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::setLocalNum ( size_type size)
inlineinherited

Definition at line 157 of file ParticleBase.h.

◆ setParticleBC()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::setParticleBC ( const bc_container_type & bcs)
inlineinherited

Set all boundary conditions

Parameters
bcthe boundary conditions

Definition at line 178 of file ParticleBase.h.

Referenced by ParticleContainer< T, Dim >::setBCAllPeriodic().

Here is the caller graph for this function:

◆ setPL()

template<typename T, unsigned Dim = 3>
void ParticleContainer< T, Dim >::setPL ( std::shared_ptr< PLayout_t< T, Dim > > & pl)
inline

Definition at line 31 of file ParticleContainer.hpp.

◆ setupBCs()

template<typename T, unsigned Dim = 3>
void ParticleContainer< T, Dim >::setupBCs ( )
inline

Definition at line 43 of file ParticleContainer.hpp.

Referenced by ParticleContainer().

Here is the caller graph for this function:

◆ unpack()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IP >::unpack ( size_type nrecvs)
protectedinherited

Fill my attributes.

Parameters
bufferreceived

Definition at line 351 of file ParticleBase.hpp.

◆ update()

void ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::update ( )
inlineinherited

Definition at line 280 of file ParticleBase.h.

Member Data Documentation

◆ attributes_m

attribute_container_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::attributes_m
privateinherited

all attributes

Definition at line 365 of file ParticleBase.h.

Referenced by addAttribute().

◆ deleteIndex_m

hash_container_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::deleteIndex_m
privateinherited

buffers for particle partitioning

Definition at line 374 of file ParticleBase.h.

Referenced by addAttribute(), and createWithID().

◆ E

template<typename T, unsigned Dim = 3>
Base::particle_position_type ParticleContainer< T, Dim >::E

Definition at line 16 of file ParticleContainer.hpp.

◆ EnableIDs

bool ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::EnableIDs
staticconstexprprivateinherited

Definition at line 88 of file ParticleBase.h.

◆ ID

view of particle IDs

Definition at line 118 of file ParticleBase.h.

◆ keepIndex_m

hash_container_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::keepIndex_m
privateinherited

Definition at line 375 of file ParticleBase.h.

Referenced by addAttribute(), create(), and createWithID().

◆ layout_m

Layout_t* ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::layout_m
privateinherited

particle layout

Definition at line 356 of file ParticleBase.h.

◆ localNum_m

size_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::localNum_m
privateinherited

processor local number of particles

Definition at line 359 of file ParticleBase.h.

◆ nextID_m

index_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::nextID_m
privateinherited

next unique particle ID

Definition at line 368 of file ParticleBase.h.

Referenced by ParticleBase().

◆ numNodes_m

index_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::numNodes_m
privateinherited

number of MPI ranks

Definition at line 371 of file ParticleBase.h.

Referenced by ParticleBase().

◆ P

template<typename T, unsigned Dim = 3>
Base::particle_position_type ParticleContainer< T, Dim >::P

Definition at line 15 of file ParticleContainer.hpp.

◆ pl_m

template<typename T, unsigned Dim = 3>
PLayout_t<T, Dim> ParticleContainer< T, Dim >::pl_m
private

Definition at line 18 of file ParticleContainer.hpp.

◆ q

template<typename T, unsigned Dim = 3>
ippl::ParticleAttrib<double> ParticleContainer< T, Dim >::q

Definition at line 14 of file ParticleContainer.hpp.

◆ R

view of particle positions

Definition at line 115 of file ParticleBase.h.

◆ totalNum_m

size_type ippl::ParticleBase< ippl::ParticleSpatialLayout< T, 3 >, IDProperties >::totalNum_m
privateinherited

total number of particles (across all processes)

Definition at line 362 of file ParticleBase.h.


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