From ec5ea5e64cc0e4225c49169987e05e2b34c461df Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Mon, 23 Mar 2015 08:09:17 +0000
Subject: [PATCH] Remove file adolcnamespaceinjections.hh, use the
 corresponding version from dune-fufem instead

[[Imported from SVN: r10103]]
---
 dune/gfe/Makefile.am                      |   3 +-
 dune/gfe/adolcnamespaceinjections.hh      | 111 ----------------------
 dune/gfe/localadolcstiffness.hh           |   2 +-
 dune/gfe/localgeodesicfeadolcstiffness.hh |   2 +-
 dune/gfe/mixedlocalgfeadolcstiffness.hh   |   2 +-
 src/cosserat-continuum.cc                 |   3 +-
 src/finite-strain-elasticity.cc           |   3 +-
 src/harmonicmaps.cc                       |   2 +-
 src/mixed-cosserat-continuum.cc           |   3 +-
 9 files changed, 11 insertions(+), 120 deletions(-)
 delete mode 100644 dune/gfe/adolcnamespaceinjections.hh

diff --git a/dune/gfe/Makefile.am b/dune/gfe/Makefile.am
index fd32fe50..b2417ba3 100644
--- a/dune/gfe/Makefile.am
+++ b/dune/gfe/Makefile.am
@@ -5,8 +5,7 @@ SUBDIRS = coupling
 AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/..
 
 srcincludedir = $(includedir)/dune/common
-srcinclude_HEADERS = adolcnamespaceinjections.hh \
-                     averagedistanceassembler.hh \
+srcinclude_HEADERS = averagedistanceassembler.hh \
                      averageinterface.hh \
                      cosseratvtkwriter.hh \
                      cosseratvtkreader.hh \
diff --git a/dune/gfe/adolcnamespaceinjections.hh b/dune/gfe/adolcnamespaceinjections.hh
deleted file mode 100644
index b03ee680..00000000
--- a/dune/gfe/adolcnamespaceinjections.hh
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH
-#define DUNE_GFE_ADOLC_NAMESPACE_INJECTIONS_HH
-
-#include <limits>
-
-adouble sqrt_hack(adouble a) {
-  return sqrt(a);
-}
-
-adouble abs_hack(adouble a) {
-  return fabs(a);
-}
-
-adouble log_hack(adouble a) {
-  return log(a);
-}
-
-adouble pow_hack(const adouble& a, const adouble& b) {
-    return pow(a,b);
-}
-
-adouble pow_hack(const adouble& a, double b) {
-    return pow(a,b);
-}
-
-adouble sin_hack(adouble a) {
-  return sin(a);
-}
-
-adouble cos_hack(adouble a) {
-  return cos(a);
-}
-
-adouble acos_hack(adouble a) {
-  return acos(a);
-}
-
-
-namespace std
-{
-   adouble min(adouble a, adouble b) {
-     // Do not use 'min', because ADOL-C lacks support for that in vector-mode
-     return  (a + b - abs_hack(a - b))*0.5;
-   }
-
-   adouble max(adouble a, adouble b) {
-     // Do not use 'max', because ADOL-C lacks support for that in vector-mode
-     return - min(-a,-b);
-   }
-
-   adouble sqrt(adouble a) {
-     return sqrt_hack(a);
-   }
-
-   adouble abs(adouble a) {
-     return abs_hack(a);
-   }
-
-   adouble log(adouble a) {
-     return log_hack(a);
-   }
-
-   adouble pow(const adouble& a, const adouble& b) {
-     return pow_hack(a,b);
-   }
-
-   adouble pow(const adouble& a, double b) {
-     return pow_hack(a,b);
-   }
-
-   adouble sin(adouble a) {
-     return sin_hack(a);
-   }
-
-   adouble cos(adouble a) {
-     return cos_hack(a);
-   }
-
-   adouble acos(adouble a) {
-     return acos_hack(a);
-   }
-
-   bool isnan(adouble a) {
-     return std::isnan(a.value());
-   }
-
-   bool isinf(adouble a) {
-     return std::isinf(a.value());
-   }
-
-   /** \brief Specialization of the numeric_limits class for adouble */
-   template <>
-   struct numeric_limits<adouble> {
-
-      static adouble max() {
-        return numeric_limits<double>::max();
-      }
-
-      static adouble epsilon() {
-        return numeric_limits<double>::epsilon();
-      }
-      static adouble quiet_NaN() {
-        return numeric_limits<double>::quiet_NaN();
-      }
-
-      static constexpr bool is_integer = false;
-
-   };
-}
-
-#endif
\ No newline at end of file
diff --git a/dune/gfe/localadolcstiffness.hh b/dune/gfe/localadolcstiffness.hh
index bb52b5e3..97b9acbe 100644
--- a/dune/gfe/localadolcstiffness.hh
+++ b/dune/gfe/localadolcstiffness.hh
@@ -7,7 +7,7 @@
 #include <adolc/interfaces.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>             // use of taping
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
 
 #include <dune/common/fmatrix.hh>
 #include <dune/istl/matrix.hh>
diff --git a/dune/gfe/localgeodesicfeadolcstiffness.hh b/dune/gfe/localgeodesicfeadolcstiffness.hh
index 412a0948..52856876 100644
--- a/dune/gfe/localgeodesicfeadolcstiffness.hh
+++ b/dune/gfe/localgeodesicfeadolcstiffness.hh
@@ -7,7 +7,7 @@
 #include <adolc/interfaces.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>             // use of taping
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
 
 #include <dune/common/fmatrix.hh>
 #include <dune/istl/matrix.hh>
diff --git a/dune/gfe/mixedlocalgfeadolcstiffness.hh b/dune/gfe/mixedlocalgfeadolcstiffness.hh
index 14d92b6a..7ee912a4 100644
--- a/dune/gfe/mixedlocalgfeadolcstiffness.hh
+++ b/dune/gfe/mixedlocalgfeadolcstiffness.hh
@@ -7,7 +7,7 @@
 #include <adolc/interfaces.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>             // use of taping
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
 
 #include <dune/common/fmatrix.hh>
 #include <dune/istl/matrix.hh>
diff --git a/src/cosserat-continuum.cc b/src/cosserat-continuum.cc
index e914dc1d..51d1961e 100644
--- a/src/cosserat-continuum.cc
+++ b/src/cosserat-continuum.cc
@@ -13,7 +13,8 @@
 #include <adolc/drivers/drivers.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
+
 #include <dune/common/bitsetvector.hh>
 #include <dune/common/parametertree.hh>
 #include <dune/common/parametertreeparser.hh>
diff --git a/src/finite-strain-elasticity.cc b/src/finite-strain-elasticity.cc
index b89b0f48..c45b2a58 100644
--- a/src/finite-strain-elasticity.cc
+++ b/src/finite-strain-elasticity.cc
@@ -9,7 +9,8 @@
 #include <adolc/drivers/drivers.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
+
 #include <dune/common/bitsetvector.hh>
 #include <dune/common/parametertree.hh>
 #include <dune/common/parametertreeparser.hh>
diff --git a/src/harmonicmaps.cc b/src/harmonicmaps.cc
index a99a6681..449188ca 100644
--- a/src/harmonicmaps.cc
+++ b/src/harmonicmaps.cc
@@ -8,7 +8,7 @@
 // Includes for the ADOL-C automatic differentiation library
 // Need to come before (almost) all others.
 #include <adolc/adouble.h>
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
 
 #include <dune/common/bitsetvector.hh>
 #include <dune/common/parametertree.hh>
diff --git a/src/mixed-cosserat-continuum.cc b/src/mixed-cosserat-continuum.cc
index d96af1ef..605ec545 100644
--- a/src/mixed-cosserat-continuum.cc
+++ b/src/mixed-cosserat-continuum.cc
@@ -13,7 +13,8 @@
 #include <adolc/drivers/drivers.h>    // use of "Easy to Use" drivers
 #include <adolc/taping.h>
 
-#include <dune/gfe/adolcnamespaceinjections.hh>
+#include <dune/fufem/utilities/adolcnamespaceinjections.hh>
+
 #include <dune/common/bitsetvector.hh>
 #include <dune/common/parametertree.hh>
 #include <dune/common/parametertreeparser.hh>
-- 
GitLab