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

List of particle fields stored in AoSoA. More...

#include <Cabana_ParticleList.hpp>

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

Public Types

using memory_space = MemorySpace
 Kokkos memory space.
 
using traits = ParticleTraits<FieldTags...>
 AoSoA member field types.
 
using member_types = typename traits::member_types
 AoSoA member types.
 
using aosoa_type = Cabana::AoSoA<member_types, memory_space, VectorLength>
 AoSoA type.
 
using tuple_type = typename aosoa_type::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 = Particle<FieldTags...>
 Single particle type.
 
using particle_view_type
 Single SoA type.
 

Public Member Functions

 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).
 
template<class IndexType>
KOKKOS_INLINE_FUNCTION auto getParticle (IndexType p) const
 Get a single particle.
 
template<class ParticleType, class IndexType>
KOKKOS_INLINE_FUNCTION void setParticle (ParticleType particle, IndexType p) const
 Set a single particle.
 
template<class IndexType>
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.
 
template<class FieldTag>
slice_type< TypeIndexer< FieldTag, FieldTags... >::index > slice (FieldTag) const
 Get a slice of a given field.
 

Protected Attributes

aosoa_type _aosoa
 Particle AoSoA.
 

Detailed Description

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

List of particle fields stored in AoSoA.

Member Typedef Documentation

◆ particle_view_type

template<class MemorySpace, int VectorLength, class... FieldTags>
using Cabana::ParticleList< MemorySpace, VectorLength, FieldTags >::particle_view_type
Initial value:
static constexpr int vector_length
Definition Cabana_AoSoA.hpp:152
Single SoA particle view. Wraps a view of the SoA the particle resides in.
Definition Cabana_ParticleList.hpp:78

Single SoA type.

◆ slice_type

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

Single field slice type.

Template Parameters
MAoSoA field index.

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