Cabana 0.8.0-dev
 
Loading...
Searching...
No Matches
Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags > Class Template Reference

List of particle fields stored in AoSoA with associated mesh. More...

#include <Cabana_Grid_ParticleList.hpp>

Inheritance diagram for Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >:
Collaboration diagram for Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >:

Public Types

using memory_space = MemorySpace
 Kokkos memory space.
 
using base = Cabana::ParticleList<memory_space, VectorLength, FieldTags...>
 Base Cabana particle list type.
 
using traits = typename base::traits
 Particle AoSoA member types.
 
using aosoa_type = typename base::aosoa_type
 AoSoA type.
 
using tuple_type = typename base::tuple_type
 Particle tuple type.
 
template<std::size_t M>
using slice_type = typename aosoa_type::template member_slice_type<M>
 Single field slice type.
 
using particle_type = typename base::particle_type
 Single particle type.
 
using particle_view_type = typename base::particle_view_type
 Single SoA type.
 
- Public Types inherited from Cabana::ParticleList< MemorySpace, VectorLength, FieldTags... >
using memory_space
 Kokkos memory space.
 
using traits
 AoSoA member field types.
 
using member_types
 AoSoA member types.
 
using aosoa_type
 AoSoA type.
 
using tuple_type
 Particle tuple type.
 
using slice_type
 Single field slice type.
 
using particle_type
 Single particle type.
 
using particle_view_type
 Single SoA type.
 

Public Member Functions

 ParticleList (const std::string &label)
 Default constructor.
 
template<class LocalGridType>
bool redistribute (const LocalGridType &local_grid, const bool force_redistribute=false)
 Redistribute particles to new owning grids.
 
template<class PositionFieldTag, class LocalGridType>
bool redistribute (const LocalGridType &local_grid, PositionFieldTag, const bool force_redistribute=false)
 Redistribute particles to new owning grids with explicit field.
 
- Public Member Functions inherited from Cabana::ParticleList< MemorySpace, VectorLength, FieldTags... >
 ParticleList (const std::string &label)
 Default constructor.
 
 ParticleList (const aosoa_type &aosoa)
 Constructor from existing AoSoA.
 
KOKKOS_INLINE_FUNCTION std::size_t size () const
 Get the number of particles in the list.
 
void resize (const std::size_t n)
 Update the number of particles in the list.
 
aosoa_typeaosoa ()
 Get the AoSoA.
 
KOKKOS_INLINE_FUNCTION const aosoa_typeaosoa () const
 Get the AoSoA (const).
 
KOKKOS_INLINE_FUNCTION auto getParticle (IndexType p) const
 Get a single particle.
 
KOKKOS_INLINE_FUNCTION void setParticle (ParticleType particle, IndexType p) const
 Set a single particle.
 
KOKKOS_INLINE_FUNCTION auto getParticleView (IndexType p) const
 Set a single particle with the struct+array indexing.
 
const std::string & label () const
 Get the AoSoA label.
 
slice_type< TypeIndexer< FieldTag, FieldTags... >::index > slice (FieldTag) const
 Get a slice of a given field.
 

Protected Attributes

aosoa_type _aosoa
 Particle AoSoA.
 
- Protected Attributes inherited from Cabana::ParticleList< MemorySpace, VectorLength, FieldTags... >
aosoa_type _aosoa
 Particle AoSoA.
 

Detailed Description

template<class MemorySpace, int VectorLength, class... FieldTags>
class Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >

List of particle fields stored in AoSoA with associated mesh.

Member Typedef Documentation

◆ slice_type

template<class MemorySpace, int VectorLength, class... FieldTags>
template<std::size_t M>
using Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >::slice_type = typename aosoa_type::template member_slice_type<M>

Single field slice type.

Template Parameters
MAoSoA field index.

Member Function Documentation

◆ redistribute() [1/2]

template<class MemorySpace, int VectorLength, class... FieldTags>
template<class LocalGridType>
bool Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >::redistribute ( const LocalGridType & local_grid,
const bool force_redistribute = false )
inline

Redistribute particles to new owning grids.

Returns
Whether the particles were actually redistributed.

◆ redistribute() [2/2]

template<class MemorySpace, int VectorLength, class... FieldTags>
template<class PositionFieldTag, class LocalGridType>
bool Cabana::Grid::ParticleList< MemorySpace, VectorLength, FieldTags >::redistribute ( const LocalGridType & local_grid,
PositionFieldTag ,
const bool force_redistribute = false )
inline

Redistribute particles to new owning grids with explicit field.

Template Parameters
PositionFieldTagField tag for position data.
Returns
Whether the particles were actually redistributed.

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