diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-06-30 15:29:24 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2008-06-30 15:29:24 -0500 |
commit | fc8195cd3cda7dee486994d681596af6acdc9773 (patch) | |
tree | 4b43b4f793e8748035985f92968c465569084614 /Carpet/Carpet/src/Recompose.cc | |
parent | 37d19e827835e89342db32c5d75a8d9d30a9a6c5 (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.cc | 16 |
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)); } |