aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 12e18e4f4..88498b954 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -239,7 +239,7 @@ PhysicalParticleContainer::AddGaussianBeam (
npart /= 4;
}
for (long i = 0; i < npart; ++i) {
-#if (defined WARPX_DIM_3D) || (WARPX_DIM_RZ)
+#if (defined WARPX_DIM_3D) || (defined WARPX_DIM_RZ)
const Real weight = q_tot/(npart*charge);
const Real x = distx(mt);
const Real y = disty(mt);
@@ -328,7 +328,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(ParticleReal q_tot,
double const momentum_unit_x = ps["momentum"]["x"].unitSI();
std::shared_ptr<ParticleReal> ptr_uz = ps["momentum"]["z"].loadChunk<ParticleReal>();
double const momentum_unit_z = ps["momentum"]["z"].unitSI();
-# ifdef WARPX_DIM_3D
+# ifndef WARPX_DIM_XZ
std::shared_ptr<ParticleReal> ptr_y = ps["position"]["y"].loadChunk<ParticleReal>();
double const position_unit_y = ps["position"]["y"].unitSI();
# endif
@@ -361,10 +361,10 @@ PhysicalParticleContainer::AddPlasmaFromFile(ParticleReal q_tot,
for (auto i = decltype(npart){0}; i<npart; ++i){
ParticleReal const x = ptr_x.get()[i]*position_unit_x;
ParticleReal const z = ptr_z.get()[i]*position_unit_z+z_shift;
-# ifndef WARPX_DIM_3D
- ParticleReal const y = 0.0_prt;
-# else
+# if (defined WARPX_DIM_3D) || (defined WARPX_DIM_RZ)
ParticleReal const y = ptr_y.get()[i]*position_unit_y;
+# else
+ ParticleReal const y = 0.0_prt;
# endif
if (plasma_injector->insideBounds(x, y, z)) {
ParticleReal const ux = ptr_ux.get()[i]*momentum_unit_x/PhysConst::m_e;