diff --git a/Src/Particle/AMReX_NeighborParticlesI.H b/Src/Particle/AMReX_NeighborParticlesI.H index a85a9faf7a..9f3e9522bd 100644 --- a/Src/Particle/AMReX_NeighborParticlesI.H +++ b/Src/Particle/AMReX_NeighborParticlesI.H @@ -1054,9 +1054,9 @@ selectActualNeighbors (CheckPair const& check_pair, int num_cells) int nz = hi.z-lo.z+1; bool isActualNeighbor = false; - for (int ii = amrex::max(ix-num_cells, 0); ii <= amrex::min(ix+num_cells, nx); ++ii) { - for (int jj = amrex::max(iy-num_cells, 0); jj <= amrex::min(iy+num_cells, ny); ++jj) { - for (int kk = amrex::max(iz-num_cells, 0); kk <= amrex::min(iz+num_cells, nz); ++kk) { + for (int ii = amrex::max(ix-num_cells, 0); ii <= amrex::min(ix+num_cells, nx-1); ++ii) { + for (int jj = amrex::max(iy-num_cells, 0); jj <= amrex::min(iy+num_cells, ny-1); ++jj) { + for (int kk = amrex::max(iz-num_cells, 0); kk <= amrex::min(iz+num_cells, nz-1); ++kk) { if (isActualNeighbor) { break; } int nbr_cell_id = (ii * ny + jj) * nz + kk; for (auto p = poffset[nbr_cell_id]; p < poffset[nbr_cell_id+1]; ++p) { diff --git a/Tests/Particles/NeighborParticles/CMakeLists.txt b/Tests/Particles/NeighborParticles/CMakeLists.txt index 2be1cc61c2..a346b96f7c 100644 --- a/Tests/Particles/NeighborParticles/CMakeLists.txt +++ b/Tests/Particles/NeighborParticles/CMakeLists.txt @@ -1,7 +1,4 @@ foreach(D IN LISTS AMReX_SPACEDIM) - if (D EQUAL 1) - continue() - endif () set(_sources CheckPair.H Constants.H main.cpp MDParticleContainer.cpp MDParticleContainer.H )