From ad6e2598b218d864a49d89d7d75f9c651a14c866 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Fri, 2 Oct 2015 07:14:29 +0200
Subject: [PATCH] Implement the derivative of the projection onto R^n

---
 dune/gfe/realtuple.hh | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/dune/gfe/realtuple.hh b/dune/gfe/realtuple.hh
index 2ef732db..e8b5420b 100644
--- a/dune/gfe/realtuple.hh
+++ b/dune/gfe/realtuple.hh
@@ -3,6 +3,9 @@
 
 #include <dune/common/array.hh>
 #include <dune/common/fvector.hh>
+
+#include <dune/istl/scaledidmatrix.hh>
+
 #include <dune/gfe/tensor3.hh>
 #include <dune/gfe/symmetricmatrix.hh>
 
@@ -36,6 +39,9 @@ public:
     /** \brief The global convexity radius of the Euclidean space */
     static constexpr double convexityRadius = std::numeric_limits<double>::infinity();
 
+    /** \brief The return type of the derivativeOfProjection method */
+    typedef Dune::ScaledIdentityMatrix<T, N> DerivativeOfProjection;
+
     /** \brief Default constructor */
     RealTuple()
     {}
@@ -158,6 +164,15 @@ public:
         return EmbeddedTangentVector(0);
     }
 
+    /** \brief Derivative of the projection from the embedding space onto the manifold
+     *
+     * For RealTuples this is simply the identity
+     */
+    static DerivativeOfProjection derivativeOfProjection(const Dune::FieldVector<T,N>& p)
+    {
+      return Dune::ScaledIdentityMatrix<T,N>(1.0);
+    }
+
     /** \brief The global coordinates, if you really want them */
     const Dune::FieldVector<T,N>& globalCoordinates() const {
         return data_;
-- 
GitLab