aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetMask/src/mask_surface.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetMask/src/mask_surface.cc')
-rw-r--r--Carpet/CarpetMask/src/mask_surface.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/Carpet/CarpetMask/src/mask_surface.cc b/Carpet/CarpetMask/src/mask_surface.cc
index a78a9f9f1..1d4a746d0 100644
--- a/Carpet/CarpetMask/src/mask_surface.cc
+++ b/Carpet/CarpetMask/src/mask_surface.cc
@@ -96,15 +96,24 @@ namespace CarpetMask {
// Always excise the surface origin
weight[ind] = 0.0;
} else {
- CCTK_REAL const theta =
- acos (min (CCTK_REAL (+1.0),
- max (CCTK_REAL (-1.0), dz / rho)));
+ CCTK_REAL theta =
+ acos (min (+1.0, max (-1.0, dz / rho)));
+ if (symmetric_z[sn])
+ if (theta > M_PI/2.0)
+ theta = M_PI - theta;
+
assert (not isnan (theta));
assert (theta >= 0);
assert (theta <= M_PI);
- CCTK_REAL const phi =
- fmod (atan2 (dy, dx) + CCTK_REAL (2 * M_PI),
- CCTK_REAL (2 * M_PI));
+ CCTK_REAL phi =
+ fmod (atan2 (dy, dx) + 2 * M_PI, 2 * M_PI);
+ if (symmetric_x[sn] || symmetric_y[sn])
+ if (symmetric_y[sn] && symmetric_x[sn]) {
+ if (phi > M_PI/2.0)
+ phi = M_PI - phi;
+ } else
+ if (phi > M_PI)
+ phi = 2*M_PI - phi;
assert (not isnan (phi));
assert (phi >= 0);
assert (phi < 2 * M_PI);