From 9c436724a0ac6b8af69bda8792707f7ecd222c5a Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Tue, 1 Mar 2016 06:16:50 +0100
Subject: [PATCH] Make EmbeddedGlobalGFEFunction a callable (accepting global
 coordinates)

---
 dune/gfe/embeddedglobalgfefunction.hh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dune/gfe/embeddedglobalgfefunction.hh b/dune/gfe/embeddedglobalgfefunction.hh
index 724d8259..863f0d37 100644
--- a/dune/gfe/embeddedglobalgfefunction.hh
+++ b/dune/gfe/embeddedglobalgfefunction.hh
@@ -53,6 +53,18 @@ public:
         out = this->operator()(element,local);
     }
 
+    /** \brief Global evaluation */
+    typename TargetSpace::CoordinateType operator()(const Dune::FieldVector<ctype,gridDim>& global) const
+    {
+      HierarchicSearch<typename GridView::Grid,typename GridView::IndexSet> hierarchicSearch(basis_.gridView().grid(),
+                                                                                             basis_.gridView().indexSet());
+
+      auto element = hierarchicSearch.findEntity(global);
+      auto localPos = element.geometry().local(global);
+
+      return this->operator()(element,localPos);
+    }
+
     /** \brief Evaluate the function at local coordinates. */
     typename TargetSpace::CoordinateType operator()(const Element& element, const Dune::FieldVector<ctype,gridDim>& local) const
     {
-- 
GitLab