From a6f954a23b7b86b44f56afcbdd24e1f713258240 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Sat, 25 Feb 2012 21:38:01 +0100
Subject: [PATCH] Constness, minor cleanup

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

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 6a2ea6bc..327135cb 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -110,21 +110,19 @@ void assemble_neumann(GridView const &gridView, FEBasis const &feBasis,
                       Dune::BlockVector<LocalVectorType> &f,
                       double time) { // constant sample function on neumann
                                      // boundary
-  BoundaryPatch<GridView> neumannBoundary(gridView, neumannNodes);
+  BoundaryPatch<GridView> const neumannBoundary(gridView, neumannNodes);
   LocalVectorType SampleVector(0);
   // FIXME: random values (time-dependent)
   SampleVector[0] =
       (time <= 0.5) ? sin(time * 2 * M_PI) * 1e3 : (time - 0.5) * 2 * 1e4;
   SampleVector[1] = 0;
-  ConstantFunction<LocalVectorType, LocalVectorType> fNeumann(SampleVector);
+  ConstantFunction<LocalVectorType, LocalVectorType> const fNeumann(
+      SampleVector);
   NeumannBoundaryAssembler<GridType, LocalVectorType> neumannBoundaryAssembler(
       fNeumann);
 
-  BoundaryFunctionalAssembler<FEBasis> boundaryFunctionalAssembler(
-      feBasis, neumannBoundary);
-  boundaryFunctionalAssembler.assemble(
-      neumannBoundaryAssembler, f,
-      true); // whether to resize the output vector and zero all of its entries
+  BoundaryFunctionalAssembler<FEBasis>(feBasis, neumannBoundary).assemble(
+      neumannBoundaryAssembler, f, true); // resize and zero output vector
 }
 
 // Assembles constant 1-function on frictional boundary in nodalIntegrals
@@ -133,12 +131,12 @@ Dune::shared_ptr<Dune::BlockVector<Dune::FieldVector<double, 1>>>
 assemble_frictional(GridView const &gridView, FEBasis const &feBasis,
                     Dune::BitSetVector<1> const &frictionalNodes) {
   typedef Dune::FieldVector<double, 1> Singleton;
-  BoundaryPatch<GridView> frictionalBoundary(gridView, frictionalNodes);
-  ConstantFunction<LocalVectorType, Singleton> constantOneFunction(1);
+  BoundaryPatch<GridView> const frictionalBoundary(gridView, frictionalNodes);
+  ConstantFunction<LocalVectorType, Singleton> const constantOneFunction(1);
   NeumannBoundaryAssembler<GridType, Singleton> frictionalBoundaryAssembler(
       constantOneFunction);
 
-  auto nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
+  auto const nodalIntegrals = Dune::make_shared<Dune::BlockVector<Singleton>>();
   BoundaryFunctionalAssembler<FEBasis>(feBasis, frictionalBoundary)
       .assemble(frictionalBoundaryAssembler, *nodalIntegrals,
                 true); // resize and zero output vector
-- 
GitLab