From ab4cca0743f242975125b8f04d87095277caba3d Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 3 Nov 2011 16:20:22 +0100
Subject: [PATCH] Declare f outside the loop of runs

---
 src/one-body-sample.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 145a8e1e..e91cb778 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -180,8 +180,8 @@ int main() {
     u1 = 0;
     VectorType u2 = u1;
 
+    VectorType f(grid.size(grid.maxLevel(), dim));
     for (size_t run = 1; run <= runs; ++run) {
-      VectorType f(grid.size(grid.maxLevel(), dim));
       f = 0;
       VectorType neumannTerm(grid.size(grid.maxLevel(), dim));
       assemble_neumann<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
-- 
GitLab