From 2708b3f7bab2f4c2a15caf58a6d88a2a89344909 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 4 Nov 2024 12:41:09 -0500 Subject: [PATCH] CarpetX: Slight performance improvement in interpolator --- CarpetX/src/interpolate.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CarpetX/src/interpolate.cxx b/CarpetX/src/interpolate.cxx index 91280f70c..38ce78ef3 100644 --- a/CarpetX/src/interpolate.cxx +++ b/CarpetX/src/interpolate.cxx @@ -440,13 +440,14 @@ extern "C" void CarpetX_Interpolate(const CCTK_POINTER_TO_CONST cctkGH_, patches.data(), localsx.data(), localsy.data(), localsz.data()); } else { - // TODO: Don't copy - for (int n = 0; n < npoints; ++n) { - patches[n] = 0; - localsx[n] = globalsx[n]; - localsy[n] = globalsy[n]; - localsz[n] = globalsz[n]; - } + for (int n = 0; n < npoints; ++n) + patches.at(n) = 0; + for (int n = 0; n < npoints; ++n) + localsx.at(n) = globalsx[n]; + for (int n = 0; n < npoints; ++n) + localsy.at(n) = globalsy[n]; + for (int n = 0; n < npoints; ++n) + localsz.at(n) = globalsz[n]; } // Apply symmetries to coordinates