Skip to content

Commit

Permalink
Particle Enums: Rename Momentum (#353)
Browse files Browse the repository at this point in the history
Rename momentum to start with `p` for all components.
Fix a comment for `t`.
  • Loading branch information
ax3l authored May 4, 2023
1 parent cea96b4 commit 4b159a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/particles/ImpactXParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace impactx
{
x, ///< position in x [m] (at fixed s OR fixed t)
y, ///< position in y [m] (at fixed s OR fixed t)
t, ///< time-of-flight c*t [m] (at fixed s)
t, ///< c * time-of-flight [m] (at fixed s)
nattribs ///< the number of attributes above (always last)
};

Expand All @@ -65,8 +65,8 @@ namespace impactx
{
enum
{
ux, ///< momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
uy, ///< momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
px, ///< momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
py, ///< momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
pt, ///< energy deviation, scaled by speed of light * the magnitude of the reference momentum [unitless] (at fixed s)
qm, ///< charge to mass ratio, in q_e/m_e [q_e/eV]
w, ///< particle weight, number of real particles represented by this macroparticle [unitless]
Expand Down
4 changes: 2 additions & 2 deletions src/particles/ImpactXParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ namespace impactx
// write Real attributes (SoA) to particle initialized zero
DefineAndReturnParticleTile(0, 0, 0);

pinned_tile.push_back_real(RealSoA::ux, px);
pinned_tile.push_back_real(RealSoA::uy, py);
pinned_tile.push_back_real(RealSoA::px, px);
pinned_tile.push_back_real(RealSoA::py, py);
pinned_tile.push_back_real(RealSoA::pt, pt);
pinned_tile.push_back_real(RealSoA::qm, np, qm);
pinned_tile.push_back_real(RealSoA::w, np, bchchg/ablastr::constant::SI::q_e/np);
Expand Down
4 changes: 2 additions & 2 deletions src/particles/diagnostics/DiagnosticOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ namespace impactx::diagnostics

// preparing access to particle data: SoA of Reals
auto &soa_real = pti.GetStructOfArrays().GetRealData();
amrex::ParticleReal const *const AMREX_RESTRICT part_px = soa_real[RealSoA::ux].dataPtr();
amrex::ParticleReal const *const AMREX_RESTRICT part_py = soa_real[RealSoA::uy].dataPtr();
amrex::ParticleReal const *const AMREX_RESTRICT part_px = soa_real[RealSoA::px].dataPtr();
amrex::ParticleReal const *const AMREX_RESTRICT part_py = soa_real[RealSoA::py].dataPtr();
amrex::ParticleReal const *const AMREX_RESTRICT part_pt = soa_real[RealSoA::pt].dataPtr();

if (otype == OutputType::PrintParticles) {
Expand Down
4 changes: 2 additions & 2 deletions src/particles/elements/mixin/beamoptic.H
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ namespace detail

// preparing access to particle data: SoA of Reals
auto& soa_real = pti.GetStructOfArrays().GetRealData();
amrex::ParticleReal* const AMREX_RESTRICT part_px = soa_real[RealSoA::ux].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_py = soa_real[RealSoA::uy].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_px = soa_real[RealSoA::px].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_py = soa_real[RealSoA::py].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_pt = soa_real[RealSoA::pt].dataPtr();

detail::PushSingleParticle<T_Element> const pushSingleParticle(
Expand Down
4 changes: 2 additions & 2 deletions src/particles/spacecharge/GatherAndPush.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ namespace impactx::spacecharge

// preparing access to particle data: SoA of Reals
auto& soa_real = pti.GetStructOfArrays().GetRealData();
amrex::ParticleReal* const AMREX_RESTRICT part_px = soa_real[RealSoA::ux].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_py = soa_real[RealSoA::uy].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_px = soa_real[RealSoA::px].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_py = soa_real[RealSoA::py].dataPtr();
amrex::ParticleReal* const AMREX_RESTRICT part_pz = soa_real[RealSoA::pz].dataPtr(); // note: currently for a fixed t

// group together constants for the momentum push
Expand Down
4 changes: 2 additions & 2 deletions src/particles/transformation/CoordinateTransformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace transformation {

// preparing access to particle data: SoA of Reals
auto &soa_real = pti.GetStructOfArrays().GetRealData();
amrex::ParticleReal *const AMREX_RESTRICT part_px = soa_real[RealSoA::ux].dataPtr();
amrex::ParticleReal *const AMREX_RESTRICT part_py = soa_real[RealSoA::uy].dataPtr();
amrex::ParticleReal *const AMREX_RESTRICT part_px = soa_real[RealSoA::px].dataPtr();
amrex::ParticleReal *const AMREX_RESTRICT part_py = soa_real[RealSoA::py].dataPtr();

if( direction == Direction::to_fixed_s) {
BL_PROFILE("impactx::transformation::CoordinateTransformation::to_fixed_s");
Expand Down

0 comments on commit 4b159a0

Please sign in to comment.