diff --git a/Source/hydro/Castro_ctu_hydro.cpp b/Source/hydro/Castro_ctu_hydro.cpp index 499c10409d..22cc0dcbb0 100644 --- a/Source/hydro/Castro_ctu_hydro.cpp +++ b/Source/hydro/Castro_ctu_hydro.cpp @@ -205,12 +205,12 @@ Castro::construct_ctu_hydro_source(Real time, Real dt) Array4 const U_old_arr = Sborder.array(mfi); - rho_inv.resize(qbx3, 1); + rho_inv.resize(qbx, 1); Elixir elix_rho_inv = rho_inv.elixir(); fab_size += rho_inv.nBytes(); Array4 const rho_inv_arr = rho_inv.array(); - amrex::ParallelFor(qbx3, + amrex::ParallelFor(qbx, [=] AMREX_GPU_HOST_DEVICE (int i, int j, int k) { rho_inv_arr(i,j,k) = 1.0 / U_old_arr(i,j,k,URHO); diff --git a/Source/hydro/reconstruction.H b/Source/hydro/reconstruction.H index 1569e7a011..07b47989ad 100644 --- a/Source/hydro/reconstruction.H +++ b/Source/hydro/reconstruction.H @@ -62,25 +62,31 @@ load_passive_stencil(Array4 const& U_arr, Array4 const& using namespace reconstruction; if (idir == 0) { + s[im3] = U_arr(i-3,j,k,ncomp) * rho_inv_arr(i-3,j,k); s[im2] = U_arr(i-2,j,k,ncomp) * rho_inv_arr(i-2,j,k); s[im1] = U_arr(i-1,j,k,ncomp) * rho_inv_arr(i-1,j,k); s[i0] = U_arr(i,j,k,ncomp) * rho_inv_arr(i,j,k); s[ip1] = U_arr(i+1,j,k,ncomp) * rho_inv_arr(i+1,j,k); s[ip2] = U_arr(i+2,j,k,ncomp) * rho_inv_arr(i+2,j,k); + s[ip3] = U_arr(i+3,j,k,ncomp) * rho_inv_arr(i+3,j,k); } else if (idir == 1) { + s[im3] = U_arr(i,j-3,k,ncomp) * rho_inv_arr(i,j-3,k); s[im2] = U_arr(i,j-2,k,ncomp) * rho_inv_arr(i,j-2,k); s[im1] = U_arr(i,j-1,k,ncomp) * rho_inv_arr(i,j-1,k); s[i0] = U_arr(i,j,k,ncomp) * rho_inv_arr(i,j,k); s[ip1] = U_arr(i,j+1,k,ncomp) * rho_inv_arr(i,j+1,k); s[ip2] = U_arr(i,j+2,k,ncomp) * rho_inv_arr(i,j+2,k); + s[ip3] = U_arr(i,j+3,k,ncomp) * rho_inv_arr(i,j+3,k); } else { + s[im3] = U_arr(i,j,k-3,ncomp) * rho_inv_arr(i,j,k-3); s[im2] = U_arr(i,j,k-2,ncomp) * rho_inv_arr(i,j,k-2); s[im1] = U_arr(i,j,k-1,ncomp) * rho_inv_arr(i,j,k-1); s[i0] = U_arr(i,j,k,ncomp) * rho_inv_arr(i,j,k); s[ip1] = U_arr(i,j,k+1,ncomp) * rho_inv_arr(i,j,k+1); s[ip2] = U_arr(i,j,k+2,ncomp) * rho_inv_arr(i,j,k+2); + s[ip3] = U_arr(i,j,k+3,ncomp) * rho_inv_arr(i,j,k+3); }