aboutsummaryrefslogtreecommitdiff
path: root/ML_Kretschmann_Helper/src/SetGroupTags.c
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/src/SetGroupTags.c
parentfa56b7f58ef3c4824977d253d89bba2bea1593c7 (diff)
Add a thorn for computing the Kretschmann scalar.
Diffstat (limited to 'ML_Kretschmann_Helper/src/SetGroupTags.c')
-rw-r--r--ML_Kretschmann_Helper/src/SetGroupTags.c46
1 files changed, 46 insertions, 0 deletions
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;
+}
+