diff options
Diffstat (limited to 'src/call_derivs.c')
-rw-r--r-- | src/call_derivs.c | 55 |
1 files changed, 11 insertions, 44 deletions
diff --git a/src/call_derivs.c b/src/call_derivs.c index 5dd4530..22d6527 100644 --- a/src/call_derivs.c +++ b/src/call_derivs.c @@ -5,28 +5,7 @@ #include "util_ErrorCodes.h" #include "util_Table.h" - - -/* Determine whether a boundary with the symmetry handle symbnd is a - "regular" symmetry boundary (where the SBP stencils should not be - modified), or an outer boundary (or a multi-block boundary), where - the SBP stencils need to be modified. */ -static int is_regular_symbnd (int const symbnd, int const pen_sym_handle) -{ - /* On an outer boundary (which is not a symmetry boundary), symbnd < - 0. */ - if (symbnd < 0) return 0; - - if (pen_sym_handle >= 0) { - /* If the symmetry boundary is a multi-block boundary, then symbnd - = pen_sym_handle. However, we can only check that if thorn - MultiPatch is active, i.e., if pen_sym_handle >= 0. */ - if (symbnd == pen_sym_handle) return 0; - } - - /* This is a "regular" symmetry boundary. */ - return 1; -} +#include "stencil.h" @@ -38,12 +17,10 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, DECLARE_CCTK_PARAMETERS DECLARE_CCTK_ARGUMENTS - CCTK_INT ni, nj, nk, gsize, ic, loc_order,i; + CCTK_INT ni, nj, nk, gsize, loc_order; CCTK_REAL delta; - CCTK_INT ierr; - CCTK_INT lsh[3], bbox[6], bb[2], nghostzones[3]; - CCTK_INT symtable, pen_sym_handle; - CCTK_INT symbnd[6]; + CCTK_INT bb[2]; + int onesided[6]; int nelements; void CCTK_FCALL CCTK_FNAME(deriv_gf_2_1)(const CCTK_REAL *var, @@ -151,37 +128,27 @@ void DiffGv ( const CCTK_POINTER_TO_CONST cctkGH_, const CCTK_INT dir, loc_order = order; } - symtable = SymmetryTableHandleForGrid (cctkGH); - if (symtable<0) { - CCTK_WARN(0,"symtable is out of bounds"); - } - - ierr = Util_TableGetIntArray (symtable, 6, symbnd, "symmetry_handle"); - if (ierr!=6) { - CCTK_WARN(0,"Util_TableGetIntArray returned error"); - } - - pen_sym_handle = SymmetryHandleOfName ( "multipatch" ); + SBP_determine_onesided_stencil (cctkGH, onesided); switch(dir) { case 0: { delta = CCTK_DELTA_SPACE(0); - bb[0] = cctk_bbox[0] && ! is_regular_symbnd (symbnd[0], pen_sym_handle); - bb[1] = cctk_bbox[1] && ! is_regular_symbnd (symbnd[1], pen_sym_handle); + bb[0] = onesided[0]; + bb[1] = onesided[1]; gsize = cctk_nghostzones[0]; break; } case 1: { delta = CCTK_DELTA_SPACE(1); - bb[0] = cctk_bbox[2] && ! is_regular_symbnd (symbnd[2], pen_sym_handle); - bb[1] = cctk_bbox[3] && ! is_regular_symbnd (symbnd[3], pen_sym_handle); + bb[0] = onesided[2]; + bb[1] = onesided[3]; gsize = cctk_nghostzones[1]; break; } case 2: { delta = CCTK_DELTA_SPACE(2); - bb[0] = cctk_bbox[4] && ! is_regular_symbnd (symbnd[4], pen_sym_handle); - bb[1] = cctk_bbox[5] && ! is_regular_symbnd (symbnd[5], pen_sym_handle); + bb[0] = onesided[4]; + bb[1] = onesided[5]; gsize = cctk_nghostzones[2]; break; } |