From 2dc45c4653f8cff71055ae4f5aa66b45b613d5cc Mon Sep 17 00:00:00 2001
From: Elias Pipping <elias.pipping@fu-berlin.de>
Date: Thu, 15 Dec 2011 15:07:24 +0100
Subject: [PATCH] Implement operator() for global nonlinearities

---
 dune/tectonic/globalnonlinearity.hh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dune/tectonic/globalnonlinearity.hh b/dune/tectonic/globalnonlinearity.hh
index 4ea304e0..b8c62492 100644
--- a/dune/tectonic/globalnonlinearity.hh
+++ b/dune/tectonic/globalnonlinearity.hh
@@ -18,6 +18,15 @@ class GlobalNonlinearity {
   typedef VectorTypeTEMPLATE VectorType;
   typedef MatrixTypeTEMPLATE MatrixType;
 
+  double operator()(VectorType const &x) const {
+    double tmp = 0;
+    for (size_t i = 0; i < x.size(); ++i) {
+      auto const res = restriction(i);
+      tmp += (*res)(x[i]);
+    }
+    return tmp;
+  }
+
   /*
     Return a restriction of the outer function to the i'th node.
   */
-- 
GitLab