]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add specialisation for rank-0 Tensor functions
authorJean-Paul Pelteret <jppelteret@gmail.com>
Tue, 7 May 2019 19:47:01 +0000 (21:47 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sun, 12 May 2019 19:24:02 +0000 (21:24 +0200)
- Differentiation::SD::tensor_substitution_map()
- Differentiation::SD::tensor_substitute()
- Differentiation::SD::tensor_substitute_evaluate()

include/deal.II/differentiation/sd/symengine_tensor_operations.h

index d1d78a2c6bafe05543eb44efee3f56d2001a9665..12eeaec958ab9f51137f9d409069bd79c0438f19 100644 (file)
@@ -1305,6 +1305,18 @@ namespace Differentiation
       }
 
 
+      template <int dim, typename ExpressionType, typename ValueType>
+      std::vector<std::pair<ExpressionType, ValueType>>
+      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 <int dim, typename ExpressionType, typename ValueType>
       std::vector<std::pair<ExpressionType, ValueType>>
       tensor_substitution_map(
@@ -1388,6 +1400,16 @@ namespace Differentiation
       }
 
 
+      template <int dim>
+      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 <int dim>
       SymmetricTensor<4, dim, Expression>
       tensor_substitute(
@@ -1433,6 +1455,17 @@ namespace Differentiation
       }
 
 
+      template <typename ValueType, int dim>
+      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<ValueType>(expression, substitution_map);
+      }
+
+
       template <typename ValueType, int dim>
       SymmetricTensor<4, dim, ValueType>
       tensor_substitute_evaluate(

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.