From 4ced9076a98db22e333f2c0c7acb81d48673f64f Mon Sep 17 00:00:00 2001 From: Ian Hinder Date: Fri, 27 May 2011 11:20:05 +0200 Subject: GenericFD.c: Add GenericFD_GetBoundaryWidths Based on the existing GetBoundaryWidth but returning all the widths. GetBoundaryWidth now calls the new function. --- .../KrancNumericalTools/GenericFD/src/GenericFD.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Auxiliary/Cactus') diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c index e418cc6..3f34e54 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c @@ -59,11 +59,10 @@ int sgn(CCTK_REAL x) return 0; } -int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH) +void GenericFD_GetBoundaryWidths(cGH const * restrict const cctkGH, int nboundaryzones[6]) { int is_internal[6]; int is_staggered[6]; - int nboundaryzones[6]; int shiftout[6]; int ierr = -1; @@ -72,8 +71,15 @@ int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH) /* This doesn't make sense in level mode */ if (map < 0) { -// CCTK_WARN(1, "Could not determine current map"); - return 0; + static int have_warned = 0; + if (!have_warned) + { + CCTK_WARN(1, "GenericFD_GetBoundaryWidths: Could not determine current map (can be caused by calling in LEVEL mode)"); + have_warned = 1; + } + for (int i = 0; i < 6; i++) + nboundaryzones[i] = 0; + return; } ierr = MultiPatch_GetBoundarySpecification (map, 6, nboundaryzones, is_internal, is_staggered, shiftout); @@ -87,6 +93,12 @@ int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH) } else { CCTK_WARN(0, "Could not obtain boundary specification"); } +} + +int GenericFD_GetBoundaryWidth(cGH const * restrict const cctkGH) +{ + int nboundaryzones[6]; + GenericFD_GetBoundaryWidths(cctkGH, nboundaryzones); int bw = nboundaryzones[0]; -- cgit v1.2.3