aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5>2010-03-21 16:41:51 +0000
committerschnetter <schnetter@c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5>2010-03-21 16:41:51 +0000
commit926445aafaf5e85e219ebe3c3e9c8b852a981c87 (patch)
tree82b35cd196b438472f6cc9c5e26443995b3272a9
parent0c69a6c5990d6033758cdad326bee95b4a4c3fee (diff)
Add tensor type ddd_sym, corresponding to T_i(jk).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/RotatingSymmetry90/trunk@51 c3c03602-0f4f-0410-b3fa-d2c81c8a7dc5
-rw-r--r--src/interpolate.c18
-rw-r--r--src/rotatingsymmetry90.c47
2 files changed, 65 insertions, 0 deletions
diff --git a/src/interpolate.c b/src/interpolate.c
index 16370f2..50e3b70 100644
--- a/src/interpolate.c
+++ b/src/interpolate.c
@@ -355,10 +355,16 @@ Rot90_CheckTensorTypes (CCTK_ARGUMENTS)
{
/* 4-vector */
assert (numvars == DIM+1);
+ } else if (CCTK_EQUALS (tensortypealias, "du")) {
+ /* tensor */
+ assert (numvars == DIM*DIM);
} else if (CCTK_EQUALS (tensortypealias, "uu_sym")
|| CCTK_EQUALS (tensortypealias, "dd_sym")) {
/* symmetric tensor */
assert (numvars == DIM*(DIM+1)/2);
+ } else if (CCTK_EQUALS (tensortypealias, "ddd_sym")) {
+ /* 3rd rank tensor, symmetric in last 2 indices */
+ assert (numvars == DIM*DIM*(DIM+1)/2);
} else if (CCTK_EQUALS (tensortypealias, "4uu_sym")
|| CCTK_EQUALS (tensortypealias, "4dd_sym")) {
/* symmetric 4-tensor */
@@ -712,6 +718,12 @@ Rot90_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
basevar = firstvar + off;
var = vi - basevar;
}
+ } else if (CCTK_EQUALS (tensortypealias, "du")) {
+ /* tensor */
+ assert (numvars == DIM*DIM);
+ tensortype = &tensor;
+ basevar = firstvar;
+ var = vi - basevar;
} else if (CCTK_EQUALS (tensortypealias, "uu_sym")
|| CCTK_EQUALS (tensortypealias, "dd_sym")) {
/* symmetric tensor */
@@ -719,6 +731,12 @@ Rot90_SymmetryInterpolate (CCTK_POINTER_TO_CONST const cctkGH_,
tensortype = &symmtensor;
basevar = firstvar;
var = vi - basevar;
+ } else if (CCTK_EQUALS (tensortypealias, "ddd_sym")) {
+ /* 3rd rank tensor, symmetric in last 2 indices */
+ assert (numvars == DIM*DIM*(DIM+1)/2);
+ tensortype = &symmtensor3b;
+ basevar = firstvar;
+ var = vi - basevar;
} else if (CCTK_EQUALS (tensortypealias, "4uu_sym")
|| CCTK_EQUALS (tensortypealias, "4dd_sym")) {
/* symmetric 4-tensor */
diff --git a/src/rotatingsymmetry90.c b/src/rotatingsymmetry90.c
index 397797f..c58c7aa 100644
--- a/src/rotatingsymmetry90.c
+++ b/src/rotatingsymmetry90.c
@@ -293,10 +293,16 @@ int BndRot90VI (cGH const * restrict const cctkGH,
|| CCTK_EQUALS (tensortypealias, "4d")) {
/* 4-vector */
assert (numvars == DIM+1);
+ } else if (CCTK_EQUALS (tensortypealias, "du")) {
+ /* tensor */
+ assert (numvars == DIM*DIM);
} else if (CCTK_EQUALS (tensortypealias, "uu_sym")
|| CCTK_EQUALS (tensortypealias, "dd_sym")) {
/* symmetric tensor */
assert (numvars == DIM*(DIM+1)/2);
+ } else if (CCTK_EQUALS (tensortypealias, "ddd_sym")) {
+ /* 3rd rank tensor, symmetric in last 2 indices */
+ assert (numvars == DIM*DIM*(DIM+1)/2);
} else if (CCTK_EQUALS (tensortypealias, "4uu_sym")
|| CCTK_EQUALS (tensortypealias, "4dd_sym")) {
/* symmetric 4-tensor */
@@ -345,6 +351,19 @@ int BndRot90VI (cGH const * restrict const cctkGH,
= off + convert_index (step, index-off, alldirs, &parities[var]);
srcvi = firstvar + srcindex;
}
+ } else if (CCTK_EQUALS (tensortypealias, "du")) {
+ /* tensor */
+ assert (numvars == DIM*DIM);
+ int index1, index2;
+ int srcindex1, srcindex2;
+ int srcindex;
+ assert (index>=0 && index<DIM*DIM);
+ index1 = index / DIM;
+ index2 = index % DIM;
+ srcindex1 = convert_index (step, index1, alldirs, &parities[var]);
+ srcindex2 = convert_index (step, index2, alldirs, &parities[var]);
+ srcindex = index1 * DIM + index2;
+ srcvi = firstvar + srcindex;
} else if (CCTK_EQUALS (tensortypealias, "uu_sym")
|| CCTK_EQUALS (tensortypealias, "dd_sym")) {
/* symmetric tensor */
@@ -365,6 +384,34 @@ int BndRot90VI (cGH const * restrict const cctkGH,
srcindex = compact[srcindex1][srcindex2];
}
srcvi = firstvar + srcindex;
+ } else if (CCTK_EQUALS (tensortypealias, "ddd_sym")) {
+ /* 3rd rank tensor, symmetric in last 2 indices */
+ int index1, index2, index3;
+ int srcindex1, srcindex2, srcindex3;
+ int srcindex;
+ assert (index>=0 && index<DIM*DIM*(DIM+1)/2);
+ {
+ int const expand1[DIM*DIM*(DIM+1)/2] =
+ { 0,0,0,0,0,0, 1,1,1,1,1,1, 2,2,2,2,2,2 };
+ int const expand2[DIM*DIM*(DIM+1)/2] =
+ { 0,0,0,1,1,2, 0,0,0,1,1,2, 0,0,0,1,1,2 };
+ int const expand3[DIM*DIM*(DIM+1)/2] =
+ { 0,1,2,1,2,2, 0,1,2,1,2,2, 0,1,2,1,2,2 };
+ index1 = expand1[index];
+ index2 = expand2[index];
+ index3 = expand3[index];
+ }
+ srcindex1 = convert_index (step, index1, alldirs, &parities[var]);
+ srcindex2 = convert_index (step, index2, alldirs, &parities[var]);
+ srcindex3 = convert_index (step, index3, alldirs, &parities[var]);
+ {
+ int const compact[DIM][DIM][DIM] =
+ { { { 0, 1, 2 }, { 1, 3, 4 }, { 2, 4, 5 } },
+ { { 6, 7, 8 }, { 7, 9,10 }, { 8,10,11 } },
+ { { 12,13,14 }, { 13,15,16 }, { 14,16,17 } } };
+ srcindex = compact[srcindex1][srcindex2][srcindex3];
+ }
+ srcvi = firstvar + srcindex;
} else if (CCTK_EQUALS (tensortypealias, "4uu_sym")
|| CCTK_EQUALS (tensortypealias, "4dd_sym")) {
/* symmetric 4-tensor */