aboutsummaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/BoundaryConditions/PML.cpp20
-rw-r--r--Source/BoundaryConditions/PML_current.H12
-rw-r--r--Source/BoundaryConditions/WarpXEvolvePML.cpp12
-rw-r--r--Source/BoundaryConditions/WarpX_PML_kernels.H42
-rw-r--r--Source/Parallelization/GuardCellManager.cpp12
-rw-r--r--Source/Parallelization/WarpXComm.cpp10
-rw-r--r--Source/Parallelization/WarpXComm_K.H56
7 files changed, 82 insertions, 82 deletions
diff --git a/Source/BoundaryConditions/PML.cpp b/Source/BoundaryConditions/PML.cpp
index 276641f38..9a1c25c7d 100644
--- a/Source/BoundaryConditions/PML.cpp
+++ b/Source/BoundaryConditions/PML.cpp
@@ -190,7 +190,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
#if (AMREX_SPACEDIM >= 2)
int jdim = (idim+1) % AMREX_SPACEDIM;
#endif
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
int kdim = (idim+2) % AMREX_SPACEDIM;
#endif
@@ -208,7 +208,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
{
side_faces.push_back(kv.first);
}
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
else if (amrex::grow(grid_box, kdim, ncell).intersects(box))
{
side_faces.push_back(kv.first);
@@ -243,7 +243,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
Box lobox = amrex::adjCellLo(grid_box, idim, ncell);
lobox.grow(jdim,ncell);
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
lobox.grow(kdim,ncell);
#endif
Box looverlap = lobox & box;
@@ -255,7 +255,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
Box hibox = amrex::adjCellHi(grid_box, idim, ncell);
hibox.grow(jdim,ncell);
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
hibox.grow(kdim,ncell);
#endif
Box hioverlap = hibox & box;
@@ -271,7 +271,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
}
#endif
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
for (auto gid : side_side_edges)
{
const Box& grid_box = grids[gid];
@@ -315,7 +315,7 @@ SigmaBox::SigmaBox (const Box& box, const BoxArray& grids, const Real* dx, int n
for (auto gid : side_faces)
{
const Box& grid_box = grids[gid];
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
const Box& overlap = amrex::grow(grid_box,jdim,ncell) & box;
#else
const Box& overlap = amrex::grow(amrex::grow(grid_box,jdim,ncell),kdim,ncell) & box;
@@ -541,11 +541,11 @@ PML::PML (const int lev, const BoxArray& grid_ba, const DistributionMapping& /*g
queryWithParser(pp_psatd, "ny_guard", ngFFt_y);
queryWithParser(pp_psatd, "nz_guard", ngFFt_z);
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
IntVect ngFFT = IntVect(ngFFt_x, ngFFt_y, ngFFt_z);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
IntVect ngFFT = IntVect(ngFFt_x, ngFFt_z);
-#elif (AMREX_SPACEDIM == 1)
+#elif defined(WARPX_DIM_1D_Z)
IntVect ngFFT = IntVect(ngFFt_z);
#endif
@@ -796,7 +796,7 @@ PML::MakeBoxArray (const amrex::Geometry& geom, const amrex::BoxArray& grid_ba,
bx &= domain;
Vector<Box> bndryboxes;
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
int kbegin = -1, kend = 1;
#else
int kbegin = 0, kend = 0;
diff --git a/Source/BoundaryConditions/PML_current.H b/Source/BoundaryConditions/PML_current.H
index 707e1a18a..88e94de1e 100644
--- a/Source/BoundaryConditions/PML_current.H
+++ b/Source/BoundaryConditions/PML_current.H
@@ -22,7 +22,7 @@ void push_ex_pml_current (int j, int k, int l,
int ylo, int zlo,
amrex::Real mu_c2_dt)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
amrex::Real alpha_xy, alpha_xz;
if (sigjy[k-ylo]+sigjz[l-zlo] == 0){
alpha_xy = 0.5;
@@ -49,7 +49,7 @@ void push_ey_pml_current (int j, int k, int l,
int xlo, int zlo,
amrex::Real mu_c2_dt)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
amrex::Real alpha_yx, alpha_yz;
if (sigjx[j-xlo]+sigjz[l-zlo] == 0){
alpha_yx = 0.5;
@@ -77,7 +77,7 @@ void push_ez_pml_current (int j, int k, int l,
int xlo, int ylo,
amrex::Real mu_c2_dt)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
amrex::Real alpha_zx, alpha_zy;
if (sigjx[j-xlo]+sigjy[k-ylo]==0){
alpha_zx = 0.5;
@@ -103,7 +103,7 @@ void damp_jx_pml (int j, int k, int l,
amrex::Real const* const sigjz,
int xlo, int ylo, int zlo)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
jx(j,k,l) = jx(j,k,l) * sigsjx[j-xlo] * sigjy[k-ylo] * sigjz[l-zlo];
#else
jx(j,k,l) = jx(j,k,l) * sigsjx[j-xlo] * sigjz[k-zlo];
@@ -119,7 +119,7 @@ void damp_jy_pml (int j, int k, int l,
amrex::Real const * const sigjz,
int xlo, int ylo, int zlo)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
jy(j,k,l) = jy(j,k,l) * sigjx[j-xlo] * sigsjy[k-ylo] * sigjz[l-zlo];
#else
jy(j,k,l) = jy(j,k,l) * sigjx[j-xlo] * sigjz[k-zlo];
@@ -135,7 +135,7 @@ void damp_jz_pml (int j, int k, int l,
amrex::Real const * const sigsjz,
int xlo, int ylo, int zlo)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
jz(j,k,l) = jz(j,k,l) * sigjx[j-xlo] * sigjy[k-ylo] * sigsjz[l-zlo];
#else
jz(j,k,l) = jz(j,k,l) * sigjx[j-xlo] * sigsjz[k-zlo];
diff --git a/Source/BoundaryConditions/WarpXEvolvePML.cpp b/Source/BoundaryConditions/WarpXEvolvePML.cpp
index f9d881014..9607a7478 100644
--- a/Source/BoundaryConditions/WarpXEvolvePML.cpp
+++ b/Source/BoundaryConditions/WarpXEvolvePML.cpp
@@ -107,7 +107,7 @@ WarpX::DampPML (int lev, PatchType patch_type)
auto const& pml_Byfab = pml_B[1]->array(mfi);
auto const& pml_Bzfab = pml_B[2]->array(mfi);
amrex::Real const * AMREX_RESTRICT sigma_fac_x = sigba[mfi].sigma_fac[0].data();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
amrex::Real const * AMREX_RESTRICT sigma_fac_y = sigba[mfi].sigma_fac[1].data();
amrex::Real const * AMREX_RESTRICT sigma_fac_z = sigba[mfi].sigma_fac[2].data();
#else
@@ -115,7 +115,7 @@ WarpX::DampPML (int lev, PatchType patch_type)
amrex::Real const * AMREX_RESTRICT sigma_fac_z = sigba[mfi].sigma_fac[1].data();
#endif
amrex::Real const * AMREX_RESTRICT sigma_star_fac_x = sigba[mfi].sigma_star_fac[0].data();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
amrex::Real const * AMREX_RESTRICT sigma_star_fac_y = sigba[mfi].sigma_star_fac[1].data();
amrex::Real const * AMREX_RESTRICT sigma_star_fac_z = sigba[mfi].sigma_star_fac[2].data();
#else
@@ -123,7 +123,7 @@ WarpX::DampPML (int lev, PatchType patch_type)
amrex::Real const * AMREX_RESTRICT sigma_star_fac_z = sigba[mfi].sigma_star_fac[1].data();
#endif
int const x_lo = sigba[mfi].sigma_fac[0].lo();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
int const y_lo = sigba[mfi].sigma_fac[1].lo();
int const z_lo = sigba[mfi].sigma_fac[2].lo();
#else
@@ -232,7 +232,7 @@ WarpX::DampJPML (int lev, PatchType patch_type)
auto const& pml_jzfab = pml_j[2]->array(mfi);
const Real* sigma_cumsum_fac_j_x = sigba[mfi].sigma_cumsum_fac[0].data();
const Real* sigma_star_cumsum_fac_j_x = sigba[mfi].sigma_star_cumsum_fac[0].data();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
const Real* sigma_cumsum_fac_j_y = sigba[mfi].sigma_cumsum_fac[1].data();
const Real* sigma_star_cumsum_fac_j_y = sigba[mfi].sigma_star_cumsum_fac[1].data();
const Real* sigma_cumsum_fac_j_z = sigba[mfi].sigma_cumsum_fac[2].data();
@@ -248,7 +248,7 @@ WarpX::DampJPML (int lev, PatchType patch_type)
const Box& tjz = mfi.tilebox( pml_j[2]->ixType().toIntVect() );
int const x_lo = sigba[mfi].sigma_cumsum_fac[0].lo();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
int const y_lo = sigba[mfi].sigma_cumsum_fac[1].lo();
int const z_lo = sigba[mfi].sigma_cumsum_fac[2].lo();
#else
@@ -257,7 +257,7 @@ WarpX::DampJPML (int lev, PatchType patch_type)
#endif
int const xs_lo = sigba[mfi].sigma_star_cumsum_fac[0].lo();
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
int const ys_lo = sigba[mfi].sigma_star_cumsum_fac[1].lo();
int const zs_lo = sigba[mfi].sigma_star_cumsum_fac[2].lo();
#else
diff --git a/Source/BoundaryConditions/WarpX_PML_kernels.H b/Source/BoundaryConditions/WarpX_PML_kernels.H
index c434e09f3..747e09374 100644
--- a/Source/BoundaryConditions/WarpX_PML_kernels.H
+++ b/Source/BoundaryConditions/WarpX_PML_kernels.H
@@ -27,13 +27,13 @@ void warpx_damp_pml_ex (int i, int j, int k, Array4<Real> const& Ex,
int xlo, int ylo, int zlo,
const bool dive_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, Ex, Ex_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo);
@@ -58,7 +58,7 @@ void warpx_damp_pml_ex (int i, int j, int k, Array4<Real> const& Ex,
Ex(i,j,k,PMLComp::xz) *= sigma_fac_z[j-zlo];
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that Ex is staggered in x, while sx = 1 means that Ex is nodal in x (same for y, z)
const int sx = Ex_stag[0];
@@ -104,13 +104,13 @@ void warpx_damp_pml_ey (int i, int j, int k, Array4<Real> const& Ey,
int xlo, int ylo, int zlo,
const bool dive_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, Ey, Ey_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo, dive_cleaning);
@@ -132,7 +132,7 @@ void warpx_damp_pml_ey (int i, int j, int k, Array4<Real> const& Ey,
Ey(i,j,k,PMLComp::yz) *= sigma_fac_z[j-zlo];
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that Ey is staggered in x, while sx = 1 means that Ey is nodal in x (same for y, z)
const int sx = Ey_stag[0];
@@ -178,13 +178,13 @@ void warpx_damp_pml_ez (int i, int j, int k, Array4<Real> const& Ez,
int xlo, int ylo, int zlo,
const bool dive_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, Ez, Ez_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, dive_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo);
@@ -209,7 +209,7 @@ void warpx_damp_pml_ez (int i, int j, int k, Array4<Real> const& Ez,
}
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that Ez is staggered in x, while sx = 1 means that Ez is nodal in x (same for y, z)
const int sx = Ez_stag[0];
@@ -255,13 +255,13 @@ void warpx_damp_pml_bx (int i, int j, int k, Array4<Real> const& Bx,
int xlo, int ylo, int zlo,
const bool divb_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, Bx, Bx_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo);
@@ -286,7 +286,7 @@ void warpx_damp_pml_bx (int i, int j, int k, Array4<Real> const& Bx,
Bx(i,j,k,PMLComp::xz) *= sigma_fac_z[j-zlo];
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that Bx is staggered in x, while sx = 1 means that Bx is nodal in x (same for y, z)
const int sx = Bx_stag[0];
@@ -332,13 +332,13 @@ void warpx_damp_pml_by (int i, int j, int k, Array4<Real> const& By,
int xlo, int ylo, int zlo,
const bool divb_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, By, By_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo, divb_cleaning);
@@ -360,7 +360,7 @@ void warpx_damp_pml_by (int i, int j, int k, Array4<Real> const& By,
By(i,j,k,PMLComp::yz) *= sigma_fac_z[j-zlo];
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that By is staggered in x, while sx = 1 means that By is nodal in x (same for y, z)
const int sx = By_stag[0];
@@ -406,13 +406,13 @@ void warpx_damp_pml_bz (int i, int j, int k, Array4<Real> const& Bz,
int xlo, int ylo, int zlo,
const bool divb_cleaning)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, Bz, Bz_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo, divb_cleaning);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo);
@@ -437,7 +437,7 @@ void warpx_damp_pml_bz (int i, int j, int k, Array4<Real> const& Bz,
}
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that Bz is staggered in x, while sx = 1 means that Bz is nodal in x (same for y, z)
const int sx = Bz_stag[0];
@@ -482,13 +482,13 @@ void warpx_damp_pml_scalar (int i, int j, int k, Array4<Real> const& arr,
const Real* const sigma_star_fac_z,
int xlo, int ylo, int zlo)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(i, j, k, arr, arr_stag, sigma_fac_x, sigma_fac_y, sigma_fac_z,
sigma_star_fac_x, sigma_star_fac_y, sigma_star_fac_z, xlo, ylo, zlo);
amrex::Abort("PML not implemented in Cartesian 1D geometry");
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(sigma_fac_y, sigma_star_fac_y, ylo);
@@ -510,7 +510,7 @@ void warpx_damp_pml_scalar (int i, int j, int k, Array4<Real> const& arr,
arr(i,j,k,PMLComp::z) *= sigma_fac_z[j-zlo];
}
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
// sx = 0 means that arr is staggered in x, while sx = 1 means that arr is nodal in x (same for y, z)
const int sx = arr_stag[0];
diff --git a/Source/Parallelization/GuardCellManager.cpp b/Source/Parallelization/GuardCellManager.cpp
index b72e13cdc..92eaa9c85 100644
--- a/Source/Parallelization/GuardCellManager.cpp
+++ b/Source/Parallelization/GuardCellManager.cpp
@@ -109,13 +109,13 @@ guardCellManager::Init (
ngJz = std::max(ngJz,max_r);
}
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
ng_alloc_EB = IntVect(ngx,ngy,ngz);
ng_alloc_J = IntVect(ngJx,ngJy,ngJz);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
ng_alloc_EB = IntVect(ngx,ngz);
ng_alloc_J = IntVect(ngJx,ngJz);
-#elif (AMREX_SPACEDIM == 1)
+#elif defined(WARPX_DIM_1D_Z)
ng_alloc_EB = IntVect(ngz);
ng_alloc_J = IntVect(ngJz);
#endif
@@ -194,11 +194,11 @@ guardCellManager::Init (
queryWithParser(pp_psatd, "ny_guard", ngFFt_y);
queryWithParser(pp_psatd, "nz_guard", ngFFt_z);
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
IntVect ngFFT = IntVect(ngFFt_x, ngFFt_y, ngFFt_z);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
IntVect ngFFT = IntVect(ngFFt_x, ngFFt_z);
-#elif (AMREX_SPACEDIM == 1)
+#elif defined(WARPX_DIM_1D_Z)
IntVect ngFFT = IntVect(ngFFt_z);
#endif
diff --git a/Source/Parallelization/WarpXComm.cpp b/Source/Parallelization/WarpXComm.cpp
index ecaddb570..d0f7e352a 100644
--- a/Source/Parallelization/WarpXComm.cpp
+++ b/Source/Parallelization/WarpXComm.cpp
@@ -979,12 +979,12 @@ WarpX::ApplyFilterandSumBoundaryJ (int lev, PatchType patch_type)
IntVect ng_depos_J = get_ng_depos_J();
if (WarpX::do_current_centering)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
ng_depos_J[0] += WarpX::current_centering_noz / 2;
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noz / 2;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noy / 2;
ng_depos_J[2] += WarpX::current_centering_noz / 2;
@@ -1035,10 +1035,10 @@ WarpX::AddCurrentFromFineLevelandSumBoundary (int lev)
IntVect ng_depos_J = get_ng_depos_J();
if (WarpX::do_current_centering)
{
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noz / 2;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
ng_depos_J[0] += WarpX::current_centering_nox / 2;
ng_depos_J[1] += WarpX::current_centering_noy / 2;
ng_depos_J[2] += WarpX::current_centering_noz / 2;
diff --git a/Source/Parallelization/WarpXComm_K.H b/Source/Parallelization/WarpXComm_K.H
index f81f61f55..01d90ff66 100644
--- a/Source/Parallelization/WarpXComm_K.H
+++ b/Source/Parallelization/WarpXComm_K.H
@@ -87,7 +87,7 @@ void warpx_interp_nd_bfield_x (int j, int k, int l,
Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
Real owy = 1.0_rt-wy;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real bg = owx * Bxg(jg ,0,0)
@@ -101,7 +101,7 @@ void warpx_interp_nd_bfield_x (int j, int k, int l,
Real bf = 0.5_rt*(Bxf_zeropad(j-1,0,0) + Bxf_zeropad(j,0,0));
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real bg = owx * owy * Bxg(jg ,kg ,0)
@@ -177,7 +177,7 @@ void warpx_interp_nd_bfield_y (int j, int k, int l,
Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
Real owy = 1.0_rt-wy;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real bg = owx * Byg(jg ,0,0)
@@ -191,7 +191,7 @@ void warpx_interp_nd_bfield_y (int j, int k, int l,
Real bf = 0.5_rt*(Byf_zeropad(j-1,0,0) + Byf_zeropad(j,0,0));
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real bg = owx * owy * Byg(jg ,kg ,0)
@@ -269,7 +269,7 @@ void warpx_interp_nd_bfield_z (int j, int k, int l,
Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
Real owy = 1.0_rt-wy;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real bg = owx * Bzg(jg ,0,0)
@@ -283,7 +283,7 @@ void warpx_interp_nd_bfield_z (int j, int k, int l,
Real bf = Bzf_zeropad(j,0,0);
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real bg = owx * owy * Bzg(jg ,kg ,0)
@@ -360,7 +360,7 @@ void warpx_interp_nd_efield_x (int j, int k, int l,
Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
Real owy = 1.0_rt-wy;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real eg = owx * Exg(jg ,0,0)
@@ -374,7 +374,7 @@ void warpx_interp_nd_efield_x (int j, int k, int l,
Real ef = Exf_zeropad(j,0,0);
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real eg = owx * owy * Exg(jg ,kg ,0)
@@ -452,7 +452,7 @@ void warpx_interp_nd_efield_y (int j, int k, int l,
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real eg = owx * Eyg(jg ,0,0)
@@ -466,7 +466,7 @@ void warpx_interp_nd_efield_y (int j, int k, int l,
Real ef = Eyf_zeropad(j,0,0);
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real eg = owx * owy * Eyg(jg ,kg ,0)
@@ -541,7 +541,7 @@ void warpx_interp_nd_efield_z (int j, int k, int l,
Real wy = (k == kg*2) ? 0.0_rt : 0.5_rt;
Real owy = 1.0_rt-wy;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// interp from coarse nodal to fine nodal
Real eg = owx * Ezg(jg ,0,0)
@@ -555,7 +555,7 @@ void warpx_interp_nd_efield_z (int j, int k, int l,
Real ef = 0.5_rt*(Ezf_zeropad(j-1,0,0) + Ezf_zeropad(j,0,0));
amrex::ignore_unused(owy);
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
// interp from coarse nodal to fine nodal
Real eg = owx * owy * Ezg(jg ,kg ,0)
@@ -654,10 +654,10 @@ void warpx_interp (const int j,
};
// Avoid compiler warnings
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(nox, noy, stencil_coeffs_x, stencil_coeffs_y);
#endif
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::ignore_unused(noy, stencil_coeffs_y);
#endif
@@ -678,7 +678,7 @@ void warpx_interp (const int j,
#if (AMREX_SPACEDIM >= 2)
const int sk = (dst_nodal) ? src_stag[1] : dst_stag[1];
#endif
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
const int sl = (dst_nodal) ? src_stag[2] : dst_stag[2];
#endif
@@ -687,16 +687,16 @@ void warpx_interp (const int j,
#if (AMREX_SPACEDIM >= 2)
const bool interp_k = (sk == 0);
#endif
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
const bool interp_l = (sl == 0);
#endif
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
const int noj = noz;
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
const int noj = nox;
const int nok = noz;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
const int noj = nox;
const int nok = noy;
const int nol = noz;
@@ -704,13 +704,13 @@ void warpx_interp (const int j,
// Additional normalization factor
const amrex::Real wj = (interp_j) ? 0.5_rt : 1.0_rt;
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
constexpr amrex::Real wk = 1.0_rt;
constexpr amrex::Real wl = 1.0_rt;
-#elif (AMREX_SPACEDIM == 2)
+#elif defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
const amrex::Real wk = (interp_k) ? 0.5_rt : 1.0_rt;
constexpr amrex::Real wl = 1.0_rt;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
const amrex::Real wk = (interp_k) ? 0.5_rt : 1.0_rt;
const amrex::Real wl = (interp_l) ? 0.5_rt : 1.0_rt;
#endif
@@ -720,7 +720,7 @@ void warpx_interp (const int j,
const int jmax = (interp_j) ? j + noj/2 + shift - 1 : j;
// Min and max for interpolation loop along k
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
// k = 0 always
const int kmin = k;
const int kmax = k;
@@ -734,7 +734,7 @@ void warpx_interp (const int j,
// l = 0 always
const int lmin = l;
const int lmax = l;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
const int lmin = (interp_l) ? l - nol/2 + shift : l;
const int lmax = (interp_l) ? l + nol/2 + shift - 1 : l;
#endif
@@ -802,7 +802,7 @@ void warpx_interp (const int j,
else // PSATD (finite-order interpolation)
{
-#if (AMREX_SPACEDIM == 1)
+#if defined(WARPX_DIM_1D_Z)
amrex::ignore_unused(stencil_coeffs_z);
amrex::Abort("PSATD not implemented in 1D");
#endif
@@ -813,16 +813,16 @@ void warpx_interp (const int j,
amrex::Real cl = 1.0_rt;
amrex::Real const* scj = stencil_coeffs_x;
-#if (AMREX_SPACEDIM == 2)
+#if defined(WARPX_DIM_XZ) || defined(WARPX_DIM_RZ)
amrex::Real const* sck = stencil_coeffs_z;
-#elif (AMREX_SPACEDIM == 3)
+#elif defined(WARPX_DIM_3D)
amrex::Real const* sck = stencil_coeffs_y;
amrex::Real const* scl = stencil_coeffs_z;
#endif
for (int ll = 0; ll <= nl; ll++)
{
-#if (AMREX_SPACEDIM == 3)
+#if defined(WARPX_DIM_3D)
if (interp_l) cl = scl[ll];
#endif
for (int kk = 0; kk <= nk; kk++)