From cc55859187a3dbc844fb7df3414b5b7f2f7717b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Fri, 28 Mar 2025 16:01:47 +0100
Subject: [PATCH] Add a jacobianDeterminant version with argument for
 genericity

---
 src/geometry/LineTransformation.hpp        | 8 ++++++++
 src/geometry/TetrahedronTransformation.hpp | 8 ++++++++
 src/geometry/TriangleTransformation.hpp    | 8 ++++++++
 3 files changed, 24 insertions(+)

diff --git a/src/geometry/LineTransformation.hpp b/src/geometry/LineTransformation.hpp
index c9f7def71..4576c0b64 100644
--- a/src/geometry/LineTransformation.hpp
+++ b/src/geometry/LineTransformation.hpp
@@ -24,12 +24,20 @@ class LineTransformation<1>
     return m_jacobian * x + m_shift;
   }
 
+  PUGS_INLINE
   double
   jacobianDeterminant() const
   {
     return m_jacobian;
   }
 
+  PUGS_INLINE
+  double
+  jacobianDeterminant(const TinyVector<1>&) const
+  {
+    return m_jacobian;
+  }
+
   PUGS_INLINE
   LineTransformation(const TinyVector<Dimension>& a, const TinyVector<Dimension>& b)
   {
diff --git a/src/geometry/TetrahedronTransformation.hpp b/src/geometry/TetrahedronTransformation.hpp
index 642442669..a81a344bf 100644
--- a/src/geometry/TetrahedronTransformation.hpp
+++ b/src/geometry/TetrahedronTransformation.hpp
@@ -24,12 +24,20 @@ class TetrahedronTransformation
     return m_jacobian * x + m_shift;
   }
 
+  PUGS_INLINE
   double
   jacobianDeterminant() const
   {
     return m_jacobian_determinant;
   }
 
+  PUGS_INLINE
+  double
+  jacobianDeterminant(const TinyVector<3>&) const
+  {
+    return m_jacobian_determinant;
+  }
+
   PUGS_INLINE
   TetrahedronTransformation(const TinyVector<Dimension>& a,
                             const TinyVector<Dimension>& b,
diff --git a/src/geometry/TriangleTransformation.hpp b/src/geometry/TriangleTransformation.hpp
index 9210e0bda..df8444d89 100644
--- a/src/geometry/TriangleTransformation.hpp
+++ b/src/geometry/TriangleTransformation.hpp
@@ -26,12 +26,20 @@ class TriangleTransformation<2>
     return m_jacobian * x + m_shift;
   }
 
+  PUGS_INLINE
   double
   jacobianDeterminant() const
   {
     return m_jacobian_determinant;
   }
 
+  PUGS_INLINE
+  double
+  jacobianDeterminant(const TinyVector<2>&) const
+  {
+    return m_jacobian_determinant;
+  }
+
   PUGS_INLINE
   TriangleTransformation(const TinyVector<Dimension>& a, const TinyVector<Dimension>& b, const TinyVector<Dimension>& c)
   {
-- 
GitLab