]> https://gitweb.dealii.org/ - dealii.git/commitdiff
SD Product types: Add general product type between tensors and SD Expressions 11899/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 6 Feb 2021 20:23:02 +0000 (21:23 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 13 Mar 2021 12:56:58 +0000 (13:56 +0100)
doc/news/changes/minor/20210313Jean-PaulPelteret-3 [new file with mode: 0644]
include/deal.II/differentiation/sd/symengine_product_types.h

diff --git a/doc/news/changes/minor/20210313Jean-PaulPelteret-3 b/doc/news/changes/minor/20210313Jean-PaulPelteret-3
new file mode 100644 (file)
index 0000000..1e11c1a
--- /dev/null
@@ -0,0 +1,6 @@
+Improved: The result type deduction for the product of symbolic types 
+(specifically, Differentiation::SD::Expression) with tensors and symmetric
+tensors has been improved.
+<br>
+(Jean-Paul Pelteret, 2021/03/13)
+
index d90b9f4a706aee94c00443cc24253fc18ad2009f..745a32c7d55ecdd8d2dcf8948ae39f567067b9c7 100644 (file)
@@ -21,7 +21,9 @@
 #ifdef DEAL_II_WITH_SYMENGINE
 
 
+#  include <deal.II/base/symmetric_tensor.h>
 #  include <deal.II/base/template_constraints.h>
+#  include <deal.II/base/tensor.h>
 
 #  include <deal.II/differentiation/sd/symengine_number_types.h>
 
@@ -81,6 +83,26 @@ namespace internal
       using type = Differentiation::SD::Expression;
     };
 
+    template <int rank, int dim, typename T>
+    struct GeneralProductTypeImpl<Tensor<rank, dim, T>,
+                                  Differentiation::SD::Expression>
+    {
+      using type =
+        Tensor<rank,
+               dim,
+               typename ProductType<T, Differentiation::SD::Expression>::type>;
+    };
+
+    template <int rank, int dim, typename T>
+    struct GeneralProductTypeImpl<SymmetricTensor<rank, dim, T>,
+                                  Differentiation::SD::Expression>
+    {
+      using type = SymmetricTensor<
+        rank,
+        dim,
+        typename ProductType<T, Differentiation::SD::Expression>::type>;
+    };
+
   } // namespace SD
 
 

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.