Skip to content

Commit 84bd015

Browse files
authored
Add test on whether we are in the valid box when updating drho_as_crs… (#3506)
…e in StateRedistribute -- this is analogous to the test on 'inside' in FluxRedistribute
1 parent 0f59c07 commit 84bd015

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Src/EB/AMReX_EB_StateRedistribute.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,19 @@ MLStateRedistribute ( Box const& bx, int ncomp,
302302

303303
if (as_crse) {
304304

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

312-
// Uncovered to covered
313-
if (flag_as_crse( r, s, t) == amrex_yafluxreg_fine_cell &&
314-
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_crse_fine_boundary_cell &&
315-
bx.contains(IntVect(AMREX_D_DECL(ii,jj,kk)))) {
313+
// Uncovered (by fine) to covered (by fine)
314+
if ( bx.contains(IntVect(AMREX_D_DECL(ii,jj,kk))) &&
315+
flag_as_crse( r, s, t) == amrex_yafluxreg_fine_cell &&
316+
flag_as_crse(ii,jj,kk) == amrex_yafluxreg_crse_fine_boundary_cell )
317+
{
316318
drho_as_crse(ii,jj,kk,n) += fac * update / nrs(r,s,t) *
317319
(vfrac(r,s,t) / vfrac(ii,jj,kk)) * fac_for_deltaR;
318320
}

0 commit comments

Comments
 (0)