aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetReduce
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2010-02-18 17:22:47 -0800
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 16:45:31 +0000
commit4ec8e521f7493eec11bb245a39a03437d4f4c36b (patch)
tree5c66cdc449589a56efdc92e6693645f5dc4d2028 /Carpet/CarpetReduce
parent419c1c03a68d3deac5431380074adbd07e5e4d6a (diff)
CarpetReduce: Correct multi-processor error in initialising the reduction mask
Diffstat (limited to 'Carpet/CarpetReduce')
-rw-r--r--Carpet/CarpetReduce/src/mask_carpet.cc32
1 files changed, 18 insertions, 14 deletions
diff --git a/Carpet/CarpetReduce/src/mask_carpet.cc b/Carpet/CarpetReduce/src/mask_carpet.cc
index a2a6a1974..346fad111 100644
--- a/Carpet/CarpetReduce/src/mask_carpet.cc
+++ b/Carpet/CarpetReduce/src/mask_carpet.cc
@@ -77,15 +77,15 @@ namespace CarpetMask {
// Calculate the union of all refined regions
- ibset refined;
+ ibset active;
for (int c=0; c<hh.components(reflevel); ++c) {
// refined |= hh.extent(mglevel,reflevel,c);
- ibset active;
+ ibset this_active;
dh::dboxes const& box = dd.boxes.AT(mglevel).AT(reflevel).AT(c);
- dh::dboxes::ibboxs2ibset (box.active, box.numactive, active);
- refined += active;
+ dh::dboxes::ibboxs2ibset (box.active, box.numactive, this_active);
+ active += this_active;
}
- refined.normalize();
+ active.normalize();
// Calculate the union of all coarse regions
ibset parent;
@@ -96,7 +96,7 @@ namespace CarpetMask {
parent.normalize();
// Subtract the refined region
- ibset notrefined = parent - refined;
+ ibset notrefined = parent - active;
notrefined.normalize();
// Enlarge this set
@@ -117,11 +117,12 @@ namespace CarpetMask {
// Intersect with the union of refined regions
ibset boundaries[dim];
for (int d=0; d<dim; ++d) {
- boundaries[d] = refined & enlarged[d];
+ boundaries[d] = active & enlarged[d];
boundaries[d].normalize();
}
// Subtract the boundaries from the refined region
+ ibset refined = active;
for (int d=0; d<dim; ++d) {
refined -= boundaries[d];
}
@@ -138,15 +139,18 @@ namespace CarpetMask {
ibbox const & ext
= dd.boxes.at(mglevel).at(reflevel).at(component).exterior;
- ibset active;
- {
- dh::dboxes const& box =
- dd.boxes.AT(mglevel).AT(reflevel).AT(component);
- dh::dboxes::ibboxs2ibset (box.active, box.numactive, active);
- }
- ibset const notactive = ext - active;
+ ibset notactive = ext - active;
+ notactive.normalize();
for (int d=0; d<dim; ++d) {
+ if (not ((notactive & boundaries[d]).empty())) {
+ cout << "mask_carpet.cc\n";
+ cout << "ext=" << ext << "\n";
+ cout << "active=" << active << "\n";
+ cout << "notactive=" << notactive << "\n";
+ cout << "boundaries[" << d << "]=" << boundaries[d] << "\n";
+ cout << "& = " << (notactive & boundaries[d]) << "\n";
+ }
assert ((notactive & boundaries[d]).empty());
}