aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/gh.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2011-09-15 09:12:23 -0400
committerBarry Wardell <barry.wardell@gmail.com>2011-12-14 19:54:49 +0000
commit66f9584d5375880777203c33a0f3ce036b5e01e3 (patch)
tree1b8dad970ac7901ab0464f81fe2471575ab27ae7 /Carpet/CarpetLib/src/gh.hh
parentb3cb2e1fd6f53c9d593c7ef3ee6ba86e16646513 (diff)
CarpetLib: Correct component and process ids while regridding
During regridding, there are two sets of component indices and process numbers, namely those of the old and of the new grid structure. Previously, Carpet would erroneously always use those of the new grid structure; this fails when the number of components changes.
Diffstat (limited to 'Carpet/CarpetLib/src/gh.hh')
-rw-r--r--Carpet/CarpetLib/src/gh.hh17
1 files changed, 14 insertions, 3 deletions
diff --git a/Carpet/CarpetLib/src/gh.hh b/Carpet/CarpetLib/src/gh.hh
index 1db0238c9..52fae64d0 100644
--- a/Carpet/CarpetLib/src/gh.hh
+++ b/Carpet/CarpetLib/src/gh.hh
@@ -53,6 +53,8 @@ public: // should be readonly
private:
vector<vector<int> > global_components_; // [rl][lc]
vector<vector<int> > local_components_; // [rl][c]
+ vector<vector<int> > old_global_components_; // [rl][lc]
+ vector<vector<int> > old_local_components_; // [rl][c]
public:
// Extents of the regions before distributing them over the
@@ -137,9 +139,18 @@ public:
return processor(rl,c) == dist::rank();
}
- int local_components (int rl) const CCTK_ATTRIBUTE_PURE;
- int get_component (int rl, int lc) const CCTK_ATTRIBUTE_PURE;
- int get_local_component (int rl, int c) const CCTK_ATTRIBUTE_PURE;
+ int local_components (int rl) const CCTK_MEMBER_ATTRIBUTE_PURE;
+ int get_component (int rl, int lc) const CCTK_MEMBER_ATTRIBUTE_PURE;
+ int get_local_component (int rl, int c) const CCTK_MEMBER_ATTRIBUTE_PURE;
+
+ bool old_is_local (const int rl, const int c) const CCTK_MEMBER_ATTRIBUTE_PURE
+ {
+ return old_processor(rl,c) == dist::rank();
+ }
+
+ int old_local_components (int rl) const CCTK_MEMBER_ATTRIBUTE_PURE;
+ int get_old_component (int rl, int lc) const CCTK_MEMBER_ATTRIBUTE_PURE;
+ int get_old_local_component (int rl, int c) const CCTK_MEMBER_ATTRIBUTE_PURE;
#if 0
// Convert between index positions and coordinate positions