Skip to content

Commit

Permalink
fix composition
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed May 30, 2023
1 parent c083e3d commit c989b5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/hydro/Castro_ctu_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ Castro::construct_ctu_hydro_source(Real time, Real dt)

Array4<Real const> 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<Real> 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);
Expand Down
6 changes: 6 additions & 0 deletions Source/hydro/reconstruction.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,31 @@ load_passive_stencil(Array4<Real const> const& U_arr, Array4<Real const> 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);

}

Expand Down

0 comments on commit c989b5d

Please sign in to comment.