@@ -413,12 +413,10 @@ LaserParticleContainer::InitData (int lev)
413
413
#if defined(WARPX_DIM_3D)
414
414
return {m_u_X[0 ]*(pos[0 ]-m_position[0 ])+m_u_X[1 ]*(pos[1 ]-m_position[1 ])+m_u_X[2 ]*(pos[2 ]-m_position[2 ]),
415
415
m_u_Y[0 ]*(pos[0 ]-m_position[0 ])+m_u_Y[1 ]*(pos[1 ]-m_position[1 ])+m_u_Y[2 ]*(pos[2 ]-m_position[2 ])};
416
- #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
417
- # if defined(WARPX_DIM_RZ)
416
+ #elif defined(WARPX_DIM_RZ)
418
417
return {pos[0 ]-m_position[0 ], 0 .0_rt};
419
- # else
418
+ #elif defined(WARPX_DIM_XZ)
420
419
return {m_u_X[0 ]*(pos[0 ]-m_position[0 ])+m_u_X[2 ]*(pos[2 ]-m_position[2 ]), 0 .0_rt};
421
- # endif
422
420
#else
423
421
return {m_u_X[2 ]*(pos[2 ]-m_position[2 ]), 0 .0_rt};
424
422
#endif
@@ -734,13 +732,12 @@ LaserParticleContainer::ComputeSpacing (int lev, Real& Sx, Real& Sy) const
734
732
Sy = std::min (std::min (dx[0 ]/(std::abs (m_u_Y[0 ])+eps),
735
733
dx[1 ]/(std::abs (m_u_Y[1 ])+eps)),
736
734
dx[2 ]/(std::abs (m_u_Y[2 ])+eps));
737
- #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
738
- # if defined(WARPX_DIM_RZ)
735
+ #elif defined(WARPX_DIM_RZ)
739
736
Sx = dx[0 ];
740
- # else
737
+ Sy = 1.0 ;
738
+ #elif defined(WARPX_DIM_XZ)
741
739
Sx = std::min (dx[0 ]/(std::abs (m_u_X[0 ])+eps),
742
740
dx[2 ]/(std::abs (m_u_X[2 ])+eps));
743
- # endif
744
741
Sy = 1.0 ;
745
742
#else
746
743
Sx = 1.0 ;
@@ -750,7 +747,7 @@ LaserParticleContainer::ComputeSpacing (int lev, Real& Sx, Real& Sy) const
750
747
}
751
748
752
749
void
753
- LaserParticleContainer::ComputeWeightMobility (Real Sx, Real Sy)
750
+ LaserParticleContainer::ComputeWeightMobility ([[maybe_unused]] Real Sx, [[maybe_unused]] Real Sy)
754
751
{
755
752
// The mobility is the constant of proportionality between the field to
756
753
// be emitted, and the corresponding velocity that the particles need to have.
@@ -760,14 +757,7 @@ LaserParticleContainer::ComputeWeightMobility (Real Sx, Real Sy)
760
757
m_mobility = eps/m_e_max;
761
758
m_weight = PhysConst::ep0 / m_mobility;
762
759
// Multiply by particle spacing
763
- #if defined(WARPX_DIM_3D)
764
- m_weight *= Sx * Sy;
765
- #elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
766
- m_weight *= Sx;
767
- amrex::ignore_unused (Sy);
768
- #else
769
- amrex::ignore_unused (Sx,Sy);
770
- #endif
760
+ m_weight *= AMREX_D_TERM (1 ._rt , * Sx, * Sy);
771
761
// When running in the boosted-frame, the input parameters (and in particular
772
762
// the amplitude of the field) are given in the lab-frame.
773
763
// Therefore, the mobility needs to be modified by a factor WarpX::gamma_boost.
0 commit comments