Skip to content

Commit

Permalink
do rdtheta correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Sep 17, 2024
1 parent 0ff40ae commit 579d949
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2885,9 +2885,19 @@ Castro::reflux (int crse_level, int fine_level, bool in_post_timestep)
reg = &getLevel(lev).pres_reg;

MultiFab rdtheta(crse_lev.grids, crse_lev.dmap, 1, 0);
rdtheta.setVal(crse_lev.geom.CellSize(1));

// Need to multiply by r for rdtheta
auto problo = Geom().ProbLo();
auto dr = crse_lev.geom.CellSize(0);
auto dtheta = crse_lev.geom.CellSize(1);

auto const& ma = rdtheta.arrays();

amrex:ParallelFor(rdtheta,
[=] AMREX_GPU_DEVICE (int b, int i, int j, int k) noexcept
{
Real r = problo[0] + static_cast<Real>(i + 0.5_rt) * dr;
ma[b](i,j,k) = r * dtheta;
});

reg->ClearInternalBorders(crse_lev.geom);

Expand Down

0 comments on commit 579d949

Please sign in to comment.