Reference documentation for deal.II version GIT 368e8637aa 2023-09-27 11:20:02+00:00
\(\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\}}\)
symengine_product_types.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2019 - 2022 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 
38 template <>
39 struct EnableIfScalar<Differentiation::SD::Expression>
40 {
42 };
43 
44 
45 namespace internal
46 {
47  namespace SD
48  {
63  template <typename T, typename U, typename V = void>
65 
66  template <typename T>
68  Differentiation::SD::Expression,
69  std::enable_if_t<std::is_arithmetic_v<T>>>
70  {
72  };
73 
74  template <typename T>
76  T,
77  Differentiation::SD::Expression,
78  std::enable_if_t<boost::is_complex<T>::value &&
79  std::is_arithmetic_v<typename T::value_type>>>
80  {
82  };
83 
84  template <int rank, int dim, typename T>
85  struct GeneralProductTypeImpl<Tensor<rank, dim, T>,
86  Differentiation::SD::Expression>
87  {
88  using type =
89  Tensor<rank,
90  dim,
92  };
93 
94  template <int rank, int dim, typename T>
96  Differentiation::SD::Expression>
97  {
99  rank,
100  dim,
102  };
103 
104  } // namespace SD
105 
106 
107  template <>
108  struct ProductTypeImpl<Differentiation::SD::Expression,
110  {
112  };
113 
114 
115  template <typename T>
116  struct ProductTypeImpl<T, Differentiation::SD::Expression>
117  {
118  using type = typename SD::
119  GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
120  };
121 
122  template <typename T>
123  struct ProductTypeImpl<Differentiation::SD::Expression, T>
124  {
125  using type = typename SD::
126  GeneralProductTypeImpl<T, Differentiation::SD::Expression>::type;
127  };
128 
129 } // namespace internal
130 
132 
133 #endif // DEAL_II_WITH_SYMENGINE
134 
135 #endif
Definition: tensor.h:516
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
static const char T
typename internal::ProductTypeImpl< std::decay_t< T >, std::decay_t< U > >::type type
typename SD::GeneralProductTypeImpl< T, Differentiation::SD::Expression >::type type
typename SD::GeneralProductTypeImpl< T, Differentiation::SD::Expression >::type type