From 95cc0805c203a442eb3ff7b4b0608ce3435ad2ef Mon Sep 17 00:00:00 2001 From: schnetter Date: Thu, 1 Apr 2010 18:15:39 +0000 Subject: Correct symmetries for T_i(jk) git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@35 082bdb00-0f4f-0410-b49e-b1835e5f2039 --- src/interpolate.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/interpolate.c b/src/interpolate.c index 6868f5a..96d0977 100644 --- a/src/interpolate.c +++ b/src/interpolate.c @@ -164,7 +164,8 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, int table; char tensortypealias[1000]; enum tensortype { UNKNOWN, - SCALAR, VECTOR, SYMTENSOR, TENSOR, WEYLSCALARS_REAL, MANUALCARTESIAN }; + SCALAR, VECTOR, SYMTENSOR, SYMTENSOR3, TENSOR, + WEYLSCALARS_REAL, MANUALCARTESIAN }; enum tensortype ttype; CCTK_INT tensorparity; int tcomponent; @@ -280,8 +281,8 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, } else if (CCTK_EQUALS (tensortypealias, "ddd_sym")) { /* 3rd rank tensor, symmetric in last 2 indices */ assert (numvars == 18); - ttype = SYMTENSOR; - tcomponent = (vi - firstvar) % 6; + ttype = SYMTENSOR3; + tcomponent = vi - firstvar; } else if (CCTK_EQUALS (tensortypealias, "weylscalars_real")) { /* Weyl scalars, stored as 10 real numbers */ assert (numvars == 10); @@ -310,6 +311,9 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, case SYMTENSOR: assert (tcomponent>=0 && tcomponent<6); break; + case SYMTENSOR3: + assert (tcomponent>=0 && tcomponent<18); + break; case TENSOR: assert (tcomponent>=0 && tcomponent<9); break; @@ -357,6 +361,23 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, default: assert (0); } break; + case SYMTENSOR3: + switch (tcomponent % 6) { + case 0: break; + case 1: parities[0] = parities[1] = -1; break; + case 2: parities[0] = parities[2] = -1; break; + case 3: break; + case 4: parities[1] = parities[2] = -1; break; + case 5: break; + default: assert (0); + } + switch (tcomponent / 6) { + case 0: parities[0] *= -1; break; + case 1: parities[1] *= -1; break; + case 2: parities[2] *= -1; break; + default: assert (0); + } + break; case TENSOR: switch (tcomponent) { case 0: break; -- cgit v1.2.3