From dad91c4b5dbe663df24e074b7435362187eb1cb3 Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 3 Nov 2011 16:23:37 +0100
Subject: [PATCH] Assemble 1-function on frictional boundary once

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

diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc
index 7e5a5c23..043d8855 100644
--- a/src/one-body-sample.cc
+++ b/src/one-body-sample.cc
@@ -181,6 +181,11 @@ int main() {
     VectorType u2 = u1;
 
     VectorType f(grid.size(grid.maxLevel(), dim));
+
+    std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
+    assemble_frictional<GridType, GridType::LeafGridView, SmallVector, P1Basis>(
+        leafView, p1Basis, frictionalNodes, nodalIntegrals);
+
     for (size_t run = 1; run <= runs; ++run) {
       f = 0;
       VectorType neumannTerm(grid.size(grid.maxLevel(), dim));
@@ -189,11 +194,6 @@ int main() {
       f += neumannTerm;
 
       // {{{ Assemble terms for the nonlinearity
-      std::vector<Dune::FieldVector<double, 1>> nodalIntegrals;
-      assemble_frictional<GridType, GridType::LeafGridView, SmallVector,
-                          P1Basis>(leafView, p1Basis, frictionalNodes,
-                                   nodalIntegrals);
-
       // TODO: Random value
       std::vector<double> normalStress;
       normalStress.resize(grid.size(grid.maxLevel(), dim));
-- 
GitLab