WarpX
Loading...
Searching...
No Matches
GetParticlePosition< T_PIdx > Struct Template Reference

Functor that can be used to extract the positions of the macroparticles inside a ParallelFor kernel. More...

#include <GetAndSetPosition.H>

Public Types

using RType = amrex::ParticleReal
 

Public Member Functions

 GetParticlePosition ()=default
 
template<typename ptiType>
 GetParticlePosition (const ptiType &a_pti, long a_offset=0) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator() (const long i, RType &x, RType &y, RType &z) const noexcept
 Extract the cartesian position coordinates of the particle located at index i + a_offset and store them in the variables x, y, z
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void AsStored (const long i, RType &x, RType &y, RType &z) const noexcept
 Extract the position coordinates of the particle as stored located at index i + a_offset and store them in the variables x, y, z This is only different for RZ since this returns (r, theta, z) in that case.
 

Public Attributes

const RType *AMREX_RESTRICT m_x = nullptr
 
const RType *AMREX_RESTRICT m_y = nullptr
 
const RType *AMREX_RESTRICT m_z = nullptr
 
const RType *AMREX_RESTRICT m_theta = nullptr
 

Static Public Attributes

static constexpr RType m_x_default = RType(0.0)
 
static constexpr RType m_y_default = RType(0.0)
 
static constexpr RType m_z_default = RType(0.0)
 

Detailed Description

template<typename T_PIdx = PIdx>
struct GetParticlePosition< T_PIdx >

Functor that can be used to extract the positions of the macroparticles inside a ParallelFor kernel.

Template Parameters
T_PIdxparticle index enumerator

Member Typedef Documentation

◆ RType

template<typename T_PIdx = PIdx>
using GetParticlePosition< T_PIdx >::RType = amrex::ParticleReal

Constructor & Destructor Documentation

◆ GetParticlePosition() [1/2]

template<typename T_PIdx = PIdx>
GetParticlePosition< T_PIdx >::GetParticlePosition ( )
default

◆ GetParticlePosition() [2/2]

template<typename T_PIdx = PIdx>
template<typename ptiType>
GetParticlePosition< T_PIdx >::GetParticlePosition ( const ptiType & a_pti,
long a_offset = 0 )
inlinenoexcept

Constructor

Template Parameters
ptiTypethe type of the particle iterator used in the constructor
Parameters
a_ptiiterator to the tile containing the macroparticles
a_offsetoffset to apply to the particle indices

Member Function Documentation

◆ AsStored()

template<typename T_PIdx = PIdx>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void GetParticlePosition< T_PIdx >::AsStored ( const long i,
RType & x,
RType & y,
RType & z ) const
inlinenoexcept

Extract the position coordinates of the particle as stored located at index i + a_offset and store them in the variables x, y, z This is only different for RZ since this returns (r, theta, z) in that case.

◆ operator()()

template<typename T_PIdx = PIdx>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void GetParticlePosition< T_PIdx >::operator() ( const long i,
RType & x,
RType & y,
RType & z ) const
inlinenoexcept

Extract the cartesian position coordinates of the particle located at index i + a_offset and store them in the variables x, y, z

Member Data Documentation

◆ m_theta

template<typename T_PIdx = PIdx>
const RType* AMREX_RESTRICT GetParticlePosition< T_PIdx >::m_theta = nullptr

◆ m_x

template<typename T_PIdx = PIdx>
const RType* AMREX_RESTRICT GetParticlePosition< T_PIdx >::m_x = nullptr

◆ m_x_default

template<typename T_PIdx = PIdx>
RType GetParticlePosition< T_PIdx >::m_x_default = RType(0.0)
staticconstexpr

◆ m_y

template<typename T_PIdx = PIdx>
const RType* AMREX_RESTRICT GetParticlePosition< T_PIdx >::m_y = nullptr

◆ m_y_default

template<typename T_PIdx = PIdx>
RType GetParticlePosition< T_PIdx >::m_y_default = RType(0.0)
staticconstexpr

◆ m_z

template<typename T_PIdx = PIdx>
const RType* AMREX_RESTRICT GetParticlePosition< T_PIdx >::m_z = nullptr

◆ m_z_default

template<typename T_PIdx = PIdx>
RType GetParticlePosition< T_PIdx >::m_z_default = RType(0.0)
staticconstexpr

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