aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/PhysicalParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2020-04-30 13:45:58 -0700
committerGravatar GitHub <noreply@github.com> 2020-04-30 13:45:58 -0700
commit97f4361e62562fb24a015a16fdd0bc5eb72f2e36 (patch)
treefe3937d6ee6b0db95cca9c1cc0d10803e1b61aa5 /Source/Particles/PhysicalParticleContainer.cpp
parent779661962a2d9db1e9555d25c010d7d285bbbd3b (diff)
downloadWarpX-97f4361e62562fb24a015a16fdd0bc5eb72f2e36.tar.gz
WarpX-97f4361e62562fb24a015a16fdd0bc5eb72f2e36.tar.zst
WarpX-97f4361e62562fb24a015a16fdd0bc5eb72f2e36.zip
Fix bug when compiling OpenPMD + 2D (#963)
* WARPX_DIM_2D doesn't exist, this should be WARPX_DIM_RZ * Update Source/Particles/PhysicalParticleContainer.cpp Co-Authored-By: L. Diana Amorim <LDianaAmorim@lbl.gov> Co-authored-by: L. Diana Amorim <LDianaAmorim@lbl.gov>
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r--Source/Particles/PhysicalParticleContainer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp
index 66bd5678c..43f8d8ad3 100644
--- a/Source/Particles/PhysicalParticleContainer.cpp
+++ b/Source/Particles/PhysicalParticleContainer.cpp
@@ -356,7 +356,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f,
double const mass_unit = ps.second["mass"][openPMD::RecordComponent::SCALAR].unitSI();
amrex::ParticleReal p_q = ps.second["charge"][openPMD::RecordComponent::SCALAR].loadChunk<amrex::ParticleReal>().get()[0];
double const charge_unit = ps.second["charge"][openPMD::RecordComponent::SCALAR].unitSI();
-# if (defined WARPX_DIM_3D) || (defined WARPX_DIM_2D)
+# if (defined WARPX_DIM_3D) || (defined WARPX_DIM_XZ)
auto const npart = ps.second["position"]["x"].getExtent()[0];
std::shared_ptr<amrex::ParticleReal> ptr_x = ps.second["position"]["x"].loadChunk<amrex::ParticleReal>();
double const position_unit_x = ps.second["position"]["x"].unitSI();
@@ -367,7 +367,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f,
std::shared_ptr<amrex::ParticleReal> ptr_uz = ps.second["momentum"]["z"].loadChunk<amrex::ParticleReal>();
double const momentum_unit_z = ps.second["momentum"]["z"].unitSI();
# else
- amrex::Abort("AddPlasmaFromFile is only implemented for 2D and 3D\n")
+ amrex::Abort("AddPlasmaFromFile is only implemented for 2D and 3D\n");
# endif
# if (defined WARPX_DIM_3D)
std::shared_ptr<amrex::ParticleReal> ptr_y = ps.second["position"]["y"].loadChunk<amrex::ParticleReal>();
@@ -391,7 +391,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f,
for (auto i = decltype(npart){0}; i<npart; ++i){
amrex::ParticleReal const x = ptr_x.get()[i]*position_unit_x;
amrex::ParticleReal const z = ptr_z.get()[i]*position_unit_z;
-# if (defined WARPX_DIM_2D)
+# if (defined WARPX_DIM_XZ)
amrex::Real const y = 0.0;
# elif (defined WARPX_DIM_3D)
amrex::ParticleReal const y = ptr_y.get()[i]*position_unit_y;
@@ -399,7 +399,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f,
if (plasma_injector->insideBounds(x, y, z)) {
amrex::ParticleReal const ux = ptr_ux.get()[i]*momentum_unit_x/PhysConst::m_e;
amrex::ParticleReal const uz = ptr_uz.get()[i]*momentum_unit_z/PhysConst::m_e;
-# if (defined WARPX_DIM_2D)
+# if (defined WARPX_DIM_XZ)
amrex::ParticleReal const uy = 0.0;
# elif (defined WARPX_DIM_3D)
amrex::ParticleReal const uy = ptr_uy.get()[i]*momentum_unit_y/PhysConst::m_e;