diff options
author | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2006-10-19 00:27:03 +0000 |
---|---|---|
committer | schnetter <schnetter@082bdb00-0f4f-0410-b49e-b1835e5f2039> | 2006-10-19 00:27:03 +0000 |
commit | 54620b9361553333aeec9f43a20ab87d5ac1dcbf (patch) | |
tree | 41de6c0efe72ac750df3026fb4ea61185bdb0472 /src/interpolate.c | |
parent | 5352835c7e20ebf5fb6d5bcbfe4d4f310bd5bc9d (diff) |
Add tensor types to handle the Weyl scalars.
Check that the boundary specification is consistent between this thorn
and CoordBase, when CoordBase is used.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@17 082bdb00-0f4f-0410-b49e-b1835e5f2039
Diffstat (limited to 'src/interpolate.c')
-rw-r--r-- | src/interpolate.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/interpolate.c b/src/interpolate.c index 884abe6..7c8831e 100644 --- a/src/interpolate.c +++ b/src/interpolate.c @@ -178,7 +178,7 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, int table; char tensortypealias[1000]; - enum tensortype { UNKNOWN, SCALAR, VECTOR, TENSOR }; + enum tensortype { UNKNOWN, SCALAR, VECTOR, TENSOR, WEYLSCALARS_REAL }; enum tensortype ttype; CCTK_INT tensorparity; int tcomponent; @@ -224,8 +224,7 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, ttype = UNKNOWN; tcomponent = 0; - if (CCTK_EQUALS (tensortypealias, "scalar")) - { + if (CCTK_EQUALS (tensortypealias, "scalar")) { /* scalar */ if (numvars != 1) { groupname = CCTK_GroupName(gi); @@ -239,8 +238,7 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, tcomponent = 0; } else if (CCTK_EQUALS (tensortypealias, "u") - || CCTK_EQUALS (tensortypealias, "d")) - { + || CCTK_EQUALS (tensortypealias, "d")) { /* vector */ assert (numvars == 3); ttype = VECTOR; @@ -251,6 +249,11 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, assert (numvars == 6); ttype = TENSOR; tcomponent = vi - firstvar; + } else if (CCTK_EQUALS (tensortypealias, "weylscalars_real")) { + /* Weyl scalars, stored as 10 real numbers */ + assert (numvars == 10); + ttype = WEYLSCALARS_REAL; + tcomponent = vi - firstvar; } else { char * groupname = CCTK_GroupName(gi); assert (groupname); @@ -271,6 +274,9 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, case TENSOR: assert (tcomponent>=0 && tcomponent<6); break; + case WEYLSCALARS_REAL: + assert (tcomponent>=0 && tcomponent<10); + break; default: assert (0); } @@ -311,6 +317,24 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_, default: assert (0); } break; + case WEYLSCALARS_REAL: + { + static int const weylparities[10][3] = + {{+1,+1,+1}, + {-1,-1,-1}, + {+1,+1,-1}, + {-1,-1,+1}, + {+1,+1,+1}, + {-1,-1,-1}, + {+1,+1,-1}, + {-1,-1,+1}, + {+1,+1,+1}, + {-1,-1,-1}}; + for (dir=0; dir<3; ++dir) { + parities[dir] = weylparities[tcomponent][dir]; + } + } + break; default: assert (0); } |