diff --git a/dune/gfe/Makefile.am b/dune/gfe/Makefile.am index fd32fe5067014b37060d440aa2361605362ee616..b2417ba39bc3251a4d0a20ae084b4d6efa32d18a 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 b03ee6807aee030d40cd3e675422343c655dedd5..0000000000000000000000000000000000000000 --- 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 bb52b5e3df948dca3195fd65c31dc00dcc008f5a..97b9acbe34aa4d274bae6829399b4d6786ea132e 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 412a0948a0a1580b79a72b632ba0e63c689e9521..528568768a0cd163b128eeb8038260f22455a1db 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 14d92b6adf05bcab90174becfdb181970ce61c29..7ee912a47c34ff8b7874f16631f37d20aba90e68 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 e914dc1db71de4374e3dc59acc132ecd3fc90c0a..51d1961efc09dd9aff88a0f47c28352824d83af4 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 b89b0f4853fa2d9b451ea822d4b3887e661cc48b..c45b2a586a6c927d45621d374a54f0b6f4204489 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 a99a6681abf332d0d717f89fb4de07089f06df76..449188ca7364fbe14cf5a2bb32bd6740e60eea46 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 d96af1efe7b247f1693249a67bfb11ae1c3e64f1..605ec545772d819f59766a0e8d19ec6920f0f969 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>