From 5830bdcd579d4386e34686916298d0f0e4d3e22c Mon Sep 17 00:00:00 2001 From: Ann Almgren Date: Wed, 28 Aug 2024 20:12:22 -0700 Subject: [PATCH] fix the solvability enforcement when we have multiple grids on a face --- Utils/hydro_enforce_inout_solvability.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Utils/hydro_enforce_inout_solvability.cpp b/Utils/hydro_enforce_inout_solvability.cpp index 3a73f0e0c..cd8ee5fa3 100644 --- a/Utils/hydro_enforce_inout_solvability.cpp +++ b/Utils/hydro_enforce_inout_solvability.cpp @@ -69,8 +69,22 @@ void set_inout_masks( // include boundary corners if specified if (corners) { - box.grow((dir+1)%AMREX_SPACEDIM, 1); - box.grow((dir+2)%AMREX_SPACEDIM, 1); + int tang_dir_1 = (dir+1)%AMREX_SPACEDIM; + if (box.smallEnd(tang_dir_1) == domain.smallEnd(tang_dir_1)) { + box.growLo(tang_dir_1,1); + } + if (box.bigEnd(tang_dir_1) == domain.bigEnd(tang_dir_1)) { + box.growHi(tang_dir_1,1); + } +#if (AMREX_SPACEDIM == 3) + int tang_dir_2 = (dir+2)%AMREX_SPACEDIM; + if (box.smallEnd(tang_dir_2) == domain.smallEnd(tang_dir_2)) { + box.growLo(tang_dir_2,1); + } + if (box.bigEnd(tang_dir_2) == domain.bigEnd(tang_dir_2)) { + box.growHi(tang_dir_2,1); + } +#endif } // Enter further only if the box bndry is at the domain bndry