From: Jean-Paul Pelteret Date: Sun, 29 Apr 2018 09:17:58 +0000 (+0200) Subject: Add some specialized functions to Adol-C numbers X-Git-Tag: v9.0.0-rc1~35^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f70534243e4bab8c0648603912a10b8644836253;p=dealii.git Add some specialized functions to Adol-C numbers --- 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