Skip to content

Commit 232a1cd

Browse files
committed
fix 1D build
1 parent 939e73c commit 232a1cd

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/io/projection.hpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "AMReX_MultiFab.H"
1818
#include "AMReX_MultiFabUtil.H"
1919
#include "AMReX_Orientation.H"
20+
#include "AMReX_SPACE.H"
2021
#include "AMReX_VisMF.H"
2122
#include <AMReX.H>
2223

@@ -110,11 +111,17 @@ auto ComputePlaneProjection(amrex::Vector<amrex::MultiFab> const &state_new, con
110111
auto const proj_arr = projections[lev].arrays();
111112
amrex::ParallelFor(projections[lev], [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) {
112113
if (dir == amrex::Direction::x) {
113-
proj_arr[bx](i, j, k) = plane_arr(0, i, j);
114+
proj_arr[bx](i, j, k) = plane_arr(AMREX_D_DECL(0, i, j));
115+
#if AMREX_SPACEDIM >= 2
114116
} else if (dir == amrex::Direction::y) {
115-
proj_arr[bx](i, j, k) = plane_arr(i, 0, j);
117+
proj_arr[bx](i, j, k) = plane_arr(AMREX_D_DECL(i, 0, j));
118+
#endif
119+
#if AMREX_SPACEDIM == 3
120+
} else if (dir == amrex::Direction::z) {
121+
proj_arr[bx](i, j, k) = plane_arr(AMREX_D_DECL(i, j, 0));
122+
#endif
116123
} else {
117-
proj_arr[bx](i, j, k) = plane_arr(i, j, k);
124+
proj_arr[bx](i, j, k) = 0.0;
118125
}
119126
});
120127
amrex::Gpu::streamSynchronize();

0 commit comments

Comments
 (0)