aboutsummaryrefslogtreecommitdiff
path: root/ML_Kretschmann_Helper
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-11-04 12:01:10 +0100
committerAnton Khirnov <anton@khirnov.net>2013-10-29 11:36:48 +0100
commite300b9133176701f5279f56fc380baabfa6ced8b (patch)
tree23d18dea6f267a28bbcb531cb59a82f7cfcd9056 /ML_Kretschmann_Helper
parentfa56b7f58ef3c4824977d253d89bba2bea1593c7 (diff)
Add a thorn for computing the Kretschmann scalar.
Diffstat (limited to 'ML_Kretschmann_Helper')
-rw-r--r--ML_Kretschmann_Helper/configuration.ccl1
-rw-r--r--ML_Kretschmann_Helper/interface.ccl3
-rw-r--r--ML_Kretschmann_Helper/param.ccl0
-rw-r--r--ML_Kretschmann_Helper/schedule.ccl5
-rw-r--r--ML_Kretschmann_Helper/src/SetGroupTags.c46
-rw-r--r--ML_Kretschmann_Helper/src/make.code.defn2
6 files changed, 57 insertions, 0 deletions
diff --git a/ML_Kretschmann_Helper/configuration.ccl b/ML_Kretschmann_Helper/configuration.ccl
new file mode 100644
index 0000000..edaa5b7
--- /dev/null
+++ b/ML_Kretschmann_Helper/configuration.ccl
@@ -0,0 +1 @@
+REQUIRES THORNS: CartGrid3D CoordGauge
diff --git a/ML_Kretschmann_Helper/interface.ccl b/ML_Kretschmann_Helper/interface.ccl
new file mode 100644
index 0000000..ded78e0
--- /dev/null
+++ b/ML_Kretschmann_Helper/interface.ccl
@@ -0,0 +1,3 @@
+IMPLEMENTS: ML_Kretschmann_Helper
+
+INHERITS: ADMBase CoordGauge ML_Kretschmann
diff --git a/ML_Kretschmann_Helper/param.ccl b/ML_Kretschmann_Helper/param.ccl
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/ML_Kretschmann_Helper/param.ccl
diff --git a/ML_Kretschmann_Helper/schedule.ccl b/ML_Kretschmann_Helper/schedule.ccl
new file mode 100644
index 0000000..09e44d3
--- /dev/null
+++ b/ML_Kretschmann_Helper/schedule.ccl
@@ -0,0 +1,5 @@
+SCHEDULE ML_Kretschmann_SetGroupTags AT startup BEFORE Driver_Startup
+{
+ LANG: C
+ OPTIONS: meta
+} "Set checkpointing and prolongation group tags"
diff --git a/ML_Kretschmann_Helper/src/SetGroupTags.c b/ML_Kretschmann_Helper/src/SetGroupTags.c
new file mode 100644
index 0000000..5bf2bf4
--- /dev/null
+++ b/ML_Kretschmann_Helper/src/SetGroupTags.c
@@ -0,0 +1,46 @@
+#include <cctk.h>
+#include <cctk_Parameters.h>
+#include <util_Table.h>
+
+#include <assert.h>
+
+static void set_group_tags (int const checkpoint, int const persistent,
+ int const prolongate, char const * restrict const gn)
+{
+ assert (gn);
+
+ int const gi = CCTK_GroupIndex(gn);
+ assert (gi >= 0);
+
+ int const table = CCTK_GroupTagsTableI(gi);
+ assert(table >= 0);
+
+ if (!checkpoint) {
+ int const ierr = Util_TableSetString (table, "no", "Checkpoint");
+ assert (!ierr);
+ }
+
+ if (!persistent) {
+ int const ierr = Util_TableSetString (table, "no", "Persistent");
+ assert (!ierr);
+ }
+
+ if (!prolongate) {
+ int const iret = Util_TableDeleteKey (table, "ProlongationParameter");
+ assert (iret == 0 || iret == UTIL_ERROR_TABLE_NO_SUCH_KEY);
+ int const ierr = Util_TableSetString (table, "none", "Prolongation");
+ assert (!ierr);
+ }
+}
+
+int ML_Kretschmann_SetGroupTags (void)
+{
+ DECLARE_CCTK_PARAMETERS;
+
+ int const checkpoint = 0;
+
+ set_group_tags (checkpoint, checkpoint, 0, "ML_Kretschmann::ML_Kretschmann");
+
+ return 0;
+}
+
diff --git a/ML_Kretschmann_Helper/src/make.code.defn b/ML_Kretschmann_Helper/src/make.code.defn
new file mode 100644
index 0000000..df06acc
--- /dev/null
+++ b/ML_Kretschmann_Helper/src/make.code.defn
@@ -0,0 +1,2 @@
+# -*-Makefile-*-
+SRCS = SetGroupTags.c