diff options
Diffstat (limited to 'src/rotatingsymmetry90.c')
-rw-r--r-- | src/rotatingsymmetry90.c | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/src/rotatingsymmetry90.c b/src/rotatingsymmetry90.c index 5ba6fff..a5abe48 100644 --- a/src/rotatingsymmetry90.c +++ b/src/rotatingsymmetry90.c @@ -295,14 +295,26 @@ int BndRot90VI (cGH const * restrict const cctkGH, if (CCTK_EQUALS (tensortypealias, "scalar")) { /* scalar */ + } else if (CCTK_EQUALS (tensortypealias, "4scalar")) { + /* 4-scalar */ } else if (CCTK_EQUALS (tensortypealias, "u") || CCTK_EQUALS (tensortypealias, "d")) { /* vector */ assert (numvars == 3); - } else if (CCTK_EQUALS (tensortypealias, "dd_sym")) { + } else if (CCTK_EQUALS (tensortypealias, "4u") + || CCTK_EQUALS (tensortypealias, "4d")) + { + /* 4-vector */ + assert (numvars == 4); + } else if (CCTK_EQUALS (tensortypealias, "uu_sym") + || CCTK_EQUALS (tensortypealias, "dd_sym")) { /* symmetric tensor */ assert (numvars == 6); + } else if (CCTK_EQUALS (tensortypealias, "4uu_sym") + || CCTK_EQUALS (tensortypealias, "4dd_sym")) { + /* symmetric 4-tensor */ + assert (numvars == 10); } else { char * groupname = CCTK_GroupName(gis[var]); assert (groupname); @@ -318,18 +330,41 @@ int BndRot90VI (cGH const * restrict const cctkGH, /* scalar */ srcvi = vis[var]; /* do nothing */ + } else if (CCTK_EQUALS (tensortypealias, "4scalar")) { + /* 4-scalar */ + srcvi = vis[var]; + /* do nothing */ } else if (CCTK_EQUALS (tensortypealias, "u") || CCTK_EQUALS (tensortypealias, "d")) { /* vector */ int srcindex; + assert (index>=0 && index<3); srcindex = convert_index (step, index, alldirs, &parities[var]); srcvi = firstvar + srcindex; - } else if (CCTK_EQUALS (tensortypealias, "dd_sym")) { + } else if (CCTK_EQUALS (tensortypealias, "4u") + || CCTK_EQUALS (tensortypealias, "4d")) + { + /* 4-vector */ + assert (index>=0 && index<4); + if (index==0) { + /* temporal component */ + srcvi = firstvar; + } else { + /* spatial components */ + int srcindex; + int const off = 1; + srcindex + = off + convert_index (step, index-off, alldirs, &parities[var]); + srcvi = firstvar + srcindex; + } + } else if (CCTK_EQUALS (tensortypealias, "uu_sym") + || CCTK_EQUALS (tensortypealias, "dd_sym")) { /* symmetric tensor */ int index1, index2; int srcindex1, srcindex2; int srcindex; + assert (index>=0 && index<6); { int const expand1[6] = { 0,0,0,1,1,2 }; int const expand2[6] = { 0,1,2,1,2,2 }; @@ -343,6 +378,40 @@ int BndRot90VI (cGH const * restrict const cctkGH, srcindex = compact[srcindex1][srcindex2]; } srcvi = firstvar + srcindex; + } else if (CCTK_EQUALS (tensortypealias, "4uu_sym") + || CCTK_EQUALS (tensortypealias, "4dd_sym")) { + /* symmetric 4-tensor */ + assert (index>=0 && index<10); + if (index==0) { + /* temporal-temporal component */ + srcvi = firstvar; + } else if (index<4) { + /* temporal-spatial components */ + int srcindex; + int const off = 1; + srcindex + = off + convert_index (step, index-off, alldirs, &parities[var]); + srcvi = firstvar + srcindex; + } else { + /* spatial-spatial components */ + int index1, index2; + int srcindex1, srcindex2; + int srcindex; + int const off = 4; + { + int const expand1[6] = { 0,0,0,1,1,2 }; + int const expand2[6] = { 0,1,2,1,2,2 }; + index1 = expand1[index-off]; + index2 = expand2[index-off]; + } + srcindex1 = convert_index (step, index1, alldirs, &parities[var]); + srcindex2 = convert_index (step, index2, alldirs, &parities[var]); + { + int const compact[3][3] = { { 0,1,2 }, { 1,3,4 }, { 2,4,5 } }; + srcindex = off + compact[srcindex1][srcindex2]; + } + srcvi = firstvar + srcindex; + } } else { assert (0); } |