diff options
author | 2021-12-16 09:09:32 -0800 | |
---|---|---|
committer | 2021-12-16 09:09:32 -0800 | |
commit | b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91 (patch) | |
tree | 87c199a7c3675479bcc8145a98fa264c8dd44633 /Source/Utils/WarpXUtil.cpp | |
parent | 2de0fa7cbc0289e92d158759e728bb0313284bcf (diff) | |
download | WarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.tar.gz WarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.tar.zst WarpX-b0b03f6bc5e7768c4ecbcb4e4a2c505d9e4aad91.zip |
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 <axel.huebl@plasma.ninja>
* Update Source/Diagnostics/FlushFormats/FlushFormatPlotfile.cpp
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
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; |