aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@082bdb00-0f4f-0410-b49e-b1835e5f2039>2012-05-01 23:39:38 +0000
committerrhaas <rhaas@082bdb00-0f4f-0410-b49e-b1835e5f2039>2012-05-01 23:39:38 +0000
commit28ebf77b8e00bdac6999967b5c828e54f76c93e6 (patch)
treeea2de2d9e745a80b210a728bf75dabecf6743743
parent5936c5add3a7c43e2df619f3c24a845ab49a43a6 (diff)
correct handling of tensorparity=-1 quantities during interpolation
this fixes https://trac.einsteintoolkit.org/ticket/254 and https://trac.einsteintoolkit.org/ticket/851 git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/ReflectionSymmetry/trunk@48 082bdb00-0f4f-0410-b49e-b1835e5f2039
-rw-r--r--src/interpolate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interpolate.c b/src/interpolate.c
index fcaa51a..8c1f61b 100644
--- a/src/interpolate.c
+++ b/src/interpolate.c
@@ -297,7 +297,7 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_,
assert (groupname);
CCTK_VWarn (0, __LINE__, __FILE__, CCTK_THORNSTRING,
"Illegal tensor type alias \"%s\" for group \"%s\"",
- tensortypealias, groupname);
+ tensortypealias, groupname);
free (groupname);
}
@@ -434,23 +434,24 @@ ReflectionSymmetry_Interpolate (CCTK_POINTER_TO_CONST restrict const cctkGH_,
/* Are there negative parities? */
needs_checking = 0;
for (dir=0; dir<3; ++dir) {
- check_dir[dir] = do_reflection[2*dir] && parities[dir] < 0;
+ check_dir[dir] = do_reflection[2*dir] && parities[dir]*tensorparity < 0;
needs_checking |= check_dir[dir];
}
+
/* Loop over all points and unfold */
if (needs_checking) {
for (n=0; n<N_interp_points; ++n) {
- int parity = tensorparity;
+ int parity = 1; /* all types have their "natural" sign in the +++ octant */
/* Is the point outside the domain? */
for (dir=0; dir<3; ++dir) {
if (check_dir[dir]) {
CCTK_REAL const pos = ((CCTK_REAL const *)interp_coords[dir])[n];
if (pos < 0) {
/* Reflect the tensor component */
- parity *= -1;
+ parity *= -1; /* we only get here if parities[dir]*tensorparity < 0 */
}
}
}