From b4f23bf3a31d6965cdaeaebeb6933049ced21838 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Mon, 27 Feb 2012 09:23:48 +0100
Subject: [PATCH] Cleanup

---
 src/one-body-sample.cc | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 4c7c0bf6..ef690306 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -451,16 +451,19 @@ int main(int argc, char *argv[]) {
       u4 += u4_diff;
       s4_old = *s4_new;
 
-      if (parset.get<bool>("printEvolution")) {
-        // Print displacement on frictional boundary
-        boost::format const formatter("s[%02d] = %+3e, "
-                                      "%|40t|u[%02d] = %+3e");
-        for (size_t i = 0; i < frictionalNodes.size(); ++i)
-          if (frictionalNodes[i][0]) {
-            std::cout << boost::format(formatter) % i % (*s4_new)[i] % i % u4[i]
-                      << std::endl;
-            break; // Only print the first element
-          }
+      if (!parset.get<bool>("printEvolution"))
+        continue;
+
+      // Find the first node that belongs to the frictional boundary
+      for (size_t i = 0; i < frictionalNodes.size(); ++i) {
+        if (!frictionalNodes[i][0])
+          continue;
+
+        boost::format const formatter("s[%03d] = %+3e, "
+                                      "%|40t|u[%03d] = %+3e");
+        std::cout << boost::format(formatter) % run % (*s4_new)[i] % run % u4[i]
+                  << std::endl;
+        break;
       }
 
       // Compute von Mises stress and write everything to a file
-- 
GitLab