]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Instantiate ADDrivers classes with AD::NumberTypes::none.
authorJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 10 May 2019 20:33:16 +0000 (22:33 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Fri, 10 May 2019 20:37:43 +0000 (22:37 +0200)
source/differentiation/ad/CMakeLists.txt
source/differentiation/ad/ad_drivers.cc
source/differentiation/ad/ad_drivers.inst.in [new file with mode: 0644]

index 9a2f31e4dc6770f5432a9a6e0cc797a08a19ed93..532ce9d291e3f72c17279bc3848b9c12bf1952dc 100644 (file)
@@ -23,6 +23,7 @@ SET(_src
   )
 
 SET(_inst
+  ad_drivers.inst.in
   ad_drivers.inst1.in
   ad_drivers.inst2.in
   ad_helpers.inst1.in
index a7882568d3d084ddd105afe1fd8f62dc65a95baf..af6a49f008ce5db4f9e2a223f932394be59fe7b0 100644 (file)
@@ -2244,6 +2244,7 @@ namespace Differentiation
 
 
 /* --- Explicit instantiations --- */
+#  include "ad_drivers.inst"
 #  ifdef DEAL_II_WITH_ADOLC
 #    include "ad_drivers.inst1"
 #  endif
diff --git a/source/differentiation/ad/ad_drivers.inst.in b/source/differentiation/ad/ad_drivers.inst.in
new file mode 100644 (file)
index 0000000..677bd50
--- /dev/null
@@ -0,0 +1,65 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2018 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+// TODO: Include complex types
+
+for (number : REAL_SCALARS)
+  {
+    namespace Differentiation
+    \{
+      namespace AD
+      \{
+
+        // -------------------------- TapedDrivers ----------------------
+
+        template struct TapedDrivers<typename Differentiation::AD::NumberTraits<
+                                       number,
+                                       NumberTypes::none>::ad_type,
+                                     number>;
+
+        // -------------------------- TapelessDrivers ----------------------
+
+        template struct TapelessDrivers<
+          typename Differentiation::AD::
+            NumberTraits<number, NumberTypes::none>::ad_type,
+          number>;
+
+      \}
+    \}
+  }
+
+// Instantiations for ADHelpers for which the underlying number type is fixed
+for ()
+  {
+    namespace Differentiation
+    \{
+      namespace AD
+      \{
+
+        // -------------------------- Types ----------------------
+
+        template struct Types<typename Differentiation::AD::NumberTraits<
+          double,
+          NumberTypes::none>::ad_type>;
+
+        // -------------------------- Numbers ----------------------
+
+        template struct Numbers<typename Differentiation::AD::NumberTraits<
+          double,
+          NumberTypes::none>::ad_type>;
+
+      \}
+    \}
+  }

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.