8 #ifndef WARPX_PARTICLES_PUSHER_GETANDSETPOSITION_H_
9 #define WARPX_PARTICLES_PUSHER_GETANDSETPOSITION_H_
24 amrex::ParticleReal&
x,
25 amrex::ParticleReal&
y,
26 amrex::ParticleReal&
z) noexcept
30 amrex::ParticleReal r = p.pos(0);
31 x = r*std::cos(theta);
32 y = r*std::sin(theta);
40 y = amrex::ParticleReal(0.0);
43 x = amrex::ParticleReal(0.0);
44 y = amrex::ParticleReal(0.0);
55 using RType = amrex::ParticleReal;
58 #if defined(WARPX_DIM_RZ)
60 #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
61 static constexpr
RType m_y_default =
RType(0.0);
62 #elif defined(WARPX_DIM_1D_Z)
63 static constexpr
RType m_x_default =
RType(0.0);
64 static constexpr
RType m_y_default =
RType(0.0);
76 template <
typename ptiType>
79 const auto& aos = a_pti.GetArrayOfStructs();
81 #if defined(WARPX_DIM_RZ)
82 const auto& soa = a_pti.GetStructOfArrays();
155 #if defined(WARPX_DIM_RZ)
159 template <
typename ptiType>
162 auto& aos = a_pti.GetArrayOfStructs();
164 #if defined(WARPX_DIM_RZ)
165 auto& soa = a_pti.GetStructOfArrays();
175 #if defined(WARPX_DIM_XZ)
178 #if defined(WARPX_DIM_1D_Z)
204 #if defined(WARPX_DIM_XZ)
207 #if defined(WARPX_DIM_1D_Z)
#define AMREX_FORCE_INLINE
#define AMREX_GPU_HOST_DEVICE
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void get_particle_position(const WarpXParticleContainer::SuperParticleType &p, amrex::ParticleReal &x, amrex::ParticleReal &y, amrex::ParticleReal &z) noexcept
Extract the cartesian position coordinates of the particle p and store them in the variables x,...
Definition: GetAndSetPosition.H:23
T_ParticleType ParticleType
def y
Definition: Excitation_Flag_Generator.py:76
def x
Formats datastring to remove "+" at the end of the string #####.
Definition: Excitation_Flag_Generator.py:75
def z
Definition: Excitation_Flag_Generator.py:77
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
i
Definition: check_interp_points_and_weights.py:174
Functor that can be used to extract the positions of the macroparticles inside a ParallelFor kernel.
Definition: GetAndSetPosition.H:53
GetParticlePosition(const ptiType &a_pti, int a_offset=0) noexcept
Definition: GetAndSetPosition.H:77
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(const int 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 th...
Definition: GetAndSetPosition.H:91
const PType *AMREX_RESTRICT m_structs
Definition: GetAndSetPosition.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void AsStored(const int 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 th...
Definition: GetAndSetPosition.H:120
GetParticlePosition()=default
const RType * m_theta
Definition: GetAndSetPosition.H:59
amrex::ParticleReal RType
Definition: GetAndSetPosition.H:55
WarpXParticleContainer::ParticleType PType
Definition: GetAndSetPosition.H:54
@ theta
RZ needs all three position components.
Definition: NamedComponentParticleContainer.H:27
Functor that can be used to modify the positions of the macroparticles, inside a ParallelFor kernel.
Definition: GetAndSetPosition.H:150
WarpXParticleContainer::ParticleType PType
Definition: GetAndSetPosition.H:151
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void AsStored(const int i, RType x, RType y, RType z) const noexcept
Set the position of the particle at index i + a_offset to x, y, z This is only different for RZ since...
Definition: GetAndSetPosition.H:202
PType *AMREX_RESTRICT m_structs
Definition: GetAndSetPosition.H:154
RType *AMREX_RESTRICT m_theta
Definition: GetAndSetPosition.H:156
SetParticlePosition(const ptiType &a_pti, int a_offset=0) noexcept
Definition: GetAndSetPosition.H:160
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void operator()(const int i, RType x, RType y, RType z) const noexcept
Set the position of the particle at index i + a_offset to x, y, z
Definition: GetAndSetPosition.H:173
amrex::ParticleReal RType
Definition: GetAndSetPosition.H:152