aboutsummaryrefslogtreecommitdiff
path: root/Carpet/Carpet/src/Recompose.cc
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2008-06-30 15:29:24 -0500
committerErik Schnetter <schnetter@cct.lsu.edu>2008-06-30 15:29:24 -0500
commited2f9ff50cb94e31b0e130b0c5afdae8618c028e (patch)
tree7d2477bd2b69bae5cd827ee9f2e8729e8cca2160 /Carpet/Carpet/src/Recompose.cc
parent4a5354892312a8c416dd34022ee1160197d02ba2 (diff)
Carpet: Correct error in handling multiple maps in SplitRegionsMaps_Automatic
Diffstat (limited to 'Carpet/Carpet/src/Recompose.cc')
-rw-r--r--Carpet/Carpet/src/Recompose.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/Carpet/Carpet/src/Recompose.cc b/Carpet/Carpet/src/Recompose.cc
index 204542f02..696adf7ca 100644
--- a/Carpet/Carpet/src/Recompose.cc
+++ b/Carpet/Carpet/src/Recompose.cc
@@ -1288,6 +1288,12 @@ namespace Carpet {
if (DEBUG) cout << "SRMA enter" << endl;
int const nmaps = superregss.size();
+ int minmap = 1000000000;
+ for (int m=0; m<nmaps; ++m) {
+ for (int r=0; r<int(superregss.at(m).size()); ++r) {
+ minmap = min (minmap, superregss.at(m).at(r).map);
+ }
+ }
int nregs = 0;
for (int m=0; m<nmaps; ++m) {
nregs += superregss.at(m).size();
@@ -1383,13 +1389,13 @@ namespace Carpet {
// Count components per map
vector<int> myncomps(nmaps, 0);
for (int r=0; r<newnregs; ++r) {
- int const m = newregs.at(r).map;
+ int const m = newregs.at(r).map - minmap;
assert (m>=0 and m<nmaps);
++ myncomps.at(m);
}
vector<int> mynregs(nmaps, 0);
for (int r=0; r<nregs; ++r) {
- int const m = superregs.at(r).map;
+ int const m = superregs.at(r).map - minmap;
assert (m>=0 and m<nmaps);
++ mynregs.at(m);
}
@@ -1403,7 +1409,7 @@ namespace Carpet {
{
vector<int> tmpncomps(nmaps, 0);
for (int r=0; r<nregs; ++r) {
- int const m = superregs.at(r).map;
+ int const m = superregs.at(r).map - minmap;
ipfulltree * const regf = superregs.at(r).processors;
assert (regf != NULL);
for (ipfulltree::iterator
@@ -1430,12 +1436,12 @@ namespace Carpet {
}
// Assign regions
for (int r=0; r<newnregs; ++r) {
- int const m = newregs.at(r).map;
+ int const m = newregs.at(r).map - minmap;
assert (m>=0 and m<nmaps);
regss.at(m).push_back (newregs.at(r));
}
for (int r=0; r<nregs; ++r) {
- int const m = superregs.at(r).map;
+ int const m = superregs.at(r).map - minmap;
assert (m>=0 and m<nmaps);
superregss.at(m).push_back (superregs.at(r));
}