diff options
Diffstat (limited to 'Source/Utils/WarpXUtil.cpp')
-rw-r--r-- | Source/Utils/WarpXUtil.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Source/Utils/WarpXUtil.cpp b/Source/Utils/WarpXUtil.cpp index 277385d49..b05935587 100644 --- a/Source/Utils/WarpXUtil.cpp +++ b/Source/Utils/WarpXUtil.cpp @@ -112,7 +112,7 @@ void ReadBoostedFrameParameters(Real& gamma_boost, Real& beta_boost, if (s == "x" || s == "X") { boost_direction[0] = 1; } -#if (AMREX_SPACEDIM == 3) +#if defined(WARPX_DIM_3D) else if (s == "y" || s == "Y") { boost_direction[1] = 1; } @@ -168,9 +168,9 @@ void ConvertLabParamsToBoost() } -#if (AMREX_SPACEDIM == 3) +#if defined(WARPX_DIM_3D) Vector<int> dim_map {0, 1, 2}; -#elif (AMREX_SPACEDIM == 2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) Vector<int> dim_map {0, 2}; #else Vector<int> dim_map {2}; @@ -217,20 +217,20 @@ void NullifyMF(amrex::MultiFab& mf, int lev, amrex::Real zmin, amrex::Real zmax) for(amrex::MFIter mfi(mf, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi){ const amrex::Box& bx = mfi.tilebox(); // Get box lower and upper physical z bound, and dz -#if (AMREX_SPACEDIM == 3) +#if defined(WARPX_DIM_3D) amrex::Array<amrex::Real,3> galilean_shift = { 0., 0., 0., }; -#elif (AMREX_SPACEDIM == 2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) amrex::Array<amrex::Real,3> galilean_shift = { 0., std::numeric_limits<Real>::quiet_NaN(), 0., } ; -#elif (AMREX_SPACEDIM == 1) +#elif defined(WARPX_DIM_1D_Z) amrex::Array<amrex::Real,3> galilean_shift = {std::numeric_limits<Real>::quiet_NaN(), std::numeric_limits<Real>::quiet_NaN(), 0., } ; #endif const amrex::Real zmin_box = WarpX::LowerCorner(bx, galilean_shift, lev)[2]; const amrex::Real zmax_box = WarpX::UpperCorner(bx, lev)[2]; amrex::Real dz = WarpX::CellSize(lev)[2]; // Get box lower index in the z direction -#if (AMREX_SPACEDIM==3) +#if defined(WARPX_DIM_3D) const int lo_ind = bx.loVect()[2]; -#elif (AMREX_SPACEDIM==2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) const int lo_ind = bx.loVect()[1]; #else const int lo_ind = bx.loVect()[0]; @@ -241,9 +241,9 @@ void NullifyMF(amrex::MultiFab& mf, int lev, amrex::Real zmin, amrex::Real zmax) // Set field to 0 between zmin and zmax ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept{ -#if (AMREX_SPACEDIM==3) +#if defined(WARPX_DIM_3D) const Real z_gridpoint = zmin_box+(k-lo_ind)*dz; -#elif (AMREX_SPACEDIM==2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) const Real z_gridpoint = zmin_box+(j-lo_ind)*dz; #else const Real z_gridpoint = zmin_box+(i-lo_ind)*dz; |