From bed4451ba7321c80dbbec767896058cb08443d7f Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Thu, 14 Feb 2013 16:07:45 +0000
Subject: [PATCH] New method 'metric' that computes the Riemannian scalar
 product.

This is a new required method for the interface of implementations of
the TargetSpace model.  We haven't needed it previously because all
spaces considered until today were embedded isometrically in a
Euclidean space.

[[Imported from SVN: r9189]]
---
 dune/gfe/hyperbolichalfspacepoint.hh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dune/gfe/hyperbolichalfspacepoint.hh b/dune/gfe/hyperbolichalfspacepoint.hh
index ebab7b27..0c3a5bdc 100644
--- a/dune/gfe/hyperbolichalfspacepoint.hh
+++ b/dune/gfe/hyperbolichalfspacepoint.hh
@@ -527,6 +527,12 @@ public:
 
         return Dune::FieldMatrix<T,N,N>(result);
     }
+    
+    /** \brief Scalar product of two tangent vectors */
+    T metric(const TangentVector& v, const TangentVector& w) const
+    {
+        return v*w/(data_[N-1]*data_[N-1]);
+    }
 
     /** \brief Write unit vector object to output stream */
     friend std::ostream& operator<< (std::ostream& s, const HyperbolicHalfspacePoint& p)
-- 
GitLab