libMesh
|
This class will eventually define a rank-N tensor in LIBMESH_DIM
dimensional space of type T.
More...
#include <tensor_tools.h>
Public Types | |
typedef tuple_of< N, unsigned int > | index_type |
Helper typedef for generic index programming. More... | |
Public Member Functions | |
TypeNTensor () | |
TypeNTensor (const T &) | |
TypeNTensor (const TypeVector< T > &) | |
TypeNTensor (const TypeTensor< T > &) | |
TypeNTensor (const TypeNTensor< N, T > &) | |
TypeNTensor & | operator= (const TypeNTensor< N, T > &) |
operator TypeVector< T > () const | |
operator VectorValue< T > () const | |
operator TypeTensor< T > () const | |
operator TensorValue< T > () const | |
~TypeNTensor ()=default | |
Destructor. More... | |
const TypeNTensor< N-1, T > | slice (const unsigned int) const |
TypeNTensor< N-1, T > | slice (const unsigned int) |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeNTensor & >::type | operator= (const Scalar &libmesh_dbg_var(p)) |
template<typename T2 > | |
TypeNTensor< N, typename CompareTypes< T, T2 >::supertype > | operator+ (const TypeNTensor< N, T2 > &) const |
Add two tensors. More... | |
template<typename T2 > | |
const TypeNTensor< N, T > & | operator+= (const TypeNTensor< N, T2 > &) |
Add to this tensor. More... | |
template<typename T2 > | |
TypeNTensor< N, typename CompareTypes< T, T2 >::supertype > | operator- (const TypeNTensor< N, T2 > &) const |
Subtract two tensors. More... | |
template<typename T2 > | |
const TypeNTensor< N, T > & | operator-= (const TypeNTensor< N, T2 > &) |
Subtract from this tensor. More... | |
TypeNTensor< N, T > | operator- () const |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeNTensor< N, typename CompareTypes< T, Scalar >::supertype > >::type | operator* (const Scalar) const |
Multiply every entry of a tensor by a number. More... | |
template<typename Scalar > | |
const TypeNTensor< N, T > & | operator*= (const Scalar) |
Multiply every entry of this tensor by a number. More... | |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeNTensor< N, typename CompareTypes< T, Scalar >::supertype > >::type | operator/ (const Scalar) const |
Divide every entry of a tensor by a number. More... | |
const TypeNTensor< N, T > & | operator/= (const T) |
Divide every entry of this tensor by a number. More... | |
template<typename T2 > | |
CompareTypes< T, T2 >::supertype | contract (const TypeNTensor< N, T2 > &) const |
Multiply 2 tensors together to return a scalar, i.e. More... | |
auto | norm () const -> decltype(std::norm(T())) |
auto | norm_sq () const -> decltype(std::norm(T())) |
void | zero () |
Set all entries of the tensor to 0. More... | |
bool | operator== (const TypeNTensor< N, T > &) const |
bool | operator< (const TypeNTensor< N, T > &) const |
bool | operator> (const TypeNTensor< N, T > &) const |
void | print (std::ostream &) const |
Do a formatted print of this tensor to a stream which defaults to libMesh::out . More... | |
template<typename T2 > | |
void | add_scaled (const TypeNTensor< N, T2 > &, const T &) |
Add a scaled type N tensor to this type N tensor without creating a temporary. More... | |
Public Attributes | |
std::vector< T > | _coords |
The coordinates of the TypeNTensor . More... | |
Static Private Member Functions | |
static constexpr int | int_pow (int b, int e) |
Friends | |
std::ostream & | operator<< (std::ostream &os, const TypeNTensor< N, T > &t) |
Does a formatted print (as above) but supports the syntax: More... | |
This class will eventually define a rank-N tensor in LIBMESH_DIM
dimensional space of type T.
Right now it defines a shim to allow for rank-independent code to compile (but not give correct results) in the case of vector-valued elements and second derivatives.
Definition at line 38 of file tensor_tools.h.
typedef tuple_of<N, unsigned int> libMesh::TypeNTensor< N, T >::index_type |
Helper typedef for generic index programming.
Definition at line 54 of file type_n_tensor.h.
|
inline |
Definition at line 56 of file type_n_tensor.h.
|
inline |
Definition at line 58 of file type_n_tensor.h.
|
inline |
Definition at line 60 of file type_n_tensor.h.
|
inline |
Definition at line 62 of file type_n_tensor.h.
|
inline |
Definition at line 64 of file type_n_tensor.h.
|
default |
Destructor.
|
inline |
Add a scaled type N tensor to this type N tensor without creating a temporary.
Definition at line 312 of file type_n_tensor.h.
|
inline |
Multiply 2 tensors together to return a scalar, i.e.
\( \sum_{ij} A_{ij} B_{ij} \) The tensors may contain different numeric types. Also known as the "double inner product" or "double dot product" of tensors.
Definition at line 211 of file type_n_tensor.h.
Referenced by libMesh::TensorTools::inner_product().
|
inlinestaticprivate |
Definition at line 302 of file type_n_tensor.h.
|
inline |
Definition at line 221 of file type_n_tensor.h.
|
inline |
Definition at line 231 of file type_n_tensor.h.
|
inline |
Definition at line 72 of file type_n_tensor.h.
|
inline |
Definition at line 71 of file type_n_tensor.h.
|
inline |
Definition at line 68 of file type_n_tensor.h.
|
inline |
Definition at line 69 of file type_n_tensor.h.
|
inline |
Multiply every entry of a tensor by a number.
Definition at line 162 of file type_n_tensor.h.
|
inline |
Multiply every entry of this tensor by a number.
Definition at line 172 of file type_n_tensor.h.
|
inline |
Add two tensors.
Definition at line 109 of file type_n_tensor.h.
|
inline |
Add to this tensor.
Definition at line 119 of file type_n_tensor.h.
|
inline |
Subtract two tensors.
Definition at line 130 of file type_n_tensor.h.
|
inline |
Definition at line 149 of file type_n_tensor.h.
|
inline |
Subtract from this tensor.
Definition at line 140 of file type_n_tensor.h.
|
inline |
Divide every entry of a tensor by a number.
Definition at line 185 of file type_n_tensor.h.
|
inline |
Divide every entry of this tensor by a number.
Definition at line 194 of file type_n_tensor.h.
|
inline |
true
if this tensor is "less" than another.Useful for sorting.
Definition at line 256 of file type_n_tensor.h.
|
inline |
Definition at line 66 of file type_n_tensor.h.
|
inline |
Definition at line 101 of file type_n_tensor.h.
References libMesh::TypeNTensor< N, T >::zero().
|
inline |
true
if two tensors are equal, false
otherwise. Definition at line 245 of file type_n_tensor.h.
|
inline |
true
if this tensor is "greater" than another. Definition at line 265 of file type_n_tensor.h.
|
inline |
Do a formatted print of this tensor to a stream which defaults to libMesh::out
.
Definition at line 275 of file type_n_tensor.h.
|
inline |
Definition at line 82 of file type_n_tensor.h.
|
inline |
Definition at line 91 of file type_n_tensor.h.
|
inline |
Set all entries of the tensor to 0.
Definition at line 240 of file type_n_tensor.h.
Referenced by libMesh::TypeNTensor< N, T >::operator=().
|
friend |
Does a formatted print (as above) but supports the syntax:
Definition at line 283 of file type_n_tensor.h.
std::vector<T> libMesh::TypeNTensor< N, T >::_coords |
The coordinates of the TypeNTensor
.
Definition at line 299 of file type_n_tensor.h.