aboutsummaryrefslogtreecommitdiff
path: root/Auxiliary/Cactus
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2011-05-27 11:20:05 +0200
committerIan Hinder <ian.hinder@aei.mpg.de>2011-05-27 16:22:27 +0200
commit4ced9076a98db22e333f2c0c7acb81d48673f64f (patch)
tree859dbefeab5a42779f239733d4870f0eea585369 /Auxiliary/Cactus
parent431c5d7df8af4fcde2821987b69479ad6cdf1303 (diff)
GenericFD.c: Add GenericFD_GetBoundaryWidths
Based on the existing GetBoundaryWidth but returning all the widths. GetBoundaryWidth now calls the new function.
Diffstat (limited to 'Auxiliary/Cactus')
-rw-r--r--Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/GenericFD.c20
1 files changed, 16 insertions, 4 deletions
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];