16 #ifndef dealii_differentiation_ad_sacado_product_types_h 17 #define dealii_differentiation_ad_sacado_product_types_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/template_constraints.h> 23 #ifdef DEAL_II_TRILINOS_WITH_SACADO 25 # include <Sacado.hpp> 30 # include <Sacado_Fad_DFad.hpp> 32 # include <Sacado_trad.hpp> 34 DEAL_II_NAMESPACE_OPEN
45 struct ProductTypeImpl<Sacado::Fad::DFad<T>, float>
47 using type = Sacado::Fad::DFad<T>;
51 struct ProductTypeImpl<float, Sacado::Fad::DFad<T>>
53 using type = Sacado::Fad::DFad<T>;
57 struct ProductTypeImpl<Sacado::Fad::DFad<T>, double>
59 using type = Sacado::Fad::DFad<T>;
63 struct ProductTypeImpl<double, Sacado::Fad::DFad<T>>
65 using type = Sacado::Fad::DFad<T>;
69 struct ProductTypeImpl<Sacado::Fad::DFad<T>, int>
71 using type = Sacado::Fad::DFad<T>;
75 struct ProductTypeImpl<int, Sacado::Fad::DFad<T>>
77 using type = Sacado::Fad::DFad<T>;
80 template <
typename T,
typename U>
81 struct ProductTypeImpl<Sacado::Fad::DFad<T>, Sacado::Fad::DFad<U>>
83 using type = Sacado::Fad::DFad<typename ProductType<T, U>::type>;
93 template <
typename T,
typename U>
94 struct ProductTypeImpl<Sacado::Fad::Expr<T>, U>
100 template <
typename T,
typename U>
101 struct ProductTypeImpl<T, Sacado::Fad::Expr<U>>
107 template <
typename T,
typename U>
108 struct ProductTypeImpl<Sacado::Fad::Expr<T>, Sacado::Fad::Expr<U>>
112 typename Sacado::Fad::Expr<U>::value_type>::type;
118 template <
typename T>
121 using type = Sacado::Fad::DFad<T>;
124 template <
typename T>
127 using type =
typename Sacado::Fad::Expr<T>::value_type;
138 template <
typename T>
139 struct ProductTypeImpl<Sacado::Rad::ADvar<T>, float>
141 using type = Sacado::Rad::ADvar<T>;
144 template <
typename T>
145 struct ProductTypeImpl<float, Sacado::Rad::ADvar<T>>
147 using type = Sacado::Rad::ADvar<T>;
150 template <
typename T>
151 struct ProductTypeImpl<Sacado::Rad::ADvar<T>, double>
153 using type = Sacado::Rad::ADvar<T>;
156 template <
typename T>
157 struct ProductTypeImpl<double, Sacado::Rad::ADvar<T>>
159 using type = Sacado::Rad::ADvar<T>;
162 template <
typename T>
163 struct ProductTypeImpl<Sacado::Rad::ADvar<T>, int>
165 using type = Sacado::Rad::ADvar<T>;
168 template <
typename T>
169 struct ProductTypeImpl<int, Sacado::Rad::ADvar<T>>
171 using type = Sacado::Rad::ADvar<T>;
174 template <
typename T,
typename U>
175 struct ProductTypeImpl<Sacado::Rad::ADvar<T>, Sacado::Rad::ADvar<U>>
177 using type = Sacado::Rad::ADvar<typename ProductType<T, U>::type>;
182 template <
typename T>
183 struct ProductTypeImpl<Sacado::Rad::ADvari<T>, float>
185 using type = Sacado::Rad::ADvari<T>;
188 template <
typename T>
189 struct ProductTypeImpl<float, Sacado::Rad::ADvari<T>>
191 using type = Sacado::Rad::ADvari<T>;
194 template <
typename T>
195 struct ProductTypeImpl<Sacado::Rad::ADvari<T>, double>
197 using type = Sacado::Rad::ADvari<T>;
200 template <
typename T>
201 struct ProductTypeImpl<double, Sacado::Rad::ADvari<T>>
203 using type = Sacado::Rad::ADvari<T>;
206 template <
typename T>
207 struct ProductTypeImpl<Sacado::Rad::ADvari<T>, int>
209 using type = Sacado::Rad::ADvari<T>;
212 template <
typename T>
213 struct ProductTypeImpl<int, Sacado::Rad::ADvari<T>>
215 using type = Sacado::Rad::ADvari<T>;
218 template <
typename T,
typename U>
219 struct ProductTypeImpl<Sacado::Rad::ADvari<T>, Sacado::Rad::ADvari<U>>
221 using type = Sacado::Rad::ADvari<typename ProductType<T, U>::type>;
226 template <
typename T,
typename U>
227 struct ProductTypeImpl<Sacado::Rad::ADvar<T>, Sacado::Rad::ADvari<U>>
229 using type = Sacado::Rad::ADvar<typename ProductType<T, U>::type>;
232 template <
typename T,
typename U>
233 struct ProductTypeImpl<Sacado::Rad::ADvari<T>, Sacado::Rad::ADvar<U>>
235 using type = Sacado::Rad::ADvar<typename ProductType<T, U>::type>;
241 template <
typename T>
244 using type = Sacado::Rad::ADvar<T>;
248 template <
typename T>
251 using type = Sacado::Rad::ADvari<T>;
255 DEAL_II_NAMESPACE_CLOSE
257 #endif // DEAL_II_TRILINOS_WITH_SACADO