From 2fd649ed40ba9cb3128186030d34d78dee1293bb Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Sun, 10 Apr 2022 21:10:10 +0200
Subject: [PATCH] Stop using deprecated header power.hh

---
 dune/gfe/hyperbolichalfspacepoint.hh | 22 +++++++++++-----------
 dune/gfe/productmanifold.hh          |  3 +--
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/dune/gfe/hyperbolichalfspacepoint.hh b/dune/gfe/hyperbolichalfspacepoint.hh
index 0077fb5e..a8a803d4 100644
--- a/dune/gfe/hyperbolichalfspacepoint.hh
+++ b/dune/gfe/hyperbolichalfspacepoint.hh
@@ -3,7 +3,7 @@
 
 #include <dune/common/fvector.hh>
 #include <dune/common/fmatrix.hh>
-#include <dune/common/power.hh>
+#include <dune/common/math.hh>
 
 #include <dune/istl/scaledidmatrix.hh>
 
@@ -376,7 +376,7 @@ public:
                     
                     } else if (i!=N-1 and j==N-1 and k==N-1) {
                     
-                        dFdqdqdq[i][j][k] = -2*(p[i] - q[i]) / (p[N-1]*Dune::Power<3>::eval(q[N-1]));
+                        dFdqdqdq[i][j][k] = -2*(p[i] - q[i]) / (p[N-1]*Dune::power(q[N-1],3));
                     
                     } else if (i==N-1 and j!=N-1 and k!=N-1) {
                     
@@ -384,16 +384,16 @@ public:
                     
                     } else if (i==N-1 and j!=N-1 and k==N-1) {
                     
-                        dFdqdqdq[i][j][k] = -2*(p[j] - q[j]) / (p[N-1]*Dune::Power<3>::eval(q[N-1]));
+                        dFdqdqdq[i][j][k] = -2*(p[j] - q[j]) / (p[N-1]*Dune::power(q[N-1],3));
                     
                     } else if (i==N-1 and j==N-1 and k!=N-1) {
                     
-                        dFdqdqdq[i][j][k] = -2*(p[k] - q[k]) / (p[N-1]*Dune::Power<3>::eval(q[N-1]));
+                        dFdqdqdq[i][j][k] = -2*(p[k] - q[k]) / (p[N-1]*Dune::power(q[N-1],3));
                 
                     } else if (i==N-1 and j==N-1 and k==N-1) {
                     
-                        dFdqdqdq[i][j][k] = -2/Dune::Power<3>::eval(q[N-1]) - 1/(p[N-1]*q[N-1]*q[N-1]) - 4*(p[N-1]-q[N-1])/(p[N-1]*Dune::Power<3>::eval(q[N-1]))
-                                            - 3*diffNormSquared / (p[N-1]*Dune::Power<4>::eval(q[N-1]));
+                        dFdqdqdq[i][j][k] = -2/Dune::power(q[N-1],3) - 1/(p[N-1]*q[N-1]*q[N-1]) - 4*(p[N-1]-q[N-1])/(p[N-1]*Dune::power(q[N-1],3))
+                                            - 3*diffNormSquared / (p[N-1]*Dune::power(q[N-1],4));
                 
                     }
                     
@@ -464,7 +464,7 @@ public:
                     
                     } else if (i!=N-1 and j==N-1 and k==N-1) {
                     
-                        dFdpdqdq[i][j][k] = 2*(p[i] - q[i]) / (p[N-1]*Dune::Power<3>::eval(q[N-1]));
+                        dFdpdqdq[i][j][k] = 2*(p[i] - q[i]) / (p[N-1]*Dune::power(q[N-1],3));
                     
                     } else if (i==N-1 and j!=N-1 and k!=N-1) {
                     
@@ -472,18 +472,18 @@ public:
                     
                     } else if (i==N-1 and j!=N-1 and k==N-1) {
                     
-                        dFdpdqdq[i][j][k] = -(p[j] - q[j]) / (p[N-1]*p[N-1]*Dune::Power<2>::eval(q[N-1]));
+                        dFdpdqdq[i][j][k] = -(p[j] - q[j]) / (p[N-1]*p[N-1]*Dune::power(q[N-1],2));
                     
                     } else if (i==N-1 and j==N-1 and k!=N-1) {
                     
-                        dFdpdqdq[i][j][k] = -(p[k] - q[k]) / (p[N-1]*p[N-1]*Dune::Power<2>::eval(q[N-1]));
+                        dFdpdqdq[i][j][k] = -(p[k] - q[k]) / (p[N-1]*p[N-1]*Dune::power(q[N-1],2));
                 
                     } else if (i==N-1 and j==N-1 and k==N-1) {
                     
                         dFdpdqdq[i][j][k] = 1.0/(p[N-1]*q[N-1]*q[N-1])
-                                          + 2*(p[N-1]-q[N-1])/(p[N-1]*Dune::Power<3>::eval(q[N-1]))
+                                          + 2*(p[N-1]-q[N-1])/(p[N-1]*Dune::power(q[N-1],3))
                                           -   (p[N-1]-q[N-1])/(p[N-1]*p[N-1]*q[N-1]*q[N-1])
-                                          - diffNormSquared / (p[N-1]*p[N-1]*Dune::Power<3>::eval(q[N-1]));
+                                          - diffNormSquared / (p[N-1]*p[N-1]*Dune::power(q[N-1],3));
                 
                     }
                     
diff --git a/dune/gfe/productmanifold.hh b/dune/gfe/productmanifold.hh
index ebecd8d4..951723bc 100644
--- a/dune/gfe/productmanifold.hh
+++ b/dune/gfe/productmanifold.hh
@@ -8,7 +8,6 @@
 #include <dune/common/math.hh>
 #include <dune/common/hybridutilities.hh>
 #include <dune/common/tuplevector.hh>
-#include <dune/common/power.hh>
 
 #include <dune/gfe/linearalgebra.hh>
 
@@ -188,7 +187,7 @@ namespace Dune::GFE
           const auto& a = std::get<1>(argsTuple)[manifoldInt];
           const auto& b = std::get<2>(argsTuple)[manifoldInt];
           using Manifold = std::remove_const_t<typename std::remove_reference_t<decltype(a)> >;
-          res += Dune::Power<2>().eval(Manifold::distance(a,b));
+          res += power(Manifold::distance(a,b),2);
       };
       foreachManifold(distanceFunctor,dist,a, b);
       return sqrt(dist);
-- 
GitLab