diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/interpolate.c | 55 | ||||
-rw-r--r-- | src/rotatingsymmetry180.c | 2 | ||||
-rw-r--r-- | src/rotatingsymmetry180.h | 3 |
3 files changed, 60 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); + } + } +} diff --git a/src/rotatingsymmetry180.c b/src/rotatingsymmetry180.c index ccafa3c..0862fc1 100644 --- a/src/rotatingsymmetry180.c +++ b/src/rotatingsymmetry180.c @@ -227,6 +227,8 @@ int BndRot180VI (cGH const * restrict const cctkGH, paritiess[var][d] = weylparities[index][d]; } } + } else if (CCTK_EQUALS (tensortypealias, "ManualCartesian")) { + RotatingSymmetry180_GetManualParities(table, gis[var], paritiess[var]); } else { char * groupname = CCTK_GroupName(gis[var]); assert (groupname); diff --git a/src/rotatingsymmetry180.h b/src/rotatingsymmetry180.h index d006812..962e3ae 100644 --- a/src/rotatingsymmetry180.h +++ b/src/rotatingsymmetry180.h @@ -28,4 +28,7 @@ Rot180_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_, CCTK_POINTER const output_arrays[], CCTK_INT const faces); +void +RotatingSymmetry180_GetManualParities(int table, int gi, int *parities); + #endif /* ! defined ROTATINGSYMMETRY180_H */ |