micromechanical (C++)
Loading...
Searching...
No Matches
micromechanical::core::Tensor2< T > Struct Template Reference

Class for the 2nd-order tensor (3, 3) representation. More...

#include <tensor.hpp>

Collaboration diagram for micromechanical::core::Tensor2< T >:

Public Member Functions

 Tensor2 (const Eigen::Matrix< T, 3, 3 > &data)
 Constructor for the tensor.
 
virtual ~Tensor2 ()=default
 destructor
 
Eigen::Matrix< T, 6, 1 > toVector () const
 Convert the tensor to a vector.
 
Eigen::Matrix< T, 3, 3 > mean () const
 Calculate the mean tensor.
 
Eigen::Matrix< T, 3, 3 > deviatoric () const
 Calculate the deviatoric tensor.
 
I1 () const
 Calculate the first invariant of the tensor.
 
I2 () const
 Calculate the second invariant of the tensor.
 
I3 () const
 Calculate the third invariant of the tensor.
 
J2 () const
 Calculate the second deviatoric invariant of the tensor.
 
J3 () const
 Calculate the third deviatoric invariant of the tensor.
 
Eigen::Matrix< T, 3, 1 > principals () const
 Calculate the principal values of the tensor.
 
cos3theta () const
 Calculate the cosine of 3 times of the Lode angle of the tensor.
 
lode () const
 Calculate the Lode angle of the tensor.
 
norm () const
 Calculate the norm of the tensor.
 
Eigen::Matrix< T, 3, 3 > normalized () const
 Calculate the normalized tensor.
 
Tensor2 operator+ (const Tensor2 &other) const
 Add two tensors.
 
Tensor2 operator+ (const Eigen::Matrix< T, 3, 3 > &other) const
 Add a matrix to the tensor.
 
Tensor2 operator+ (const T &other) const
 Add a scalar to the tensor.
 
Tensor2 operator- (const Tensor2 &other) const
 Subtract two tensors.
 
Tensor2 operator- (const Eigen::Matrix< T, 3, 3 > &other) const
 Subtract a matrix from the tensor.
 
Tensor2 operator- (const T &other) const
 Subtract a scalar from the tensor.
 
Tensor2 operator* (const Tensor2 &other) const
 Multiply the tensor by a tensor.
 
Tensor2 operator* (const Eigen::Matrix< T, 3, 3 > &other) const
 Multiply the tensor by a matrix.
 
Eigen::Matrix< T, 3, 1 > operator* (const Eigen::Matrix< T, 3, 1 > &other) const
 Multiply the tensor by a vector.
 
Tensor2 operator* (const T &other) const
 Multiply the tensor by a scalar.
 
Tensor2 operator/ (const T &other) const
 Divide the tensor by a scalar.
 

Static Public Member Functions

static Tensor2 fromVector (const Eigen::Matrix< T, 6, 1 > &vec)
 Static method to create a tensor from a vector.
 

Public Attributes

Eigen::Matrix< T, 3, 3 > matrix
 Matrix representation of the tensor.
 

Detailed Description

template<typename T>
struct micromechanical::core::Tensor2< T >

Class for the 2nd-order tensor (3, 3) representation.

Constructor & Destructor Documentation

◆ Tensor2()

template<typename T>
micromechanical::core::Tensor2< T >::Tensor2 ( const Eigen::Matrix< T, 3, 3 > & data)
inlineexplicit

Constructor for the tensor.

Parameters
dataMatrix representation of the tensor.

References matrix.

Referenced by fromVector(), operator*(), operator*(), operator*(), operator+(), operator+(), operator+(), operator-(), operator-(), operator-(), and operator/().

Here is the caller graph for this function:

◆ ~Tensor2()

template<typename T>
virtual micromechanical::core::Tensor2< T >::~Tensor2 ( )
virtualdefault

destructor

Member Function Documentation

◆ cos3theta()

template<typename T>
T micromechanical::core::Tensor2< T >::cos3theta ( ) const
inline

Calculate the cosine of 3 times of the Lode angle of the tensor.

Returns
Cosine of 3 times of the Lode angle of the tensor.

References cos3theta(), J2(), and J3().

Referenced by cos3theta(), micromechanical::core::FabricTensor< T >::evolve(), and lode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deviatoric()

template<typename T>
Eigen::Matrix< T, 3, 3 > micromechanical::core::Tensor2< T >::deviatoric ( ) const
inline

Calculate the deviatoric tensor.

Returns
Deviatoric tensor.

References mean().

Referenced by J2(), and J3().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromVector()

template<typename T>
static Tensor2 micromechanical::core::Tensor2< T >::fromVector ( const Eigen::Matrix< T, 6, 1 > & vec)
inlinestatic

Static method to create a tensor from a vector.

Parameters
vecVector representation of the tensor.
Returns
Tensor representation of the vector.

References matrix, and Tensor2().

Referenced by micromechanical::core::StateVariable< T >::plasticDisplacementStrainTensor(), micromechanical::core::StateVariable< T >::plasticStrainTensor(), micromechanical::core::StateVariable< T >::strainTensor(), and micromechanical::core::StateVariable< T >::stressTensor().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ I1()

template<typename T>
T micromechanical::core::Tensor2< T >::I1 ( ) const
inline

Calculate the first invariant of the tensor.

Returns
First invariant of the tensor.

◆ I2()

template<typename T>
T micromechanical::core::Tensor2< T >::I2 ( ) const
inline

Calculate the second invariant of the tensor.

Returns
Second invariant of the tensor.

◆ I3()

template<typename T>
T micromechanical::core::Tensor2< T >::I3 ( ) const
inline

Calculate the third invariant of the tensor.

Returns
Third invariant of the tensor.

◆ J2()

template<typename T>
T micromechanical::core::Tensor2< T >::J2 ( ) const
inline

Calculate the second deviatoric invariant of the tensor.

Returns
Second deviatoric invariant of the tensor.

References deviatoric().

Referenced by cos3theta().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ J3()

template<typename T>
T micromechanical::core::Tensor2< T >::J3 ( ) const
inline

Calculate the third deviatoric invariant of the tensor.

Returns
Third deviatoric invariant of the tensor.

References deviatoric().

Referenced by cos3theta().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lode()

template<typename T>
T micromechanical::core::Tensor2< T >::lode ( ) const
inline

Calculate the Lode angle of the tensor.

Returns
Lode angle of the tensor.

References cos3theta().

Here is the call graph for this function:

◆ mean()

template<typename T>
Eigen::Matrix< T, 3, 3 > micromechanical::core::Tensor2< T >::mean ( ) const
inline

Calculate the mean tensor.

Returns
Mean tensor.

Referenced by deviatoric().

Here is the caller graph for this function:

◆ norm()

template<typename T>
T micromechanical::core::Tensor2< T >::norm ( ) const
inline

Calculate the norm of the tensor.

Returns
Norm of the tensor.

◆ normalized()

template<typename T>
Eigen::Matrix< T, 3, 3 > micromechanical::core::Tensor2< T >::normalized ( ) const
inline

Calculate the normalized tensor.

Returns
Normalized tensor.

◆ operator*() [1/4]

template<typename T>
Eigen::Matrix< T, 3, 1 > micromechanical::core::Tensor2< T >::operator* ( const Eigen::Matrix< T, 3, 1 > & other) const
inline

Multiply the tensor by a vector.

Parameters
otherVector to be multiplied.
Returns
Product of the tensor and the vector.

◆ operator*() [2/4]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator* ( const Eigen::Matrix< T, 3, 3 > & other) const
inline

Multiply the tensor by a matrix.

Parameters
otherMatrix to be multiplied.
Returns
Product of the tensor and the matrix.

References Tensor2().

Here is the call graph for this function:

◆ operator*() [3/4]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator* ( const T & other) const
inline

Multiply the tensor by a scalar.

Parameters
otherScalar to be multiplied.
Returns
Product of the tensor and the scalar.

References Tensor2().

Here is the call graph for this function:

◆ operator*() [4/4]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator* ( const Tensor2< T > & other) const
inline

Multiply the tensor by a tensor.

Parameters
otherScalar to be multiplied.
Returns
Product of the tensor and the scalar.

References matrix, and Tensor2().

Here is the call graph for this function:

◆ operator+() [1/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator+ ( const Eigen::Matrix< T, 3, 3 > & other) const
inline

Add a matrix to the tensor.

Parameters
otherMatrix to be added.
Returns
Sum of the tensor and the matrix.

References Tensor2().

Here is the call graph for this function:

◆ operator+() [2/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator+ ( const T & other) const
inline

Add a scalar to the tensor.

Parameters
otherScalar to be added.
Returns
Sum of the tensor and the scalar.

References Tensor2().

Here is the call graph for this function:

◆ operator+() [3/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator+ ( const Tensor2< T > & other) const
inline

Add two tensors.

Parameters
otherTensor to be added.
Returns
Sum of the two tensors.

References matrix, and Tensor2().

Here is the call graph for this function:

◆ operator-() [1/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator- ( const Eigen::Matrix< T, 3, 3 > & other) const
inline

Subtract a matrix from the tensor.

Parameters
otherMatrix to be subtracted.
Returns
Difference of the tensor and the matrix.

References Tensor2().

Here is the call graph for this function:

◆ operator-() [2/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator- ( const T & other) const
inline

Subtract a scalar from the tensor.

Parameters
otherScalar to be subtracted.
Returns
Difference of the tensor and the scalar.

References Tensor2().

Here is the call graph for this function:

◆ operator-() [3/3]

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator- ( const Tensor2< T > & other) const
inline

Subtract two tensors.

Parameters
otherTensor to be subtracted.
Returns
Difference of the two tensors.

References matrix, and Tensor2().

Here is the call graph for this function:

◆ operator/()

template<typename T>
Tensor2 micromechanical::core::Tensor2< T >::operator/ ( const T & other) const
inline

Divide the tensor by a scalar.

Parameters
otherScalar to be divided.
Returns
Quotient of the tensor and the scalar.

References Tensor2().

Here is the call graph for this function:

◆ principals()

template<typename T>
Eigen::Matrix< T, 3, 1 > micromechanical::core::Tensor2< T >::principals ( ) const
inline

Calculate the principal values of the tensor.

Returns
Principal values of the tensor.

◆ toVector()

template<typename T>
Eigen::Matrix< T, 6, 1 > micromechanical::core::Tensor2< T >::toVector ( ) const
inline

Convert the tensor to a vector.

Returns
Vector representation of the tensor.

References matrix.

Member Data Documentation

◆ matrix


The documentation for this struct was generated from the following file: