From: Jean-Paul Pelteret Date: Fri, 27 Apr 2018 00:46:39 +0000 (+0200) Subject: Adol-C advanced branching: Fix Tensor X-Git-Tag: v9.0.0-rc1~35^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a63ce49cc45a6e2d3db7eb26c4567ed7725bee13;p=dealii.git Adol-C advanced branching: Fix Tensor --- diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 7ad948b63b..2a16e8657b 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -833,7 +833,13 @@ template inline bool Tensor<0,dim,Number>::operator == (const Tensor<0,dim,OtherNumber> &p) const { - return (value == p.value); +#ifdef DEAL_II_ADOLC_WITH_ADVANCED_BRANCHING + Assert(!(std::is_same::value || std::is_same::value), + ExcMessage("The Tensor equality operator for Adol-C taped numbers has not yet " + "been extended to support advanced branching.")); +#endif + + return numbers::values_are_equal(value,p.value); } @@ -1141,8 +1147,7 @@ inline DEAL_II_ALWAYS_INLINE Tensor & Tensor::operator = (const Number &d) { - Assert (d == internal::NumberType::value(0.0), - ExcMessage ("Only assignment with zero is allowed")); + Assert (numbers::value_is_zero(d), ExcMessage ("Only assignment with zero is allowed")); (void) d; for (unsigned int i=0; i