From a8242782640ce2a752dd4a9b61e88ea8c707828f Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 6 Feb 2021 21:23:02 +0100 Subject: [PATCH] SD Product types: Add general product type between tensors and SD Expressions --- .../changes/minor/20210313Jean-PaulPelteret-3 | 6 +++++ .../sd/symengine_product_types.h | 22 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 doc/news/changes/minor/20210313Jean-PaulPelteret-3 diff --git a/doc/news/changes/minor/20210313Jean-PaulPelteret-3 b/doc/news/changes/minor/20210313Jean-PaulPelteret-3 new file mode 100644 index 0000000000..1e11c1a65a --- /dev/null +++ b/doc/news/changes/minor/20210313Jean-PaulPelteret-3 @@ -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. +
+(Jean-Paul Pelteret, 2021/03/13) + diff --git a/include/deal.II/differentiation/sd/symengine_product_types.h b/include/deal.II/differentiation/sd/symengine_product_types.h index d90b9f4a70..745a32c7d5 100644 --- a/include/deal.II/differentiation/sd/symengine_product_types.h +++ b/include/deal.II/differentiation/sd/symengine_product_types.h @@ -21,7 +21,9 @@ #ifdef DEAL_II_WITH_SYMENGINE +# include # include +# include # include @@ -81,6 +83,26 @@ namespace internal using type = Differentiation::SD::Expression; }; + template + struct GeneralProductTypeImpl, + Differentiation::SD::Expression> + { + using type = + Tensor::type>; + }; + + template + struct GeneralProductTypeImpl, + Differentiation::SD::Expression> + { + using type = SymmetricTensor< + rank, + dim, + typename ProductType::type>; + }; + } // namespace SD -- 2.39.5