From 5512491fbe393858bacd36f80581672511853613 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz>
Date: Fri, 25 Oct 2019 16:26:30 +0200
Subject: [PATCH] Fixed getEntityMeasure specializations

---
 src/TNL/Meshes/Geometry/getEntityMeasure.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/TNL/Meshes/Geometry/getEntityMeasure.h b/src/TNL/Meshes/Geometry/getEntityMeasure.h
index a3381ed96b..070c28c583 100644
--- a/src/TNL/Meshes/Geometry/getEntityMeasure.h
+++ b/src/TNL/Meshes/Geometry/getEntityMeasure.h
@@ -116,8 +116,8 @@ getEntityMeasure( const Mesh< MeshConfig, Device > & mesh,
     const auto& v1 = mesh.template getEntity< 0 >( entity.template getSubentityIndex< 0 >( 1 ) );
     const auto& v2 = mesh.template getEntity< 0 >( entity.template getSubentityIndex< 0 >( 2 ) );
     using Point = decltype( v0.getPoint() );
-    Point p1 = v2.getPoint() - v0.getPoint();
-    Point p2 = v1.getPoint() - v0.getPoint();
+    const Point p1 = v2.getPoint() - v0.getPoint();
+    const Point p2 = v1.getPoint() - v0.getPoint();
     return getTriangleArea( p1, p2 );
 }
 
@@ -134,7 +134,10 @@ getEntityMeasure( const Mesh< MeshConfig, Device > & mesh,
     const auto& v1 = mesh.template getEntity< 0 >( entity.template getSubentityIndex< 0 >( 1 ) );
     const auto& v2 = mesh.template getEntity< 0 >( entity.template getSubentityIndex< 0 >( 2 ) );
     const auto& v3 = mesh.template getEntity< 0 >( entity.template getSubentityIndex< 0 >( 3 ) );
-    return getTriangleArea( v2.getPoint() - v0.getPoint(), v3.getPoint() - v1.getPoint() );
+    using Point = decltype( v0.getPoint() );
+    const Point p1 = v2.getPoint() - v0.getPoint();
+    const Point p2 = v3.getPoint() - v1.getPoint();
+    return getTriangleArea( p1, p2 );
 }
 
 template< typename VectorExpression >
-- 
GitLab