diff --git a/dune/gfe/localprojectedfefunction.hh b/dune/gfe/localprojectedfefunction.hh index 31db2a19b4197fe9151bac3a3c421da006ddf3a8..583eee2e1ed34317b082b5712f8aed8f79d81d50 100644 --- a/dune/gfe/localprojectedfefunction.hh +++ b/dune/gfe/localprojectedfefunction.hh @@ -122,7 +122,7 @@ Dune::FieldMatrix< K, m, p > operator* ( const Dune::FieldMatrix< K, m, n > &A, for (size_t i=0; i<coefficients_.size(); i++) c.axpy(w[i][0], coefficients_[i].globalCoordinates()); - return TargetSpace(c); + return TargetSpace::projectOnto(c); } template <int dim, class ctype, class LocalFiniteElement, class TargetSpace> diff --git a/dune/gfe/realtuple.hh b/dune/gfe/realtuple.hh index 64bb0ee931e2a47dda40c68be80b88cd9ca711a0..5d47b0d178b959b9b8465589e8b66b5a66042ff0 100644 --- a/dune/gfe/realtuple.hh +++ b/dune/gfe/realtuple.hh @@ -176,6 +176,15 @@ public: return EmbeddedTangentVector(0); } + /** \brief Projection from the embedding space onto the manifold + * + * For RealTuples this is simply the identity map + */ + static RealTuple<T,N> projectOnto(const CoordinateType& p) + { + return RealTuple<T,N>(p); + } + /** \brief Derivative of the projection from the embedding space onto the manifold * * For RealTuples this is simply the identity diff --git a/dune/gfe/unitvector.hh b/dune/gfe/unitvector.hh index 168d3153a6b507b4d97674443e0153dc5c40d6d4..51a6351e93ba6df8946d6a1a5a85024c3284f181 100644 --- a/dune/gfe/unitvector.hh +++ b/dune/gfe/unitvector.hh @@ -403,6 +403,13 @@ public: return result; } + static UnitVector<T,N> projectOnto(const CoordinateType& p) + { + UnitVector<T,N> result(p); + result.data_ /= result.data_.two_norm(); + return result; + } + static DerivativeOfProjection derivativeOfProjection(const Dune::FieldVector<T,N>& p) { Dune::FieldMatrix<T,N,N> result;