Block-Structured AMR Software Framework
amrex::Particle< T_NReal, T_NInt > Struct Template Reference

The struct used to store particles. More...

#include <AMReX_Particle.H>

Inheritance diagram for amrex::Particle< T_NReal, T_NInt >:
amrex::ParticleBase< ParticleReal, T_NReal, 0 >

Public Types

using StorageParticleType = Particle
 
using ConstType = Particle const
 
using RealType = ParticleReal
 The floating point type used for the particles. More...
 

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ParticleCPUWrapper cpu () &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ParticleIDWrapper id () &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConstParticleCPUWrapper cpu () const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConstParticleIDWrapper id () const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void atomicSetID (const Long id)
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect pos () const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealTypepos (int index) &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType pos (int index) const &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealTyperdata (int index) &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealTyperdata (int) &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const RealTyperdata (int index) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType rdata (int) const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType rdata (int) &&=delete
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect rvec (AMREX_D_DECL(int indx, int indy, int indz)) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect rvec (AMREX_D_DECL(int, int, int)) const &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect rvec (const IntVect &indices) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect rvec (const IntVect &) const &
 
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE intidata (int index) &
 
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE uint64_t & idata (int) &
 
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const intidata (int index) const &
 
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int idata (int) const &
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType idata (int) &&=delete
 

Static Public Member Functions

static Long NextID ()
 Returns the next particle ID for this processor. Particle IDs start at 1 and are never reused. The pair, consisting of the ID and the CPU on which the particle is "born", is a globally unique identifier for a particle. The maximum of this value across all processors must be checkpointed and then restored on restart so that we don't reuse particle IDs. More...
 
static Long UnprotectedNextID ()
 This version can only be used inside omp critical. More...
 
static void NextID (Long nextid)
 Reset on restart. More...
 

Static Public Attributes

static constexpr bool is_soa_particle = false
 
static constexpr int NReal = T_NReal
 number of extra Real components in the particle struct More...
 
static constexpr int NInt = T_NInt
 number of extra integer components in the particle struct More...
 
static Long the_next_id = 1
 

Additional Inherited Members

- Public Attributes inherited from amrex::ParticleBase< ParticleReal, T_NReal, 0 >
ParticleReal m_pos [AMREX_SPACEDIM]
 
ParticleReal m_rdata [NReal]
 
uint64_t m_idcpu
 
int m_idata [NInt]
 

Detailed Description

template<int T_NReal, int T_NInt = 0>
struct amrex::Particle< T_NReal, T_NInt >

The struct used to store particles.

Template Parameters
T_NRealThe number of extra Real components
T_NIntThe number of extra integer components

Member Typedef Documentation

◆ ConstType

template<int T_NReal, int T_NInt = 0>
using amrex::Particle< T_NReal, T_NInt >::ConstType = Particle const

◆ RealType

template<int T_NReal, int T_NInt = 0>
using amrex::Particle< T_NReal, T_NInt >::RealType = ParticleReal

The floating point type used for the particles.

◆ StorageParticleType

template<int T_NReal, int T_NInt = 0>
using amrex::Particle< T_NReal, T_NInt >::StorageParticleType = Particle

Member Function Documentation

◆ atomicSetID()

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void amrex::Particle< T_NReal, T_NInt >::atomicSetID ( const Long  id)
inline

◆ cpu() [1/2]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ParticleCPUWrapper amrex::Particle< T_NReal, T_NInt >::cpu ( ) &
inline

◆ cpu() [2/2]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConstParticleCPUWrapper amrex::Particle< T_NReal, T_NInt >::cpu ( ) const &
inline

◆ id() [1/2]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ParticleIDWrapper amrex::Particle< T_NReal, T_NInt >::id ( ) &
inline

◆ id() [2/2]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConstParticleIDWrapper amrex::Particle< T_NReal, T_NInt >::id ( ) const &
inline

◆ idata() [1/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int& amrex::Particle< T_NReal, T_NInt >::idata ( int  index) &
inline

◆ idata() [2/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const int& amrex::Particle< T_NReal, T_NInt >::idata ( int  index) const &
inline

◆ idata() [3/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE uint64_t& amrex::Particle< T_NReal, T_NInt >::idata ( int  ) &
inline

◆ idata() [4/5]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType amrex::Particle< T_NReal, T_NInt >::idata ( int  ) &&
delete

◆ idata() [5/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int amrex::Particle< T_NReal, T_NInt >::idata ( int  ) const &
inline

◆ NextID() [1/2]

template<int NReal, int NInt>
Long amrex::Particle< NReal, NInt >::NextID
static

Returns the next particle ID for this processor. Particle IDs start at 1 and are never reused. The pair, consisting of the ID and the CPU on which the particle is "born", is a globally unique identifier for a particle. The maximum of this value across all processors must be checkpointed and then restored on restart so that we don't reuse particle IDs.

◆ NextID() [2/2]

template<int NReal, int NInt>
void amrex::Particle< NReal, NInt >::NextID ( Long  nextid)
static

Reset on restart.

Parameters
nextid

◆ pos() [1/3]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect amrex::Particle< T_NReal, T_NInt >::pos ( ) const &
inline

◆ pos() [2/3]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType& amrex::Particle< T_NReal, T_NInt >::pos ( int  index) &
inline

◆ pos() [3/3]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType amrex::Particle< T_NReal, T_NInt >::pos ( int  index) const &
inline

◆ rdata() [1/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType& amrex::Particle< T_NReal, T_NInt >::rdata ( int  index) &
inline

◆ rdata() [2/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE const RealType& amrex::Particle< T_NReal, T_NInt >::rdata ( int  index) const &
inline

◆ rdata() [3/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType& amrex::Particle< T_NReal, T_NInt >::rdata ( int  ) &
inline

◆ rdata() [4/5]

template<int T_NReal, int T_NInt = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType amrex::Particle< T_NReal, T_NInt >::rdata ( int  ) &&
delete

◆ rdata() [5/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealType amrex::Particle< T_NReal, T_NInt >::rdata ( int  ) const &
inline

◆ rvec() [1/4]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( AMREX_D_DECL(int indx, int indy, int indz)  ) const &
inline

◆ rvec() [2/4]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( AMREX_D_DECL(int, int, int ) const &
inline

◆ rvec() [3/4]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( const IntVect ) const &
inline

◆ rvec() [4/4]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( const IntVect indices) const &
inline

◆ UnprotectedNextID()

template<int NReal, int NInt>
Long amrex::Particle< NReal, NInt >::UnprotectedNextID
static

This version can only be used inside omp critical.

Member Data Documentation

◆ is_soa_particle

template<int T_NReal, int T_NInt = 0>
constexpr bool amrex::Particle< T_NReal, T_NInt >::is_soa_particle = false
staticconstexpr

◆ NInt

template<int T_NReal, int T_NInt = 0>
constexpr int amrex::Particle< T_NReal, T_NInt >::NInt = T_NInt
staticconstexpr

number of extra integer components in the particle struct

◆ NReal

template<int T_NReal, int T_NInt = 0>
constexpr int amrex::Particle< T_NReal, T_NInt >::NReal = T_NReal
staticconstexpr

number of extra Real components in the particle struct

◆ the_next_id

template<int NReal, int NInt>
Long amrex::Particle< NReal, NInt >::the_next_id = 1
static

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