From a820927e40042758c9f87e37f90e52578a0dc577 Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 7 May 2019 21:47:01 +0200 Subject: [PATCH] Add specialisation for rank-0 Tensor functions - Differentiation::SD::tensor_substitution_map() - Differentiation::SD::tensor_substitute() - Differentiation::SD::tensor_substitute_evaluate() --- .../sd/symengine_tensor_operations.h | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/include/deal.II/differentiation/sd/symengine_tensor_operations.h b/include/deal.II/differentiation/sd/symengine_tensor_operations.h index d1d78a2c6b..12eeaec958 100644 --- a/include/deal.II/differentiation/sd/symengine_tensor_operations.h +++ b/include/deal.II/differentiation/sd/symengine_tensor_operations.h @@ -1305,6 +1305,18 @@ namespace Differentiation } + template + std::vector> + tensor_substitution_map( + const Tensor<0, dim, ExpressionType> &symbol_tensor, + const Tensor<0, dim, ValueType> & value_tensor) + { + const ExpressionType &expression = symbol_tensor; + const ValueType & value = value_tensor; + return {std::make_pair(expression, value)}; + } + + template std::vector> tensor_substitution_map( @@ -1388,6 +1400,16 @@ namespace Differentiation } + template + Tensor<0, dim, Expression> + tensor_substitute(const Tensor<0, dim, Expression> &expression_tensor, + const types::substitution_map & substitution_map) + { + const Expression &expression = expression_tensor; + return substitute(expression, substitution_map); + } + + template SymmetricTensor<4, dim, Expression> tensor_substitute( @@ -1433,6 +1455,17 @@ namespace Differentiation } + template + Tensor<0, dim, ValueType> + tensor_substitute_evaluate( + const Tensor<0, dim, Expression> &expression_tensor, + const types::substitution_map & substitution_map) + { + const Expression &expression = expression_tensor; + return substitute_and_evaluate(expression, substitution_map); + } + + template SymmetricTensor<4, dim, ValueType> tensor_substitute_evaluate( -- 2.39.5