diff options
author | ianhin <ianhin@20f44201-0f4f-0410-9130-e5fc2714a787> | 2010-02-15 13:17:22 +0000 |
---|---|---|
committer | ianhin <ianhin@20f44201-0f4f-0410-9130-e5fc2714a787> | 2010-02-15 13:17:22 +0000 |
commit | 260f27175bffd6d16de06315fb628e452dcb0fbf (patch) | |
tree | 34247f2dac9210b4827212c1e48f27bcdac3a645 /src/interpolate.c | |
parent | f254849fb519069c46c3fc11bc20f77fa6792349 (diff) |
Add ManualCartesian tensor type
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry180/trunk@50 20f44201-0f4f-0410-9130-e5fc2714a787
Diffstat (limited to 'src/interpolate.c')
-rw-r--r-- | src/interpolate.c | 55 |
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); + } + } +} |