From b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 Mon Sep 17 00:00:00 2001 From: Prabhat Kumar <89051199+prkkumar@users.noreply.github.com> Date: Thu, 16 Dec 2021 09:09:32 -0800 Subject: AMREX_SPACEDIM : EB, Filter, Laser, Utils, and Diagnostics (#2677) * AMREX_SPACEDIM : EB and Filter * AMREX_SPACEDIM : Laser * AMREX_SPACEDIM : Utils * AMREX_SPACEDIM : Diagnostics * Fix Typo * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * AMREX_SPACEDIM : Warpx.cpp * Update Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp Co-authored-by: Axel Huebl * Update Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp Co-authored-by: Axel Huebl Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axel Huebl --- Source/Utils/WarpXUtil.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/Utils/WarpXUtil.cpp') 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 dim_map {0, 1, 2}; -#elif (AMREX_SPACEDIM == 2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) Vector dim_map {0, 2}; #else Vector 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 galilean_shift = { 0., 0., 0., }; -#elif (AMREX_SPACEDIM == 2) +#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ) amrex::Array galilean_shift = { 0., std::numeric_limits::quiet_NaN(), 0., } ; -#elif (AMREX_SPACEDIM == 1) +#elif defined(WARPX_DIM_1D_Z) amrex::Array galilean_shift = {std::numeric_limits::quiet_NaN(), std::numeric_limits::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; -- cgit v1.2.3