From: Jean-Paul Pelteret Date: Sat, 6 Feb 2021 20:23:02 +0000 (+0100) Subject: SD Product types: Add general product type between tensors and SD Expressions X-Git-Tag: v9.3.0-rc1~333^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8242782640ce2a752dd4a9b61e88ea8c707828f;p=dealii.git SD Product types: Add general product type between tensors and SD Expressions --- 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