diff --git a/dune/gfe/cosseratenergystiffness.hh b/dune/gfe/cosseratenergystiffness.hh index 140d82ad1f02cbac4e7bb782b4bdaa7c1bdd7e76..7868e45e4785637290f7c849740cf4c0cb713a29 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))