From f70534243e4bab8c0648603912a10b8644836253 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sun, 29 Apr 2018 11:17:58 +0200 Subject: [PATCH] Add some specialized functions to Adol-C numbers --- include/deal.II/base/tensor.h | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 2a16e8657b..e53971427c 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -24,6 +24,10 @@ #include #include +#ifdef DEAL_II_WITH_ADOLC +#include // Taped double +#endif + #include #include #include @@ -2257,6 +2261,56 @@ linfty_norm (const Tensor<2,dim,Number> &t) //@} + +#ifndef DOXYGEN + + +#ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING + +// Specialization of functions for Adol-C number types when +// the advanced branching feature is used +template +inline +adouble +l1_norm (const Tensor<2,dim,adouble> &t) +{ + adouble max = internal::NumberType::value(0.0); + for (unsigned int j=0; j::value(0.0); + for (unsigned int i=0; i max), sum, max); + } + + return max; +} + + +template +inline +adouble +linfty_norm (const Tensor<2,dim,adouble> &t) +{ + adouble max = internal::NumberType::value(0.0); + for (unsigned int i=0; i::value(0.0); + for (unsigned int j=0; j max), sum, max); + } + + return max; +} + +#endif // DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING + + +#endif // DOXYGEN + DEAL_II_NAMESPACE_CLOSE // include deprecated non-member functions operating on Tensor -- 2.39.5