From 886a9260c20291ffc6917d99a705cb21d55e00c5 Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Wed, 10 Feb 2016 13:20:00 +0100
Subject: [PATCH] Allow any TargetSpace -- do not hardwire UnitVector<3>

---
 dune/gfe/l2distancesquaredenergy.hh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dune/gfe/l2distancesquaredenergy.hh b/dune/gfe/l2distancesquaredenergy.hh
index 1307fe0d..5e1e5a98 100644
--- a/dune/gfe/l2distancesquaredenergy.hh
+++ b/dune/gfe/l2distancesquaredenergy.hh
@@ -23,7 +23,7 @@ class L2DistanceSquaredEnergy
 public:
 
   // This is the function that we are computing the L2-distance to
-  std::shared_ptr<VirtualGridViewFunction<GridView,UnitVector<double,3> > > origin_;
+  std::shared_ptr<VirtualGridViewFunction<GridView,typename TargetSpace::template rebind<double>::other > > origin_;
 
   /** \brief Assemble the energy for a single element */
   RT energy (const typename Basis::LocalView& localView,
@@ -54,16 +54,16 @@ public:
 
       // The function value
       auto value = localGeodesicFEFunction.evaluate(quadPos);
-      UnitVector<double,3> originValue;
+      typename TargetSpace::template rebind<double>::other originValue;
       origin_->evaluateLocal(element,quadPos, originValue);
 
       // The derivative of the 'origin' function
       // First: as function defined on the reference element
-      typename VirtualGridViewFunction<GridView,UnitVector<double,3> >::DerivativeType originReferenceDerivative;
+      typename VirtualGridViewFunction<GridView,typename TargetSpace::template rebind<double>::other>::DerivativeType originReferenceDerivative;
       origin_->evaluateDerivativeLocal(element,quadPos,originReferenceDerivative);
 
       // The derivative of the function defined on the actual element
-      typename VirtualGridViewFunction<GridView,UnitVector<double,3> >::DerivativeType originDerivative(0);
+      typename VirtualGridViewFunction<GridView,typename TargetSpace::template rebind<double>::other >::DerivativeType originDerivative(0);
 
       auto jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(quadPos);
 
-- 
GitLab