aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib/src')
-rw-r--r--Carpet/CarpetLib/src/gh.cc3
-rw-r--r--Carpet/CarpetLib/src/gh.hh2
2 files changed, 3 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc
index 159aa1e3d..1fa06ee2d 100644
--- a/Carpet/CarpetLib/src/gh.cc
+++ b/Carpet/CarpetLib/src/gh.cc
@@ -43,7 +43,8 @@ void gh::regrid (mregs const & regs)
DECLARE_CCTK_PARAMETERS;
// Save the old grid hierarchy
- _oldregions = _regions;
+ _oldregions.clear ();
+ swap (_oldregions, _regions);
_regions = regs;
// Consistency checks
diff --git a/Carpet/CarpetLib/src/gh.hh b/Carpet/CarpetLib/src/gh.hh
index c48f3cd9c..619aeebf0 100644
--- a/Carpet/CarpetLib/src/gh.hh
+++ b/Carpet/CarpetLib/src/gh.hh
@@ -125,7 +125,7 @@ public:
{
return (int)_regions.AT(0).AT(rl).size();
}
-
+
bool is_local (const int rl, const int c) const
{
return processor(rl,c) == dist::rank();