From 361c9543072446a1e6b1e766a7fe00522b7d7421 Mon Sep 17 00:00:00 2001 From: schnetter Date: Thu, 17 Apr 2008 04:47:15 +0000 Subject: Determine correctly which boundaries are outer boundaries when off-centring the stencil, if multi-patch is used git-svn-id: https://svn.cct.lsu.edu/repos/numrel/LSUThorns/SummationByParts/trunk@102 f69c4107-0314-4c4f-9ad4-17e986b73f4a --- src/stencil.c | 20 ++++++++++++++++---- 1 file 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; -- cgit v1.2.3