From 06069c8ec6f31a3ff3dcd202f81668093b2d118e Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sun, 4 Feb 2007 19:20:00 +0000 Subject: CarpetLib: Make ggf::cycle more efficient darcs-hash:20070204192032-dae7b-10c06e6529291abe5a3dda8ae1d0022a23837ac3.gz --- Carpet/CarpetLib/src/ggf.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Carpet/CarpetLib') diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 759fb7a63..f3d215e44 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -281,11 +281,14 @@ void ggf::cycle (int const rl, int const c, int const ml) { assert (rl>=0 and rl=0 and c=0 and ml0; --tl) { - storage.at(ml).at(rl).at(c).at(tl) = storage.at(ml).at(rl).at(c).at(tl-1); + int const ntl = timelevels(ml,rl); + assert (ntl > 0); + fdata & fdatas = storage.AT(ml).AT(rl).AT(c); + gdata * const tmpdata = fdatas.AT(ntl-1); + for (int tl=ntl-1; tl>0; --tl) { + fdatas.AT(tl) = fdatas.AT(tl-1); } - storage.at(ml).at(rl).at(c).at(0) = tmpdata; + fdatas.AT(0) = tmpdata; } // Flip the time levels by exchanging the data sets -- cgit v1.2.3