Skip to content

Commit 4117150

Browse files
committed
Further clean up of macros
1 parent a933faf commit 4117150

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Source/Filter/Filter.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ void Filter::DoFilter (const Box& tbx,
9898
#if AMREX_SPACEDIM >= 2
9999
amrex::Real const* AMREX_RESTRICT sy = stencil_y.data();
100100
#endif
101-
#if defined(WARPX_DIM_3D)
101+
#if AMREX_SPACEDIM == 3
102102
amrex::Real const* AMREX_RESTRICT sz = stencil_z.data();
103103
#endif
104104
Dim3 slen_local = slen;
105105

106-
#if defined(WARPX_DIM_3D)
106+
#if AMREX_SPACEDIM == 3
107107
AMREX_PARALLEL_FOR_4D ( tbx, ncomp, i, j, k, n,
108108
{
109109
Real d = 0.0;
@@ -279,10 +279,10 @@ void Filter::DoFilter (const Box& tbx,
279279
const auto hi = amrex::ubound(tbx);
280280
// tmp and dst are of type Array4 (Fortran ordering)
281281
amrex::Real const* AMREX_RESTRICT sx = stencil_x.data();
282-
#if (AMREX_SPACEDIM >= 2)
282+
#if AMREX_SPACEDIM >= 2
283283
amrex::Real const* AMREX_RESTRICT sy = stencil_y.data();
284284
#endif
285-
#if defined(WARPX_DIM_3D)
285+
#if AMREX_SPACEDIM == 3
286286
amrex::Real const* AMREX_RESTRICT sz = stencil_z.data();
287287
#endif
288288
for (int n = 0; n < ncomp; ++n) {
@@ -298,19 +298,19 @@ void Filter::DoFilter (const Box& tbx,
298298
for (int iz=0; iz < slen.z; ++iz){
299299
for (int iy=0; iy < slen.y; ++iy){
300300
for (int ix=0; ix < slen.x; ++ix){
301-
#if defined(WARPX_DIM_3D)
301+
#if AMREX_SPACEDIM == 3
302302
const Real sss = sx[ix]*sy[iy]*sz[iz];
303-
#elif (AMREX_SPACEDIM >= 2)
303+
#elif AMREX_SPACEDIM >= 2
304304
const Real sss = sx[ix]*sy[iy];
305-
#elif (AMREX_SPACEDIM == 1)
305+
#elif AMREX_SPACEDIM == 1
306306
const Real sss = sx[ix];
307307
#endif
308308
// 3 nested loop on 3D array
309309
for (int k = lo.z; k <= hi.z; ++k) {
310310
for (int j = lo.y; j <= hi.y; ++j) {
311311
AMREX_PRAGMA_SIMD
312312
for (int i = lo.x; i <= hi.x; ++i) {
313-
#if defined(WARPX_DIM_3D)
313+
#if AMREX_SPACEDIM == 3
314314
dst(i,j,k,dcomp+n) += sss*(tmp(i-ix,j-iy,k-iz,scomp+n)
315315
+tmp(i+ix,j-iy,k-iz,scomp+n)
316316
+tmp(i-ix,j+iy,k-iz,scomp+n)
@@ -319,7 +319,7 @@ void Filter::DoFilter (const Box& tbx,
319319
+tmp(i+ix,j-iy,k+iz,scomp+n)
320320
+tmp(i-ix,j+iy,k+iz,scomp+n)
321321
+tmp(i+ix,j+iy,k+iz,scomp+n));
322-
#elif (AMREX_SPACEDIM >= 2)
322+
#elif AMREX_SPACEDIM >= 2
323323
dst(i,j,k,dcomp+n) += sss*(tmp(i-ix,j-iy,k,scomp+n)
324324
+tmp(i+ix,j-iy,k,scomp+n)
325325
+tmp(i-ix,j+iy,k,scomp+n)

0 commit comments

Comments
 (0)