From 89c9763e934ded42082f73a94b8fc5fdb33b098c Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Fri, 4 Aug 2023 17:11:45 -0700 Subject: [PATCH] fix bounds for loops for 2D EBGodunov --- Source/Hydro/Godunov/Godunov_2D_eb.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Hydro/Godunov/Godunov_2D_eb.cpp b/Source/Hydro/Godunov/Godunov_2D_eb.cpp index bdd99433..7c2c2c47 100644 --- a/Source/Hydro/Godunov/Godunov_2D_eb.cpp +++ b/Source/Hydro/Godunov/Godunov_2D_eb.cpp @@ -183,7 +183,7 @@ Godunov_umeth_eb ( // X interface corrections // ******************************************************************************* cdir = 0; - const Box& tybx = grow(bx_to_fill, cdir, 1); + const Box& tybx = grow(bx_to_fill, 1); FArrayBox qm(bxg2, QVAR, amrex::The_Async_Arena()); FArrayBox qp(bxg1, QVAR, amrex::The_Async_Arena()); auto const& qmarr = qm.array(); @@ -197,7 +197,9 @@ Godunov_umeth_eb ( } }); - const Box& xfxbx = surroundingNodes(bx_to_fill, cdir); + // This box must be grown by one in transverse direction so we can + // do tangential interpolation when taking divergence later + const Box& xfxbx = surroundingNodes( grow(bx_to_fill, 1, 1-cdir), cdir); // Final Riemann problem X ParallelFor(xfxbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept @@ -212,7 +214,7 @@ Godunov_umeth_eb ( // Y interface corrections // ******************************************************************************* cdir = 1; - const Box& txbx = grow(bx_to_fill, cdir, 1); + const Box& txbx = grow(bx_to_fill, 1); ParallelFor(txbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { @@ -222,8 +224,11 @@ Godunov_umeth_eb ( } }); + // This box must be grown by one in transverse direction so we can + // do tangential interpolation when taking divergence later + const Box& yfxbx = surroundingNodes( grow(bx_to_fill, 1, 1-cdir), cdir); + // Final Riemann problem Y - const Box& yfxbx = surroundingNodes(bx_to_fill, cdir); ParallelFor(yfxbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { if (!flag_arr(i,j,k).isCovered() && !flag_arr(i,j-1,k).isCovered()) {