[ET Trac] [Einstein Toolkit] #434: Keep track of masked-out volume in CarpetMask
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Mon Nov 5 14:51:36 CST 2012
#434: Keep track of masked-out volume in CarpetMask
--------------------------+-------------------------------------------------
Reporter: eschnett | Owner: eschnett
Type: enhancement | Status: reopened
Priority: minor | Milestone: ET_2013_05
Component: Carpet | Version:
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by eschnett):
Roland, do you want to try this patch?
{{{
$ git diff
diff --git a/Carpet/CarpetMask/src/mask_surface.cc
b/Carpet/CarpetMask/src/mask_
index f2a592b..2b7ee6f 100644
--- a/Carpet/CarpetMask/src/mask_surface.cc
+++ b/Carpet/CarpetMask/src/mask_surface.cc
@@ -133,6 +133,15 @@ namespace CarpetMask {
CCTK_LOOP3_ALL(CarpetSurfaceSetup, cctkGH, i,j,k) {
int const ind = CCTK_GFINDEX3D (cctkGH, i, j, k);
+ bool const is_ghost =
+ (not cctk_bbox[0] and i < cctk_nghostzones[0]) or
+ (not cctk_bbox[2] and j < cctk_nghostzones[1]) or
+ (not cctk_bbox[4] and k < cctk_nghostzones[2]) or
+ (not cctk_bbox[1] and i >= cctk_lsh[0] -
cctk_nghostzones[0]) or
+ (not cctk_bbox[3] and j >= cctk_lsh[1] -
cctk_nghostzones[1]) or
+ (not cctk_bbox[5] and k >= cctk_lsh[2] -
cctk_nghostzones[2]);
+ CCTK_REAL const ghost_factor = CCTK_REAL (not is_ghost);
+
CCTK_REAL const dx = x[ind] - x0;
CCTK_REAL const dy = y[ind] - y0;
CCTK_REAL const dz = z[ind] - z0;
@@ -142,7 +151,8 @@ namespace CarpetMask {
if (rho < 1.0e-12) {
// Always excise the surface origin
// Tally up the weight we are removing
- * excised_cells += cell_volume * factor *
BCNT(iweight[ind]);
+ * excised_cells +=
+ cell_volume * factor * ghost_factor * BCNT(iweight[ind]);
iweight[ind] = 0;
} else {
CCTK_REAL theta =
@@ -188,7 +198,8 @@ namespace CarpetMask {
sf_radius[a + maxntheta * (b + maxnphi * sn)];
if (rho <= dr * shrink_factor) {
// Tally up the weight we are removing
- * excised_cells += cell_volume * factor *
BCNT(iweight[ind]);
+ * excised_cells +=
+ cell_volume * factor * ghost_factor *
BCNT(iweight[ind]);
iweight[ind] = 0;
}
}
}}}
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/434#comment:15>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list