From 97f4361e62562fb24a015a16fdd0bc5eb72f2e36 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Thu, 30 Apr 2020 13:45:58 -0700 Subject: 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 Co-authored-by: L. Diana Amorim --- Source/Particles/PhysicalParticleContainer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Particles/PhysicalParticleContainer.cpp') 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().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 ptr_x = ps.second["position"]["x"].loadChunk(); double const position_unit_x = ps.second["position"]["x"].unitSI(); @@ -367,7 +367,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f, std::shared_ptr ptr_uz = ps.second["momentum"]["z"].loadChunk(); 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 ptr_y = ps.second["position"]["y"].loadChunk(); @@ -391,7 +391,7 @@ PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f, for (auto i = decltype(npart){0}; iinsideBounds(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; -- cgit v1.2.3