Skip to content

Commit

Permalink
Add test on whether we are in the valid box when updating drho_as_crs… (
Browse files Browse the repository at this point in the history
#3506)

…e in StateRedistribute -- this is analogous to the test on 'inside' in
FluxRedistribute
  • Loading branch information
asalmgren authored Aug 22, 2023
1 parent 0f59c07 commit 84bd015
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Src/EB/AMReX_EB_StateRedistribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,19 @@ MLStateRedistribute ( Box const& bx, int ncomp,

if (as_crse) {

// Covered to uncovered
if (flag_as_crse( r, s, t) == amrex_yafluxreg_crse_fine_boundary_cell &&
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_fine_cell &&
bx.contains(IntVect(AMREX_D_DECL(r,s,t)))) {
// Covered (by fine) to uncovered (by fine)
if ( bx.contains(IntVect(AMREX_D_DECL(r,s,t))) &&
flag_as_crse( r, s, t) == amrex_yafluxreg_crse_fine_boundary_cell &&
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_fine_cell )
{
drho_as_crse(r,s,t,n) -= fac*update/nrs(r,s,t) * fac_for_deltaR;
}

// Uncovered to covered
if (flag_as_crse( r, s, t) == amrex_yafluxreg_fine_cell &&
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_crse_fine_boundary_cell &&
bx.contains(IntVect(AMREX_D_DECL(ii,jj,kk)))) {
// Uncovered (by fine) to covered (by fine)
if ( bx.contains(IntVect(AMREX_D_DECL(ii,jj,kk))) &&
flag_as_crse( r, s, t) == amrex_yafluxreg_fine_cell &&
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_crse_fine_boundary_cell )
{
drho_as_crse(ii,jj,kk,n) += fac * update / nrs(r,s,t) *
(vfrac(r,s,t) / vfrac(ii,jj,kk)) * fac_for_deltaR;
}
Expand Down

0 comments on commit 84bd015

Please sign in to comment.