16 #ifndef dealii__sacado_product_type_h 17 #define dealii__sacado_product_type_h 19 #include <deal.II/base/config.h> 20 #include <deal.II/base/tensor.h> 21 #include <deal.II/base/symmetric_tensor.h> 22 #include <deal.II/base/template_constraints.h> 24 #ifdef DEAL_II_WITH_TRILINOS 27 DEAL_II_NAMESPACE_OPEN
32 typedef Sacado::Fad::DFad<T> type;
38 typedef Sacado::Fad::DFad<T> type;
44 typedef Sacado::Fad::DFad<T> type;
50 typedef Sacado::Fad::DFad<T> type;
56 typedef Sacado::Fad::DFad<T> type;
62 typedef Sacado::Fad::DFad<T> type;
65 template <
typename T,
typename U>
66 struct ProductType<Sacado::Fad::DFad<T>, Sacado::Fad::DFad<U> >
68 typedef Sacado::Fad::DFad<typename ProductType<T,U>::type > type;
74 typedef Sacado::Fad::DFad<T> type;
88 template <
int dim,
typename Number,
typename T>
94 Sacado::Fad::DFad<T> s = 0;
95 for (
unsigned int i=0; i<dim; ++i)
96 for (
unsigned int j=0; j<dim; ++j)
97 s += t1[i][j] * t2[i][j];
111 template <
int dim,
typename Number,
typename T >
117 return scalar_product(t2, t1);
130 template <
int dim,
typename Number,
typename T>
134 const Tensor<2,dim,Sacado::Fad::DFad<T> > &t2)
136 Sacado::Fad::DFad<T> s = 0;
137 for (
unsigned int i=0; i<dim; ++i)
138 for (
unsigned int j=0; j<dim; ++j)
139 s += t1[i][j] * t2[i][j];
153 template <
int dim,
typename Number,
typename T >
159 return scalar_product(t2, t1);
162 DEAL_II_NAMESPACE_CLOSE
164 #endif // DEAL_II_WITH_TRILINOS
Sacado::Fad::DFad< T > scalar_product(const Tensor< 2, dim, Sacado::Fad::DFad< T > > &t1, const SymmetricTensor< 2, dim, Number > &t2)
Sacado::Fad::DFad< T > scalar_product(const SymmetricTensor< 2, dim, Sacado::Fad::DFad< T > > &t1, const Tensor< 2, dim, Number > &t2)
Sacado::Fad::DFad< T > scalar_product(const Tensor< 2, dim, Number > &t1, const SymmetricTensor< 2, dim, Sacado::Fad::DFad< T > > &t2)
Sacado::Fad::DFad< T > scalar_product(const SymmetricTensor< 2, dim, Number > &t1, const Tensor< 2, dim, Sacado::Fad::DFad< T > > &t2)