aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ML_BSSN_Helper/configuration.ccl2
-rw-r--r--ML_BSSN_Helper/interface.ccl2
-rw-r--r--ML_BSSN_Helper/schedule.ccl6
-rw-r--r--ML_BSSN_Helper/src/RegisterSymmetries.c66
-rw-r--r--ML_BSSN_Helper/src/make.code.defn2
-rw-r--r--ML_BSSN_MP_Helper/configuration.ccl2
-rw-r--r--ML_BSSN_MP_Helper/interface.ccl2
-rw-r--r--ML_BSSN_MP_Helper/schedule.ccl6
-rw-r--r--ML_BSSN_MP_Helper/src/RegisterSymmetries.c66
-rw-r--r--ML_BSSN_MP_Helper/src/make.code.defn2
-rw-r--r--ML_BSSN_M_Helper/configuration.ccl2
-rw-r--r--ML_BSSN_M_Helper/interface.ccl2
-rw-r--r--ML_BSSN_M_Helper/schedule.ccl6
-rw-r--r--ML_BSSN_M_Helper/src/RegisterSymmetries.c66
-rw-r--r--ML_BSSN_M_Helper/src/make.code.defn2
15 files changed, 228 insertions, 6 deletions
diff --git a/ML_BSSN_Helper/configuration.ccl b/ML_BSSN_Helper/configuration.ccl
index aecb1c4..edaa5b7 100644
--- a/ML_BSSN_Helper/configuration.ccl
+++ b/ML_BSSN_Helper/configuration.ccl
@@ -1 +1 @@
-REQUIRES THORNS: CoordGauge
+REQUIRES THORNS: CartGrid3D CoordGauge
diff --git a/ML_BSSN_Helper/interface.ccl b/ML_BSSN_Helper/interface.ccl
index 2d1899c..8ad9ba2 100644
--- a/ML_BSSN_Helper/interface.ccl
+++ b/ML_BSSN_Helper/interface.ccl
@@ -2,6 +2,8 @@ IMPLEMENTS: ML_BSSN_Helper
INHERITS: ADMBase CoordGauge ML_BSSN
+USES INCLUDE: Symmetry.h
+
CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
diff --git a/ML_BSSN_Helper/schedule.ccl b/ML_BSSN_Helper/schedule.ccl
index 74ec69e..06cd875 100644
--- a/ML_BSSN_Helper/schedule.ccl
+++ b/ML_BSSN_Helper/schedule.ccl
@@ -29,6 +29,12 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN")) {
OPTIONS: meta
} "Register slicing"
+ SCHEDULE ML_BSSN_RegisterSymmetries IN SymmetryRegister
+ {
+ LANG: C
+ OPTIONS: meta
+ } "Register grid function symmetries"
+
SCHEDULE ML_BSSN_UnsetCheckpointTags AT basegrid
{
LANG: C
diff --git a/ML_BSSN_Helper/src/RegisterSymmetries.c b/ML_BSSN_Helper/src/RegisterSymmetries.c
new file mode 100644
index 0000000..6812079
--- /dev/null
+++ b/ML_BSSN_Helper/src/RegisterSymmetries.c
@@ -0,0 +1,66 @@
+#include <assert.h>
+
+#include <cctk.h>
+#include <cctk_Arguments.h>
+
+#include <Symmetry.h>
+
+static void
+setcartsym (cGH const * restrict cctkGH, char const * restrict vn, int symdesc);
+
+void
+ML_BSSN_RegisterSymmetry (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+
+ setcartsym (cctkGH, "ML_BSSN::phi" , 0);
+ setcartsym (cctkGH, "ML_BSSN::gt11" , 11);
+ setcartsym (cctkGH, "ML_BSSN::gt12" , 12);
+ setcartsym (cctkGH, "ML_BSSN::gt13" , 13);
+ setcartsym (cctkGH, "ML_BSSN::gt22" , 22);
+ setcartsym (cctkGH, "ML_BSSN::gt23" , 23);
+ setcartsym (cctkGH, "ML_BSSN::gt33" , 33);
+ setcartsym (cctkGH, "ML_BSSN::trK" , 0);
+ setcartsym (cctkGH, "ML_BSSN::At11" , 11);
+ setcartsym (cctkGH, "ML_BSSN::At12" , 12);
+ setcartsym (cctkGH, "ML_BSSN::At13" , 13);
+ setcartsym (cctkGH, "ML_BSSN::At22" , 22);
+ setcartsym (cctkGH, "ML_BSSN::At23" , 23);
+ setcartsym (cctkGH, "ML_BSSN::At33" , 33);
+ setcartsym (cctkGH, "ML_BSSN::Xt1" , 1);
+ setcartsym (cctkGH, "ML_BSSN::Xt2" , 2);
+ setcartsym (cctkGH, "ML_BSSN::Xt3" , 3);
+ setcartsym (cctkGH, "ML_BSSN::alpha", 0);
+ setcartsym (cctkGH, "ML_BSSN::beta1", 1);
+ setcartsym (cctkGH, "ML_BSSN::beta2", 2);
+ setcartsym (cctkGH, "ML_BSSN::beta3", 3);
+ setcartsym (cctkGH, "ML_BSSN::A" , 0);
+ setcartsym (cctkGH, "ML_BSSN::B1" , 1);
+ setcartsym (cctkGH, "ML_BSSN::B2" , 2);
+ setcartsym (cctkGH, "ML_BSSN::B3" , 3);
+}
+
+void
+setcartsym (cGH const * restrict const cctkGH,
+ char const * restrict const vn,
+ int symdesc)
+{
+ int sym[3];
+
+ for (int d=0; d<3; ++d) {
+ sym[d] = +1;
+ }
+
+ assert (symdesc >= 0);
+ while (symdesc > 0) {
+ int const d = symdesc % 10;
+ assert (d>=1 && d<=3);
+ sym[d-1] *= -1;
+ symdesc /= 10;
+ }
+
+ int const ierr = SetCartSymVN (cctkGH, sym, vn);
+ if (ierr != 0) {
+ CCTK_WARN (CCTK_WARN_ABORT, "internal error");
+ }
+}
diff --git a/ML_BSSN_Helper/src/make.code.defn b/ML_BSSN_Helper/src/make.code.defn
index 12fb65d..60cb539 100644
--- a/ML_BSSN_Helper/src/make.code.defn
+++ b/ML_BSSN_Helper/src/make.code.defn
@@ -1,2 +1,2 @@
# -*-Makefile-*-
-SRCS = SelectBCsADMBase.c RegisterSlicing.c UnsetCheckpointTags.c
+SRCS = RegisterSlicing.c RegisterSymmetries.c SelectBCsADMBase.c UnsetCheckpointTags.c
diff --git a/ML_BSSN_MP_Helper/configuration.ccl b/ML_BSSN_MP_Helper/configuration.ccl
index aecb1c4..edaa5b7 100644
--- a/ML_BSSN_MP_Helper/configuration.ccl
+++ b/ML_BSSN_MP_Helper/configuration.ccl
@@ -1 +1 @@
-REQUIRES THORNS: CoordGauge
+REQUIRES THORNS: CartGrid3D CoordGauge
diff --git a/ML_BSSN_MP_Helper/interface.ccl b/ML_BSSN_MP_Helper/interface.ccl
index f8409dd..6258207 100644
--- a/ML_BSSN_MP_Helper/interface.ccl
+++ b/ML_BSSN_MP_Helper/interface.ccl
@@ -2,6 +2,8 @@ IMPLEMENTS: ML_BSSN_MP_Helper
INHERITS: ADMBase CoordGauge ML_BSSN_MP
+USES INCLUDE: Symmetry.h
+
CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
diff --git a/ML_BSSN_MP_Helper/schedule.ccl b/ML_BSSN_MP_Helper/schedule.ccl
index 79cafb3..173e973 100644
--- a/ML_BSSN_MP_Helper/schedule.ccl
+++ b/ML_BSSN_MP_Helper/schedule.ccl
@@ -29,6 +29,12 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN_MP")) {
OPTIONS: meta
} "Register slicing"
+ SCHEDULE ML_BSSN_MP_RegisterSymmetries IN SymmetryRegister
+ {
+ LANG: C
+ OPTIONS: meta
+ } "Register grid function symmetries"
+
SCHEDULE ML_BSSN_MP_UnsetCheckpointTags AT basegrid
{
LANG: C
diff --git a/ML_BSSN_MP_Helper/src/RegisterSymmetries.c b/ML_BSSN_MP_Helper/src/RegisterSymmetries.c
new file mode 100644
index 0000000..88ccd72
--- /dev/null
+++ b/ML_BSSN_MP_Helper/src/RegisterSymmetries.c
@@ -0,0 +1,66 @@
+#include <assert.h>
+
+#include <cctk.h>
+#include <cctk_Arguments.h>
+
+#include <Symmetry.h>
+
+static void
+setcartsym (cGH const * restrict cctkGH, char const * restrict vn, int symdesc);
+
+void
+ML_BSSN_MP_RegisterSymmetry (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+
+ setcartsym (cctkGH, "ML_BSSN_MP::phi" , 0);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt11" , 11);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt12" , 12);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt13" , 13);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt22" , 22);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt23" , 23);
+ setcartsym (cctkGH, "ML_BSSN_MP::gt33" , 33);
+ setcartsym (cctkGH, "ML_BSSN_MP::trK" , 0);
+ setcartsym (cctkGH, "ML_BSSN_MP::At11" , 11);
+ setcartsym (cctkGH, "ML_BSSN_MP::At12" , 12);
+ setcartsym (cctkGH, "ML_BSSN_MP::At13" , 13);
+ setcartsym (cctkGH, "ML_BSSN_MP::At22" , 22);
+ setcartsym (cctkGH, "ML_BSSN_MP::At23" , 23);
+ setcartsym (cctkGH, "ML_BSSN_MP::At33" , 33);
+ setcartsym (cctkGH, "ML_BSSN_MP::Xt1" , 1);
+ setcartsym (cctkGH, "ML_BSSN_MP::Xt2" , 2);
+ setcartsym (cctkGH, "ML_BSSN_MP::Xt3" , 3);
+ setcartsym (cctkGH, "ML_BSSN_MP::alpha", 0);
+ setcartsym (cctkGH, "ML_BSSN_MP::beta1", 1);
+ setcartsym (cctkGH, "ML_BSSN_MP::beta2", 2);
+ setcartsym (cctkGH, "ML_BSSN_MP::beta3", 3);
+ setcartsym (cctkGH, "ML_BSSN_MP::A" , 0);
+ setcartsym (cctkGH, "ML_BSSN_MP::B1" , 1);
+ setcartsym (cctkGH, "ML_BSSN_MP::B2" , 2);
+ setcartsym (cctkGH, "ML_BSSN_MP::B3" , 3);
+}
+
+void
+setcartsym (cGH const * restrict const cctkGH,
+ char const * restrict const vn,
+ int symdesc)
+{
+ int sym[3];
+
+ for (int d=0; d<3; ++d) {
+ sym[d] = +1;
+ }
+
+ assert (symdesc >= 0);
+ while (symdesc > 0) {
+ int const d = symdesc % 10;
+ assert (d>=1 && d<=3);
+ sym[d-1] *= -1;
+ symdesc /= 10;
+ }
+
+ int const ierr = SetCartSymVN (cctkGH, sym, vn);
+ if (ierr != 0) {
+ CCTK_WARN (CCTK_WARN_ABORT, "internal error");
+ }
+}
diff --git a/ML_BSSN_MP_Helper/src/make.code.defn b/ML_BSSN_MP_Helper/src/make.code.defn
index 12fb65d..da5fe95 100644
--- a/ML_BSSN_MP_Helper/src/make.code.defn
+++ b/ML_BSSN_MP_Helper/src/make.code.defn
@@ -1,2 +1,2 @@
# -*-Makefile-*-
-SRCS = SelectBCsADMBase.c RegisterSlicing.c UnsetCheckpointTags.c
+SRCS = SelectBCsADMBase.c RegisterSlicing.c RegisterSymmetries.c UnsetCheckpointTags.c
diff --git a/ML_BSSN_M_Helper/configuration.ccl b/ML_BSSN_M_Helper/configuration.ccl
index aecb1c4..edaa5b7 100644
--- a/ML_BSSN_M_Helper/configuration.ccl
+++ b/ML_BSSN_M_Helper/configuration.ccl
@@ -1 +1 @@
-REQUIRES THORNS: CoordGauge
+REQUIRES THORNS: CartGrid3D CoordGauge
diff --git a/ML_BSSN_M_Helper/interface.ccl b/ML_BSSN_M_Helper/interface.ccl
index f227df4..7723d63 100644
--- a/ML_BSSN_M_Helper/interface.ccl
+++ b/ML_BSSN_M_Helper/interface.ccl
@@ -2,6 +2,8 @@ IMPLEMENTS: ML_BSSN_M_Helper
INHERITS: ADMBase CoordGauge ML_BSSN_M
+USES INCLUDE: Symmetry.h
+
CCTK_INT FUNCTION Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST IN GH, CCTK_INT IN faces, CCTK_INT IN boundary_width, CCTK_INT IN table_handle, CCTK_STRING IN group_name, CCTK_STRING IN bc_name)
diff --git a/ML_BSSN_M_Helper/schedule.ccl b/ML_BSSN_M_Helper/schedule.ccl
index bcfd190..bb14766 100644
--- a/ML_BSSN_M_Helper/schedule.ccl
+++ b/ML_BSSN_M_Helper/schedule.ccl
@@ -29,6 +29,12 @@ if (CCTK_EQUALS (evolution_method, "ML_BSSN_M")) {
OPTIONS: meta
} "Register slicing"
+ SCHEDULE ML_BSSN_M_RegisterSymmetries IN SymmetryRegister
+ {
+ LANG: C
+ OPTIONS: meta
+ } "Register grid function symmetries"
+
SCHEDULE ML_BSSN_M_UnsetCheckpointTags AT basegrid
{
LANG: C
diff --git a/ML_BSSN_M_Helper/src/RegisterSymmetries.c b/ML_BSSN_M_Helper/src/RegisterSymmetries.c
new file mode 100644
index 0000000..88ee35f
--- /dev/null
+++ b/ML_BSSN_M_Helper/src/RegisterSymmetries.c
@@ -0,0 +1,66 @@
+#include <assert.h>
+
+#include <cctk.h>
+#include <cctk_Arguments.h>
+
+#include <Symmetry.h>
+
+static void
+setcartsym (cGH const * restrict cctkGH, char const * restrict vn, int symdesc);
+
+void
+ML_BSSN_M_RegisterSymmetry (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+
+ setcartsym (cctkGH, "ML_BSSN_M::phi" , 0);
+ setcartsym (cctkGH, "ML_BSSN_M::gt11" , 11);
+ setcartsym (cctkGH, "ML_BSSN_M::gt12" , 12);
+ setcartsym (cctkGH, "ML_BSSN_M::gt13" , 13);
+ setcartsym (cctkGH, "ML_BSSN_M::gt22" , 22);
+ setcartsym (cctkGH, "ML_BSSN_M::gt23" , 23);
+ setcartsym (cctkGH, "ML_BSSN_M::gt33" , 33);
+ setcartsym (cctkGH, "ML_BSSN_M::trK" , 0);
+ setcartsym (cctkGH, "ML_BSSN_M::At11" , 11);
+ setcartsym (cctkGH, "ML_BSSN_M::At12" , 12);
+ setcartsym (cctkGH, "ML_BSSN_M::At13" , 13);
+ setcartsym (cctkGH, "ML_BSSN_M::At22" , 22);
+ setcartsym (cctkGH, "ML_BSSN_M::At23" , 23);
+ setcartsym (cctkGH, "ML_BSSN_M::At33" , 33);
+ setcartsym (cctkGH, "ML_BSSN_M::Xt1" , 1);
+ setcartsym (cctkGH, "ML_BSSN_M::Xt2" , 2);
+ setcartsym (cctkGH, "ML_BSSN_M::Xt3" , 3);
+ setcartsym (cctkGH, "ML_BSSN_M::alpha", 0);
+ setcartsym (cctkGH, "ML_BSSN_M::beta1", 1);
+ setcartsym (cctkGH, "ML_BSSN_M::beta2", 2);
+ setcartsym (cctkGH, "ML_BSSN_M::beta3", 3);
+ setcartsym (cctkGH, "ML_BSSN_M::A" , 0);
+ setcartsym (cctkGH, "ML_BSSN_M::B1" , 1);
+ setcartsym (cctkGH, "ML_BSSN_M::B2" , 2);
+ setcartsym (cctkGH, "ML_BSSN_M::B3" , 3);
+}
+
+void
+setcartsym (cGH const * restrict const cctkGH,
+ char const * restrict const vn,
+ int symdesc)
+{
+ int sym[3];
+
+ for (int d=0; d<3; ++d) {
+ sym[d] = +1;
+ }
+
+ assert (symdesc >= 0);
+ while (symdesc > 0) {
+ int const d = symdesc % 10;
+ assert (d>=1 && d<=3);
+ sym[d-1] *= -1;
+ symdesc /= 10;
+ }
+
+ int const ierr = SetCartSymVN (cctkGH, sym, vn);
+ if (ierr != 0) {
+ CCTK_WARN (CCTK_WARN_ABORT, "internal error");
+ }
+}
diff --git a/ML_BSSN_M_Helper/src/make.code.defn b/ML_BSSN_M_Helper/src/make.code.defn
index 12fb65d..da5fe95 100644
--- a/ML_BSSN_M_Helper/src/make.code.defn
+++ b/ML_BSSN_M_Helper/src/make.code.defn
@@ -1,2 +1,2 @@
# -*-Makefile-*-
-SRCS = SelectBCsADMBase.c RegisterSlicing.c UnsetCheckpointTags.c
+SRCS = SelectBCsADMBase.c RegisterSlicing.c RegisterSymmetries.c UnsetCheckpointTags.c