diff options
Diffstat (limited to 'Carpet/CarpetReduce')
-rw-r--r-- | Carpet/CarpetReduce/src/mask_carpet.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Carpet/CarpetReduce/src/mask_carpet.cc b/Carpet/CarpetReduce/src/mask_carpet.cc index f176057e0..6db04bc9a 100644 --- a/Carpet/CarpetReduce/src/mask_carpet.cc +++ b/Carpet/CarpetReduce/src/mask_carpet.cc @@ -182,6 +182,7 @@ namespace CarpetMask { } END_LOOP_OVER_BSET; vector<int> imask (prod(ivect::ref(cctk_lsh))); + vector<int> mask (prod(ivect::ref(cctk_lsh))); assert (dim == 3); #pragma omp parallel @@ -192,6 +193,7 @@ namespace CarpetMask { { int const ind = CCTK_GFINDEX3D (cctkGH, i, j, k); imask[ind] = 0; + mask[ind] = 0; } LC_ENDLOOP3(CarpetMaskSetup_restriction_boundary_init); for (int d=0; d<dim; ++d) { @@ -220,6 +222,10 @@ namespace CarpetMask { { int const ind = CCTK_GFINDEX3D (cctkGH, i, j, k); imask[ind] |= bmask; + if (mask[ind] == 0) { + mask[ind] = 1; + } + mask[ind] *= 2; } LC_ENDLOOP3(CarpetMaskSetup_restriction_boundary_partial); } END_LOOP_OVER_BSET; @@ -234,7 +240,9 @@ namespace CarpetMask { cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) { int const ind = CCTK_GFINDEX3D (cctkGH, i, j, k); - iweight[ind] &= imask[ind]; + if (mask[ind] > 0) { + iweight[ind] &= imask[ind]; + } } LC_ENDLOOP3(CarpetMaskSetup_restriction_boundary_apply); } END_LOCAL_COMPONENT_LOOP; |