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

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

#include <tensor.hpp>

Collaboration diagram for constitutive::Tensor2< T >:

Public Member Functions

 Tensor2 (const Eigen::Matrix< T, 3, 3 > &data)
 Constructor for the tensor.
Eigen::Matrix< T, 6, 1 > toVector () const
 Convert the tensor to a vector.
void clearCaches () const
 Clear caches.
const Eigen::Matrix< T, 3, 3 > & mean () const
 Calculate the mean tensor.
const Eigen::Matrix< T, 3, 3 > & deviatoric () const
 Calculate the deviatoric tensor.
T I1 () const
 Calculate the first invariant of the tensor.
T I2 () const
 Calculate the second invariant of the tensor.
T I3 () const
 Calculate the third invariant of the tensor.
T J2 () const
 Calculate the second deviatoric invariant of the tensor.
T J3 () const
 Calculate the third deviatoric invariant of the tensor.
T p () const
 Calculate the mean value of the tensor.
T q () const
 Calculate the deviatoric value of the tensor.
T eta () const
 Calculate the eta value of the tensor.
const Eigen::Matrix< T, 3, 1 > & principals () const
 Calculate the principal values of the tensor.
T p1 () const
 Calculate the maximum principal value of the tensor.
T p2 () const
 Calculate the median principal value of the tensor.
T p3 () const
 Calculate the minimum principal value of the tensor.
T b () const
 Calculate the b-value of the tensor.
T R () const
 Calculate the R-value of the tensor.
T cos3theta () const
 Calculate the cosine of 3 times of the Lode angle of the tensor.
T theta () const
 Calculate the Lode angle (0, pi/3) of the tensor.
T lode () const
 Calculate the Lode angle (-pi/6, pi/6) of the tensor.
T norm () const
 Calculate the norm of the tensor.
const 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 constitutive::Tensor2< T >

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

Constructor & Destructor Documentation

◆ Tensor2()

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

Constructor for the tensor.

Warning
Please ensure that the input matrix is symmetric, as the tensor is expected to be symmetric.
Parameters
dataMatrix representation of the tensor.

References matrix.

Referenced by constitutive::FabricTensor< T >::evolve(), fromVector(), constitutive::operator*(), constitutive::operator*(), operator*(), operator*(), operator*(), constitutive::operator+(), constitutive::operator+(), operator+(), operator+(), operator+(), constitutive::operator-(), constitutive::operator-(), operator-(), operator-(), operator-(), and operator/().

Here is the caller graph for this function:

Member Function Documentation

◆ b()

template<typename T>
T constitutive::Tensor2< T >::b ( ) const
inline

Calculate the b-value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), p1(), p2(), p3(), principals(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ clearCaches()

template<typename T>
void constitutive::Tensor2< T >::clearCaches ( ) const
inline

Clear caches.

References constitutive::CachedVariable< T >::cached.

◆ cos3theta()

template<typename T>
T constitutive::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 constitutive::CachedVariable< T >::cached, cos3theta(), constitutive::CachedScalar< T >::initialize(), J2(), J3(), and constitutive::CachedVariable< T >::value().

Referenced by cos3theta(), and theta().

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

◆ deviatoric()

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

Calculate the deviatoric tensor.

Returns
Deviatoric tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedMatrix33< T >::initialize(), mean(), and constitutive::CachedVariable< T >::value().

Referenced by J2(), and J3().

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

◆ eta()

template<typename T>
T constitutive::Tensor2< T >::eta ( ) const
inline

Calculate the eta value of the tensor.

Returns
eta value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), p(), q(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ fromVector()

template<typename T>
Tensor2 constitutive::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 constitutive::StateVariable< T >::strain(), and constitutive::StateVariable< T >::strainp().

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

◆ I1()

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

Calculate the first invariant of the tensor.

Returns
First invariant of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by p().

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

◆ I2()

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

Calculate the second invariant of the tensor.

Returns
Second invariant of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ I3()

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

Calculate the third invariant of the tensor.

Returns
Third invariant of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ J2()

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

Calculate the second deviatoric invariant of the tensor.

Returns
Second deviatoric invariant of the tensor.

References constitutive::CachedVariable< T >::cached, deviatoric(), constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by cos3theta(), and q().

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

◆ J3()

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

Calculate the third deviatoric invariant of the tensor.

Returns
Third deviatoric invariant of the tensor.

References constitutive::CachedVariable< T >::cached, deviatoric(), constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by cos3theta().

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

◆ lode()

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

Calculate the Lode angle (-pi/6, pi/6) of the tensor.

Returns
Lode angle of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), PI, theta(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ mean()

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

Calculate the mean tensor.

Returns
Mean tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedMatrix33< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by deviatoric().

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

◆ norm()

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

Calculate the norm of the tensor.

Returns
Norm of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ normalized()

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

Calculate the normalized tensor.

Returns
Normalized tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedMatrix33< T >::initialize(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ operator*() [1/4]

template<typename T>
Eigen::Matrix< T, 3, 1 > constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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 constitutive::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:

◆ p()

template<typename T>
T constitutive::Tensor2< T >::p ( ) const
inline

Calculate the mean value of the tensor.

Returns
Mean value of the tensor.

References constitutive::CachedVariable< T >::cached, I1(), constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by eta().

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

◆ p1()

template<typename T>
T constitutive::Tensor2< T >::p1 ( ) const
inline

Calculate the maximum principal value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), principals(), and constitutive::CachedVariable< T >::value().

Referenced by b(), and R().

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

◆ p2()

template<typename T>
T constitutive::Tensor2< T >::p2 ( ) const
inline

Calculate the median principal value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), principals(), and constitutive::CachedVariable< T >::value().

Referenced by b().

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

◆ p3()

template<typename T>
T constitutive::Tensor2< T >::p3 ( ) const
inline

Calculate the minimum principal value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), principals(), and constitutive::CachedVariable< T >::value().

Referenced by b(), and R().

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

◆ principals()

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

Calculate the principal values of the tensor.

Returns
Principal values of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedVector3< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by b(), p1(), p2(), and p3().

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

◆ q()

template<typename T>
T constitutive::Tensor2< T >::q ( ) const
inline

Calculate the deviatoric value of the tensor.

Returns
Deviatoric value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), J2(), and constitutive::CachedVariable< T >::value().

Referenced by eta().

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

◆ R()

template<typename T>
T constitutive::Tensor2< T >::R ( ) const
inline

Calculate the R-value of the tensor.

References constitutive::CachedVariable< T >::cached, constitutive::CachedScalar< T >::initialize(), p1(), p3(), and constitutive::CachedVariable< T >::value().

Here is the call graph for this function:

◆ theta()

template<typename T>
T constitutive::Tensor2< T >::theta ( ) const
inline

Calculate the Lode angle (0, pi/3) of the tensor.

Returns
Lode angle of the tensor.

References constitutive::CachedVariable< T >::cached, cos3theta(), constitutive::CachedScalar< T >::initialize(), and constitutive::CachedVariable< T >::value().

Referenced by lode().

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

◆ toVector()

template<typename T>
Eigen::Matrix< T, 6, 1 > constitutive::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: