]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Extend template specialisations for intermediate AD number types. 6921/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 13 Jul 2018 10:03:06 +0000 (12:03 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 15 Jul 2018 10:34:50 +0000 (12:34 +0200)
Its not likely, but it might be possible that in some complex chain of
operations we're left with one of these intermediates that needs to be
operated on or used. If this is the case then having these
specialisations facilitate the driver and helper classes to function
with these number types.

include/deal.II/differentiation/ad/sacado_number_types.h

index 9c4adea9878b083d4e3dd1857c4741e8f057a53b..8781865c5f40fa91bb325ab700e698c4a2b0bddf 100644 (file)
@@ -883,6 +883,16 @@ namespace Differentiation
     {};
 
 
+    template <typename NumberType>
+    struct is_sacado_dfad_number<
+      NumberType,
+      typename std::enable_if<std::is_same<
+        NumberType,
+        Sacado::Fad::Expr<typename NumberType::value_type>>::value>::type>
+      : std::true_type
+    {};
+
+
     template <typename NumberType>
     struct is_sacado_rad_number<
       NumberType,
@@ -894,6 +904,17 @@ namespace Differentiation
     {};
 
 
+    template <typename NumberType>
+    struct is_sacado_rad_number<
+      NumberType,
+      typename std::enable_if<std::is_same<
+        NumberType,
+        Sacado::Rad::ADvari<Sacado::Fad::DFad<
+          typename NumberType::ADVari::scalar_type>>>::value>::type>
+      : std::true_type
+    {};
+
+
     template <typename NumberType>
     struct is_sacado_number<
       NumberType,

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.