From 6e3f38e4ed7f12770460098d3a52ce50b349932c Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Tue, 3 Sep 2013 16:29:16 +0000
Subject: [PATCH] Don't abort when no Neumann function is given

[[Imported from SVN: r9389]]
---
 dune/gfe/cosseratenergystiffness.hh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dune/gfe/cosseratenergystiffness.hh b/dune/gfe/cosseratenergystiffness.hh
index 140d82ad..7868e45e 100644
--- a/dune/gfe/cosseratenergystiffness.hh
+++ b/dune/gfe/cosseratenergystiffness.hh
@@ -551,7 +551,8 @@ energy(const Entity& element,
     //   Assemble boundary contributions
     //////////////////////////////////////////////////////////////////////////////
 
-    assert(neumannFunction_);
+    if (not neumannFunction_)
+        return energy;
 
     for (typename Entity::LeafIntersectionIterator it = element.ileafbegin(); it != element.ileafend(); ++it) {
 
@@ -992,8 +993,6 @@ assembleGradient(const Entity& element,
     //   Assemble boundary contributions
     //////////////////////////////////////////////////////////////////////////////
 
-    assert(neumannFunction_);
-
     for (typename Entity::LeafIntersectionIterator it = element.ileafbegin(); it != element.ileafend(); ++it) {
 
         if (not neumannBoundary_ or not neumannBoundary_->contains(*it))
-- 
GitLab