@@ -51,6 +51,9 @@ namespace impactx
5151 px, // /< momentum in x, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
5252 py, // /< momentum in y, scaled by the magnitude of the reference momentum [unitless] (at fixed s or t)
5353 pt, // /< energy deviation, scaled by speed of light * the magnitude of the reference momentum [unitless] (at fixed s)
54+ sx, // /< spin vector x-component [unitless] (at fixed s or t)
55+ sy, // /< spin vector y-component [unitless] (at fixed s or t)
56+ sz, // /< spin vector z-component [unitless] (at fixed s or t)
5457 qm, // /< charge to mass ratio, in q_e/m_e [q_e/eV]
5558 w, // /< particle weight, number of real particles represented by this macroparticle [unitless]
5659 nattribs // /< the number of attributes above (always last)
@@ -63,9 +66,9 @@ namespace impactx
6366 };
6467
6568 // ! named labels for fixed s
66- static constexpr auto names_s = { " position_x" , " position_y" , " position_t" , " momentum_x" , " momentum_y" , " momentum_t" , " qm" , " weighting" };
69+ static constexpr auto names_s = { " position_x" , " position_y" , " position_t" , " momentum_x" , " momentum_y" , " momentum_t" , " spin_x " , " spin_y " , " spin_z " , " qm" , " weighting" };
6770 // ! named labels for fixed t
68- static constexpr auto names_t = { " position_x" , " position_y" , " position_z" , " momentum_x" , " momentum_y" , " momentum_z" , " qm" , " weighting" };
71+ static constexpr auto names_t = { " position_x" , " position_y" , " position_z" , " momentum_x" , " momentum_y" , " momentum_z" , " spin_x " , " spin_y " , " spin_z " , " qm" , " weighting" };
6972 static_assert (names_s.size() == nattribs);
7073 static_assert (names_t .size() == nattribs);
7174 };
@@ -176,6 +179,9 @@ namespace impactx
176179 * @param px momentum in x
177180 * @param py momentum in y
178181 * @param pt momentum in t
182+ * @param sx spin component in x
183+ * @param sy spin component in y
184+ * @param sz spin component in z
179185 * @param qm charge over mass in 1/eV
180186 * @param bunch_charge total charge within a bunch in C
181187 * @param w weight of each particle: how many real particles to represent
@@ -188,6 +194,9 @@ namespace impactx
188194 amrex::Gpu::DeviceVector<amrex::ParticleReal> const & px,
189195 amrex::Gpu::DeviceVector<amrex::ParticleReal> const & py,
190196 amrex::Gpu::DeviceVector<amrex::ParticleReal> const & pt,
197+ amrex::Gpu::DeviceVector<amrex::ParticleReal> const & sx,
198+ amrex::Gpu::DeviceVector<amrex::ParticleReal> const & sy,
199+ amrex::Gpu::DeviceVector<amrex::ParticleReal> const & sz,
191200 amrex::ParticleReal qm,
192201 std::optional<amrex::ParticleReal> bunch_charge = std::nullopt ,
193202 std::optional<amrex::Gpu::DeviceVector<amrex::ParticleReal>> w = std::nullopt
0 commit comments