aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetMask/src
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/src
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/src')
-rw-r--r--Carpet/CarpetMask/src/mask_excluded.cc7
1 files changed, 6 insertions, 1 deletions
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;
}