Reference documentation for deal.II version 9.4.2
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
symengine_product_types.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2019 - 2021 by the deal.II authors
4//
5// This file is part of the deal.II library.
6//
7// The deal.II library is free software; you can use it, redistribute
8// it, and/or modify it under the terms of the GNU Lesser General
9// Public License as published by the Free Software Foundation; either
10// version 2.1 of the License, or (at your option) any later version.
11// The full text of the license can be found in the file LICENSE at
12// the top level of the deal.II distribution.
13//
14// ---------------------------------------------------------------------
15
16#ifndef dealii_differentiation_sd_symengine_product_types_h
17#define dealii_differentiation_sd_symengine_product_types_h
18
19#include <deal.II/base/config.h>
20
21#ifdef DEAL_II_WITH_SYMENGINE
22
23
26# include <deal.II/base/tensor.h>
27
29
30# include <boost/type_traits.hpp>
31
32# include <type_traits>
33
34
36
37
38template <>
39struct EnableIfScalar<Differentiation::SD::Expression>
40{
42};
43
44
45namespace internal
46{
47 namespace SD
48 {
63 template <typename T, typename U, typename V = void>
65
66 template <typename T>
68 T,
69 Differentiation::SD::Expression,
70 typename std::enable_if<std::is_arithmetic<T>::value>::type>
71 {
73 };
74
75 template <typename T>
77 T,
78 Differentiation::SD::Expression,
79 typename std::enable_if<
80 boost::is_complex<T>::value &&
81 std::is_arithmetic<typename T::value_type>::value>::type>
82 {
84 };
85
86 template <int rank, int dim, typename T>
87 struct GeneralProductTypeImpl<Tensor<rank, dim, T>,
88 Differentiation::SD::Expression>
89 {
90 using type =
91 Tensor<rank,
92 dim,
94 };
95
96 template <int rank, int dim, typename T>
98 Differentiation::SD::Expression>
99 {
101 rank,
102 dim,
104 };
105
106 } // namespace SD
107
108
109 template <>
110 struct ProductTypeImpl<Differentiation::SD::Expression,
112 {
114 };
115
116
117 template <typename T>
118 struct ProductTypeImpl<T, Differentiation::SD::Expression>
119 {
120 using type = typename SD::
121 GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
122 };
123
124 template <typename T>
125 struct ProductTypeImpl<Differentiation::SD::Expression, T>
126 {
127 using type = typename SD::
128 GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
129 };
130
131} // namespace internal
132
134
135#endif // DEAL_II_WITH_SYMENGINE
136
137#endif
Definition: tensor.h:503
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
typename internal::ProductTypeImpl< typename std::decay< T >::type, typename std::decay< U >::type >::type type
typename SD::GeneralProductTypeImpl< T, Differentiation::SD::Expression >::type type
typename SD::GeneralProductTypeImpl< T, Differentiation::SD::Expression >::type type