]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure that numbers::NumberTraits works with AD numbers.
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 12 Apr 2018 12:26:47 +0000 (14:26 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 12 Apr 2018 16:43:09 +0000 (18:43 +0200)
doc/news/changes/minor/20180412Jean-PaulPelteret-5 [new file with mode: 0644]
include/deal.II/base/numbers.h

diff --git a/doc/news/changes/minor/20180412Jean-PaulPelteret-5 b/doc/news/changes/minor/20180412Jean-PaulPelteret-5
new file mode 100644 (file)
index 0000000..0cfec9e
--- /dev/null
@@ -0,0 +1,4 @@
+Fixed: Ensure that numbers::NumberTraits and its corresponding operations are 
+well defined for all supported auto-differentiable numbers.
+<br>
+(Jean-Paul Pelteret, 2018/04/12)
index 389329db7eceaeeaab91bd3654fbcfc7bb1669d2..d8b8d25243e6afe6c14c6fc251813e2b4b044df4 100644 (file)
@@ -39,6 +39,17 @@ template <typename T> struct EnableIfScalar;
 
 DEAL_II_NAMESPACE_CLOSE
 
+// Declare / Import auto-differentiable math functions in(to) standard
+// namespace before numbers::NumberTraits is defined
+#include <deal.II/differentiation/ad/adolc_math.h>
+// Ideally we'd like to #include <deal.II/differentiation/ad/sacado_math.h>
+// but header indirectly references numbers.h. We therefore simply
+// import the whole Sacado header at this point to get the math
+// functions imported into the standard namespace.
+#ifdef DEAL_II_WITH_TRILINOS
+#include <Sacado.hpp>
+#endif
+
 namespace std
 {
   template <typename Number> DEAL_II_ALWAYS_INLINE ::dealii::VectorizedArray<Number>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.