From b89438d497c29f34825688bbad00c3d351ba5045 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 23 Mar 2015 09:53:33 +0000
Subject: [PATCH] Use range-based for for cleaner code

[[Imported from SVN: r10110]]
---
 src/finite-strain-elasticity.cc | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/finite-strain-elasticity.cc b/src/finite-strain-elasticity.cc
index 3d7bf5a5..bf6c6b44 100644
--- a/src/finite-strain-elasticity.cc
+++ b/src/finite-strain-elasticity.cc
@@ -146,9 +146,6 @@ int main (int argc, char *argv[]) try
   BitSetVector<1> dirichletVertices(gridView.size(dim), false);
   BitSetVector<1> neumannVertices(gridView.size(dim), false);
 
-  GridType::Codim<dim>::LeafIterator vIt    = gridView.begin<dim>();
-  GridType::Codim<dim>::LeafIterator vEndIt = gridView.end<dim>();
-
   const GridView::IndexSet& indexSet = gridView.indexSet();
 
   // Make Python function that computes which vertices are on the Dirichlet boundary,
@@ -160,15 +157,15 @@ int main (int argc, char *argv[]) try
   lambda = std::string("lambda x: (") + parameterSet.get<std::string>("neumannVerticesPredicate", "0") + std::string(")");
   PythonFunction<FieldVector<double,dim>, bool> pythonNeumannVertices(Python::evaluate(lambda));
 
-  for (; vIt!=vEndIt; ++vIt)
+  for (auto&& v : vertices(gridView))
   {
     bool isDirichlet;
-    pythonDirichletVertices.evaluate(vIt->geometry().corner(0), isDirichlet);
-    dirichletVertices[indexSet.index(*vIt)] = isDirichlet;
+    pythonDirichletVertices.evaluate(v.geometry().corner(0), isDirichlet);
+    dirichletVertices[indexSet.index(v)] = isDirichlet;
 
     bool isNeumann;
-    pythonNeumannVertices.evaluate(vIt->geometry().corner(0), isNeumann);
-    neumannVertices[indexSet.index(*vIt)] = isNeumann;
+    pythonNeumannVertices.evaluate(v.geometry().corner(0), isNeumann);
+    neumannVertices[indexSet.index(v)] = isNeumann;
   }
 
   BoundaryPatch<GridView> dirichletBoundary(gridView, dirichletVertices);
-- 
GitLab