aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2007-08-23 23:13:43 +0000
committerschnetter <schnetter@40f6ab95-0e4f-0410-8daa-ee8d7420be1d>2007-08-23 23:13:43 +0000
commit921333dfb7a1a886159e648a75aef070cbe8497c (patch)
treebfde23de5933f557a05ddb267f30230d88a15da5
parentf3db0bdf01c05888ca41a5fe35284e8b0c8c1d73 (diff)
Check consistency of spherical surfaces at every iteration
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@27 40f6ab95-0e4f-0410-8daa-ee8d7420be1d
-rw-r--r--schedule.ccl6
-rw-r--r--src/check.c32
-rw-r--r--src/make.code.defn2
3 files changed, 39 insertions, 1 deletions
diff --git a/schedule.ccl b/schedule.ccl
index a4aac33..b3f5386 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -22,6 +22,12 @@ SCHEDULE GROUP SphericalSurface_HasBeenSet AT poststep
{
} "Set the spherical surfaces before this group, and use it afterwards"
+ SCHEDULE SphericalSurface_CheckState IN SphericalSurface_HasBeenSet
+ {
+ LANG: C
+ OPTIONS: global
+ } "Test the state of the spherical surfaces"
+
SCHEDULE SphericalSurface_Set AT poststep BEFORE SphericalSurface_HasBeenSet
diff --git a/src/check.c b/src/check.c
new file mode 100644
index 0000000..f1e35c4
--- /dev/null
+++ b/src/check.c
@@ -0,0 +1,32 @@
+/* $Header$ */
+
+#include <assert.h>
+#include <math.h>
+#include <stdio.h>
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+
+
+void SphericalSurface_CheckState (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ int n;
+
+ for (n=0; n<nsurfaces; ++n) {
+
+ if (sf_valid[n] > 0 && sf_active[n] == 0) {
+
+ CCTK_VWarn (CCTK_WARN_ABORT, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Surface #%d has sf_valid set to a positive value, but does "
+ "not have sf_active set. This is an error in the thorn "
+ "which calculated this surface", n);
+
+ }
+
+ }
+}
diff --git a/src/make.code.defn b/src/make.code.defn
index d394b7c..e1cb6e1 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = radius.c setup.c
+SRCS = check.c radius.c setup.c
# Subdirectories containing source files
SUBDIRS =