aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetMask
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-10-02 11:50:19 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2008-10-02 11:50:19 -0500
commit553075527d062a7248dd7edd6c0e4c56170ef4d0 (patch)
treef0f76865acc2ea1cc59c65e998f67532f64fd303 /Carpet/CarpetMask
parent8fcf7d4dad24185d7a59426281557933d7e718b9 (diff)
CarpetMask: Allow excluding the exterior of large coordinate spheres
Allow excluding the exterior of large coordinate spheres from norm calculations.
Diffstat (limited to 'Carpet/CarpetMask')
-rw-r--r--Carpet/CarpetMask/param.ccl4
-rw-r--r--Carpet/CarpetMask/src/mask_excluded.cc7
2 files changed, 10 insertions, 1 deletions
diff --git a/Carpet/CarpetMask/param.ccl b/Carpet/CarpetMask/param.ccl
index 8db65e41b..f63bceab3 100644
--- a/Carpet/CarpetMask/param.ccl
+++ b/Carpet/CarpetMask/param.ccl
@@ -36,6 +36,10 @@ CCTK_REAL excluded_radius[10] "radius of excluded region" STEERABLE=always
0.0:* :: ""
} -1.0
+BOOLEAN exclude_exterior[10] "exclude the exterior of this radius, otherwise the interior" STEERABLE=always
+{
+} no
+
# Exclude spherical surfaces
diff --git a/Carpet/CarpetMask/src/mask_excluded.cc b/Carpet/CarpetMask/src/mask_excluded.cc
index 97268ef42..e842caf31 100644
--- a/Carpet/CarpetMask/src/mask_excluded.cc
+++ b/Carpet/CarpetMask/src/mask_excluded.cc
@@ -44,6 +44,8 @@ namespace CarpetMask {
CCTK_REAL const r2 = pow (r0, 2);
+ bool const exterior = exclude_exterior[n];
+
for (int k = 0; k < cctk_lsh[2]; ++ k) {
for (int j = 0; j < cctk_lsh[1]; ++ j) {
for (int i = 0; i < cctk_lsh[0]; ++ i) {
@@ -53,7 +55,10 @@ namespace CarpetMask {
CCTK_REAL const dy2 = pow (y[ind] - y0, 2);
CCTK_REAL const dz2 = pow (z[ind] - z0, 2);
- if (dx2 + dy2 + dz2 <= r2) {
+ if (exterior ?
+ dx2 + dy2 + dz2 >= r2 :
+ dx2 + dy2 + dz2 <= r2)
+ {
weight[ind] = 0.0;
}