aboutsummaryrefslogtreecommitdiff
path: root/Carpet
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-03-12 16:14:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-03-12 16:14:00 +0000
commit880be55769936e6b37cbacc0e3cb3c00a6ca115d (patch)
tree3ed383cbd63a621fc6a238904fdf3ee8af5b98b3 /Carpet
parent9249a71379db259a4378fc2945b068d1bf36e0fa (diff)
CarpetLib: Small regridding optimisation in gh class
Do not copy the grid hierarchy, swap it instead. darcs-hash:20070312161422-dae7b-df574c2583c94cd81361d6a523c4e678b136f349.gz
Diffstat (limited to 'Carpet')
-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();