Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
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< T, NReal, NInt >

Public Types

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

Public Member Functions

__host__ __device__ ParticleCPUWrapper cpu () &
 
__host__ __device__ ParticleIDWrapper id () &
 
__host__ __device__ ConstParticleCPUWrapper cpu () const &
 
__host__ __device__ ConstParticleIDWrapper id () const &
 
__host__ __device__ void atomicSetID (const Long id)
 
__host__ __device__ uint64_t & idcpu () &
 
__host__ __device__ const uint64_t & idcpu () const &
 
__host__ __device__ RealVect pos () const &
 
__host__ __device__ RealTypepos (int index) &
 
__host__ __device__ RealType pos (int index) const &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ RealTyperdata (int index) &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
__host__ __device__ RealTyperdata (int) &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ const RealTyperdata (int index) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
__host__ __device__ RealType rdata (int) const &
 
__host__ __device__ RealType rdata (int) &&=delete
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ RealVect rvec (int indx, int indy, int indz) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
__host__ __device__ RealVect rvec (int, int, int) const &
 
template<int U = T_NReal, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ RealVect rvec (const IntVect &indices) const &
 
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
__host__ __device__ RealVect rvec (const IntVect &) const &
 
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ int & idata (int index) &
 
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
__host__ __device__ uint64_t & idata (int) &
 
template<int U = T_NInt, std::enable_if_t< U !=0, int > = 0>
__host__ __device__ const int & idata (int index) const &
 
template<int U = T_NInt, std::enable_if_t< U==0, int > = 0>
__host__ __device__ int idata (int) const &
 
__host__ __device__ 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.
 
static Long UnprotectedNextID ()
 This version can only be used inside omp critical.
 
static void NextID (Long nextid)
 Reset on restart.
 

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
 
static constexpr int NInt = T_NInt
 number of extra integer components in the particle struct
 
static Long the_next_id = 1
 

Additional Inherited Members

- Public Attributes inherited from amrex::ParticleBase< T, NReal, NInt >
m_pos [3]
 
m_rdata [NReal]
 
uint64_t m_idcpu = 0
 
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

◆ IntType

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

◆ 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>
__host__ __device__ void amrex::Particle< T_NReal, T_NInt >::atomicSetID ( const Long  id)
inline

◆ cpu() [1/2]

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

◆ cpu() [2/2]

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

◆ id() [1/2]

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

◆ id() [2/2]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ uint64_t & amrex::Particle< T_NReal, T_NInt >::idata ( int  ) &
inline

◆ idata() [4/5]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ RealType amrex::Particle< T_NReal, T_NInt >::idata ( int  ) &&
inlinedelete

◆ idata() [5/5]

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

◆ idcpu() [1/2]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ uint64_t & amrex::Particle< T_NReal, T_NInt >::idcpu ( ) &
inline

◆ idcpu() [2/2]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ const uint64_t & amrex::Particle< T_NReal, T_NInt >::idcpu ( ) 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>
__host__ __device__ RealVect amrex::Particle< T_NReal, T_NInt >::pos ( ) const &
inline

◆ pos() [2/3]

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

◆ pos() [3/3]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ 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>
__host__ __device__ RealType & amrex::Particle< T_NReal, T_NInt >::rdata ( int  ) &
inline

◆ rdata() [4/5]

template<int T_NReal, int T_NInt = 0>
__host__ __device__ RealType amrex::Particle< T_NReal, T_NInt >::rdata ( int  ) &&
inlinedelete

◆ rdata() [5/5]

template<int T_NReal, int T_NInt = 0>
template<int U = T_NReal, std::enable_if_t< U==0, int > = 0>
__host__ __device__ 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>
__host__ __device__ RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( const IntVect ) 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>
__host__ __device__ RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( const IntVect indices) 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>
__host__ __device__ RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( int  indx,
int  indy,
int  indz 
) 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>
__host__ __device__ RealVect amrex::Particle< T_NReal, T_NInt >::rvec ( int  ,
int  ,
int   
) 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: