aboutsummaryrefslogtreecommitdiff
path: root/src/interpolate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interpolate.c')
-rw-r--r--src/interpolate.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/interpolate.c b/src/interpolate.c
index ecf7477..853ed08 100644
--- a/src/interpolate.c
+++ b/src/interpolate.c
@@ -93,6 +93,8 @@ Rot180_CheckTensorTypes (CCTK_ARGUMENTS)
} else if (CCTK_EQUALS (tensortypealias, "weylscalars_real")) {
/* Weyl scalars, stored as 10 real values */
assert (numvars == 10);
+ } else if (CCTK_EQUALS (tensortypealias, "ManualCartesian")) {
+ /* No restriction */
} else {
char * groupname = CCTK_GroupName(gi);
assert (groupname);
@@ -368,6 +370,8 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
parities[d] = weylparities[index][d];
}
}
+ } else if (CCTK_EQUALS (tensortypealias, "ManualCartesian")) {
+ RotatingSymmetry180_GetManualParities(table, gi, parities);
} else {
char * groupname = CCTK_GroupName(gi);
assert (groupname);
@@ -424,3 +428,54 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
return iret;
}
+
+void RotatingSymmetry180_GetManualParities(int table, int gi, int *parities)
+{
+ char cartsyms[100];
+ char *groupname = NULL;
+ int i = 0;
+ int ierr = -1;
+
+ /* Get and check tensor type information */
+ ierr = Util_TableGetString
+ (table, sizeof cartsyms, cartsyms, "cartesianreflectionparities");
+ if (ierr == UTIL_ERROR_TABLE_NO_SUCH_KEY) {
+ groupname = CCTK_GroupName(gi);
+ assert (groupname);
+ CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Cartesian refection parity not declared for group \"%s\" -- aborting",
+ groupname);
+ assert(0);
+ } else if (ierr<0) {
+ groupname = CCTK_GroupName(gi);
+ assert (groupname);
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Error in tensor type alias declaration for group \"%s\"",
+ groupname);
+ free (groupname);
+ }
+
+ if (strlen(cartsyms) != 3)
+ {
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Invalid format for cartesianreflectionparities: must be xxx where x is + or - for group %s",
+ groupname);
+ }
+
+ for (i = 0; i < 3; i++)
+ {
+ switch (cartsyms[i])
+ {
+ case '+':
+ parities[i] = 1;
+ break;
+ case '-':
+ parities[i] = -1;
+ break;
+ default:
+ CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
+ "Invalid format for cartesianreflectionparities: must be xxx where x is + or - for group %s",
+ groupname);
+ }
+ }
+}