diff options
-rw-r--r-- | src/stencil.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/stencil.c b/src/stencil.c index ca837c6..0f83615 100644 --- a/src/stencil.c +++ b/src/stencil.c @@ -20,6 +20,7 @@ void SBP_determine_onesided_stencil (const cGH * cctkGH, int * onesided) int symtable; int mp_sym_handle; CCTK_INT symbnd[6]; + CCTK_INT bbox[6]; int ierr; int d; @@ -32,17 +33,28 @@ void SBP_determine_onesided_stencil (const cGH * cctkGH, int * onesided) if (ierr!=6) { CCTK_WARN(0,"Cannot get symmetry handles"); } - + mp_sym_handle = SymmetryHandleOfName ( "multipatch" ); + if (mp_sym_handle >= 0) { + /* We are using a multi-patch system */ + ierr = MultiPatch_GetBbox (cctkGH, 6, bbox); + if (ierr) { + CCTK_WARN(0,"Cannot get multi-patch bbox information"); + } + } + for (d=0; d<6; ++d) { if (! cctkGH->cctk_bbox[d]) { /* This is an inter-processor boundary */ onesided[d] = 0; } else { - /* On an outer boundary (which is not a symmetry boundary), - symbnd < 0 */ - if (symbnd[d] < 0) { + /* On an outer boundary (which is not a symmetry boundary), it + is either symbnd < 0, or it is a boundary claimed by the MP + infrastructure and bbox != 0 */ + if (symbnd[d] < 0 || + (mp_sym_handle >= 0 && symbnd[d] == mp_sym_handle && bbox[d])) + { /* Use one-sided stencils near outer boundaries if the user wants it so */ onesided[d] = onesided_outer_boundaries; |