From: Jean-Paul Pelteret Date: Tue, 7 May 2019 19:47:01 +0000 (+0200) Subject: Add specialisation for rank-0 Tensor functions X-Git-Tag: v9.1.0-rc1~35^2~7 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a820927e40042758c9f87e37f90e52578a0dc577;p=dealii.git Add specialisation for rank-0 Tensor functions - Differentiation::SD::tensor_substitution_map() - Differentiation::SD::tensor_substitute() - Differentiation::SD::tensor_substitute_evaluate() --- 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(