From 0334837011498c395a9de03cbe2fadbb61faacc9 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Sat, 1 Feb 2020 20:00:04 +0100 Subject: [PATCH] Fix SymmetricTensor and Tensor ProductType Fixes a compiler error on the old Apple Clang 8.0.0 compiler, where the product type between complex numbers and tensors could not be determined. --- include/deal.II/base/symmetric_tensor.h | 18 ++++++++++++++++++ include/deal.II/base/tensor.h | 14 ++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index ca531dfa5f..f90e3e4d79 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -72,6 +72,24 @@ DEAL_II_CONSTEXPR inline DEAL_II_ALWAYS_INLINE Number namespace internal { + template + struct ProductTypeImpl, std::complex> + { + using type = + SymmetricTensor::type>>; + }; + + template + struct ProductTypeImpl, SymmetricTensor> + { + using type = + SymmetricTensor::type>>; + }; + /** * A namespace for functions and classes that are internal to how the * SymmetricTensor class (and its associate functions) works. diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index a1fbcdc4b8..a1952271f1 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -755,6 +755,20 @@ private: namespace internal { + template + struct ProductTypeImpl, std::complex> + { + using type = + Tensor::type>>; + }; + + template + struct ProductTypeImpl, Tensor> + { + using type = + Tensor::type>>; + }; + /** * The structs below are needed to initialize nested Tensor objects. * Also see numbers.h for another specialization. -- 2.39.5