20 #ifndef LIBMESH_TENSOR_TOOLS_H 21 #define LIBMESH_TENSOR_TOOLS_H 24 #include "libmesh/libmesh_common.h" 25 #include "libmesh/compare_types.h" 27 #ifdef LIBMESH_HAVE_METAPHYSICL 28 #include "metaphysicl/dualnumber_decl.h" 47 template <
typename T,
typename T2>
54 template <
typename T,
typename T2>
60 template <
typename T,
typename T2>
66 template <
unsigned int N,
typename T,
typename T2>
111 template <
typename T>
114 {
return a.norm_sq();}
116 template <
typename T>
119 {
return a.norm_sq();}
121 template <
typename T>
124 {
return a.norm_sq();}
126 template <
typename T>
129 {
return a.norm_sq();}
134 bool is_zero(
const T & a){
return a.is_zero();}
142 template <
typename T>
148 template <
typename T>
155 template <
typename T>
161 template <
typename T>
168 template <
typename T>
174 template <
unsigned int N,
typename T>
182 template <
typename T>
191 template <
typename T>
197 template <
typename T>
203 template <
typename T>
209 template <
typename T>
215 template <
unsigned int N,
typename T>
222 template <
typename T>
225 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 232 template <
typename T>
242 template <
typename T>
248 template <
typename T>
254 template <
typename T>
260 template <
typename T>
266 template <
unsigned int N,
typename T>
269 #ifdef LIBMESH_USE_COMPLEX_NUMBERS 278 template <
typename T>
284 template <
typename T>
290 template <
typename T>
296 template <
typename T>
302 template <
typename T>
308 template <
typename T>
314 template <
unsigned int N,
typename T>
344 template <
typename T>
347 static constexpr
bool value =
false;
350 template <
typename T>
356 template <
typename T>
362 template <
typename T>
368 template <
typename T>
374 template <
unsigned int N,
typename T>
382 template <
typename T>
387 template <
template <
typename>
class Wrapper,
typename T>
390 typename
std::enable_if<MathWrapperTraits<Wrapper<T>>::value>
::type> {
394 template <
typename T,
typename Enable =
void>
397 static_assert(always_false<T>,
398 "Instantiating the generic template of TensorTraits. You must specialize " 399 "TensorTraits for your type.");
400 static constexpr
unsigned char rank = 0;
403 template <
typename T>
406 static constexpr
unsigned char rank = 0;
409 template <
typename T>
412 static constexpr
unsigned char rank = 1;
415 template <
typename T>
418 static constexpr
unsigned char rank = 1;
421 template <
typename T>
424 static constexpr
unsigned char rank = 2;
427 template <
typename T>
430 static constexpr
unsigned char rank = 2;
433 template <
typename T,
unsigned int N>
436 static constexpr
unsigned char rank =
static_cast<unsigned char>(N);
443 #endif // LIBMESH_TENSOR_TOOLS_H
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
The libMesh namespace provides an interface to certain functionality in the library.
This class defines a tensor in LIBMESH_DIM dimensional space of type T.
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
This class defines a vector in LIBMESH_DIM dimensional space of type T.
CompareTypes< T, T2 >::supertype contract(const TypeTensor< T2 > &) const
Multiply 2 tensors together to return a scalar, i.e.
This class will eventually define a rank-N tensor in LIBMESH_DIM dimensional space of type T...
ADRealEigenVector< T, D, asd > norm(const ADRealEigenVector< T, D, asd > &)
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
CompareTypes< T, T2 >::supertype contract(const TypeNTensor< N, T2 > &) const
Multiply 2 tensors together to return a scalar, i.e.