From e27b61ed18a12b77b0e9fc9e99ac30a96fccd660 Mon Sep 17 00:00:00 2001
From: Dmitri Naumov <dmitri.naumov@ufz.de>
Date: Thu, 2 May 2019 18:43:38 +0200
Subject: [PATCH] [PL] Add interpolateCoordinates for elements.

---
 ProcessLib/Utils/InitShapeMatrices.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/ProcessLib/Utils/InitShapeMatrices.h b/ProcessLib/Utils/InitShapeMatrices.h
index 10228ee919e..773188972bb 100644
--- a/ProcessLib/Utils/InitShapeMatrices.h
+++ b/ProcessLib/Utils/InitShapeMatrices.h
@@ -60,4 +60,17 @@ double interpolateXCoordinate(
     return fe.interpolateZerothCoordinate(N);
 }
 
+template <typename ShapeFunction, typename ShapeMatricesType>
+std::array<double, 3> interpolateCoordinates(
+    MeshLib::Element const& e,
+    typename ShapeMatricesType::ShapeMatrices::ShapeType const& N)
+{
+    using FemType = NumLib::TemplateIsoparametric<
+        ShapeFunction, ShapeMatricesType>;
+
+    FemType fe(*static_cast<const typename ShapeFunction::MeshElement*>(&e));
+
+    return fe.interpolateCoordinates(N);
+}
+
 }  // namespace ProcessLib
-- 
GitLab