RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material. More...
#include <RankTwoTensor.h>
Public Types | |
typedef T | value_type |
typedef std::tuple< unsigned int, unsigned int > | index_type |
Public Member Functions | |
void | assign (const TypeTensor< T2 > &) |
const T & | operator() (const unsigned int i, const unsigned int j) const |
T & | operator() (const unsigned int i, const unsigned int j) |
ConstTypeTensorColumn< T > | slice (const unsigned int i) const |
TypeTensorColumn< T > | slice (const unsigned int i) |
TypeVector< T > | row (const unsigned int r) const |
const TypeTensor< T > & | operator+= (const TypeTensor< T2 > &) |
void | add (const TypeTensor< T2 > &) |
void | add_scaled (const TypeTensor< T2 > &, const T &) |
const TypeTensor< T > & | operator-= (const TypeTensor< T2 > &) |
void | subtract (const TypeTensor< T2 > &) |
void | subtract_scaled (const TypeTensor< T2 > &, const T &) |
auto | operator* (const Scalar &scalar) const -> typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeTensor< decltype(T() *scalar)>>::type |
const TypeTensor< T > & | operator*= (const Scalar &factor) |
const TypeTensor< T > & | operator*= (const TypeTensor< T2 > &) |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeTensor< typename CompareTypes< T, Scalar >::supertype > >::type | operator/ (const Scalar &) const |
CompareTypes< T, T2 >::supertype | contract (const TypeTensor< T2 > &) const |
TypeVector< typename CompareTypes< T, T2 >::supertype > | left_multiply (const TypeVector< T2 > &p) const |
void | solve (const TypeVector< T > &b, TypeVector< T > &x) const |
auto | norm () const -> decltype(std::norm(T())) |
auto | norm_sq () const -> decltype(std::norm(T())) |
bool | is_zero () const |
T | det () const |
T | tr () const |
void | zero () |
bool | operator== (const TypeTensor< T > &rhs) const |
bool | operator< (const TypeTensor< T > &rhs) const |
bool | operator< (const TypeTensor< Real > &rhs) const |
bool | operator< (const TypeTensor< Complex > &rhs) const |
bool | operator> (const TypeTensor< T > &rhs) const |
bool | operator> (const TypeTensor< Real > &rhs) const |
bool | operator> (const TypeTensor< Complex > &rhs) const |
void | write_unformatted (std::ostream &out_stream, const bool newline=true) const |
RankTwoTensorTempl () | |
Empty constructor; fills to zero. More... | |
RankTwoTensorTempl (const InitMethod) | |
Select specific initialization pattern. More... | |
RankTwoTensorTempl (const libMesh::TypeVector< T > &row1, const libMesh::TypeVector< T > &row2, const libMesh::TypeVector< T > &row3) | |
Initialize from row vectors. More... | |
RankTwoTensorTempl (const std::vector< T > &input) | |
Constructor that proxies the fillFromInputVector() method. More... | |
RankTwoTensorTempl (const T &S11, const T &S22, const T &S33, const T &S23, const T &S13, const T &S12) | |
Initialize a symmetric second order tensor using the 6 arguments. More... | |
RankTwoTensorTempl (const T &S11, const T &S21, const T &S31, const T &S12, const T &S22, const T &S32, const T &S13, const T &S23, const T &S33) | |
Initialize a second order tensor using the 9 arguments in a column-major fashion. More... | |
RankTwoTensorTempl (const RankTwoTensorTempl< T > &a)=default | |
The copy constructor. More... | |
RankTwoTensorTempl (const libMesh::TensorValue< T > &a) | |
The conversion operator from a libMesh::TensorValue More... | |
RankTwoTensorTempl (const libMesh::TypeTensor< T > &a) | |
The conversion operator from a libMesh::TypeTensor More... | |
template<typename T2 > | |
RankTwoTensorTempl (const SymmetricRankTwoTensorTempl< T2 > &a) | |
The conversion operator from a SymmetricRankTwoTensorTempl More... | |
template<typename T2 > | |
RankTwoTensorTempl (const RankTwoTensorTempl< T2 > &a) | |
The conversion operator from RankTwoTensorTempl<T2> to RankTwoTensorTempl<T> where T2 is convertible to T . More... | |
libMesh::VectorValue< T > | column (const unsigned int i) const |
Get the i-th column of the second order tensor. More... | |
RankTwoTensorTempl< T > & | operator= (const RankTwoTensorTempl< T > &a)=default |
Assignment operator. More... | |
RankTwoTensorTempl< T > & | operator= (const ColumnMajorMatrixTempl< T > &a) |
Assignment operator (from a ColumnMajorMatrixTempl<T>) More... | |
template<typename Scalar > | |
libMesh::boostcopy::enable_if_c< libMesh::ScalarTraits< Scalar >::value, RankTwoTensorTempl & >::type | operator= (const Scalar &libmesh_dbg_var(p)) |
Assignment-from-scalar operator. More... | |
RankTwoTensorTempl< T > & | operator+= (const RankTwoTensorTempl< T > &a) |
Add another second order tensor to this one. More... | |
RankTwoTensorTempl< T > & | operator-= (const RankTwoTensorTempl< T > &a) |
Subtract another second order tensor from this one. More... | |
RankTwoTensorTempl< T > & | operator*= (const T &a) |
Multiply this tensor by a scalar (component-wise) More... | |
RankTwoTensorTempl< T > & | operator/= (const T &a) |
Divide this tensor by a scalar (component-wise) More... | |
RankTwoTensorTempl< T > & | operator*= (const libMesh::TypeTensor< T > &a) |
Multiplication with another second order tensor. More... | |
void | fillFromInputVector (const std::vector< T > &input, FillMethod fill_method=autodetect) |
The smart mutator that determines how to fill the second order tensor based on the size of the input vector. More... | |
void | fillFromScalarVariable (const VariableValue &scalar_variable) |
The smart mutator that determines how to fill the second order tensor based on the order of the scalar_variable. More... | |
void | surfaceFillFromInputVector (const std::vector< T > &input) |
sets _coords[0][0], _coords[0][1], _coords[1][0], _coords[1][1] to input, and the remainder to zero More... | |
void | vectorOuterProduct (const libMesh::TypeVector< T > &, const libMesh::TypeVector< T > &) |
Set the values of the second order tensor to be the outer product of two vectors, i.e. More... | |
void | fillRow (unsigned int r, const libMesh::TypeVector< T > &v) |
Assign values to a specific row of the second order tensor. More... | |
void | fillColumn (unsigned int c, const libMesh::TypeVector< T > &v) |
Assign values to a specific column of the second order tensor. More... | |
void | setToIdentity () |
Set the tensor to identity. More... | |
void | addIa (const T &a) |
Add identity times a to _coords. More... | |
void | rotate (const RankTwoTensorTempl< T > &R) |
Rotate the tensor in-place given a rotation tensor \( A_{ij} \leftarrow R_{ij} A_{jk} R_{jk} \). More... | |
RankTwoTensorTempl< T > | square () const |
Return \( A_{ij} = A_{ik}A_{kj} \). More... | |
RankTwoTensorTempl< T > | rotated (const RankTwoTensorTempl< T > &R) const |
Return the rotated tensor given a rotation tensor \( A'_{ij} = R_{ij} A_{jk} R_{jk} \). More... | |
RankTwoTensorTempl< T > | rotateXyPlane (T a) |
Rotate the tensor about the z-axis. More... | |
RankTwoTensorTempl< T > | transpose () const |
Return the tensor transposed. More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > | operator+ (const libMesh::TypeTensor< T2 > &a) const |
Return the sum of two second order tensors. More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > | operator- (const libMesh::TypeTensor< T2 > &a) const |
Return the subtraction of two second order tensors. More... | |
RankTwoTensorTempl< T > | operator- () const |
Return the negation of this tensor. More... | |
template<typename T2 , typename std::enable_if< libMesh::ScalarTraits< T2 >::value, int >::type = 0> | |
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > | operator* (const T2 &a) const |
Return this tensor multiplied by a scalar (component-wise) More... | |
template<typename T2 , typename std::enable_if< libMesh::ScalarTraits< T2 >::value, int >::type = 0> | |
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > | operator/ (const T2 &a) const |
Return this tensor divided by a scalar (component-wise) More... | |
template<typename T2 > | |
libMesh::TypeVector< typename libMesh::CompareTypes< T, T2 >::supertype > | operator* (const libMesh::TypeVector< T2 > &a) const |
Return this tensor multiplied by a vector. More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > | operator* (const libMesh::TypeTensor< T2 > &a) const |
Multiplication with another second order tensor. More... | |
T | doubleContraction (const RankTwoTensorTempl< T > &a) const |
Return the double contraction with another second order tensor \( A_{ij} B_{ij} \). More... | |
template<int n, int o, int p, int q> | |
RankFourTensorTempl< T > | times (const RankTwoTensorTempl< T > &b) const |
Return the general tensor product of this second order tensor and another second order tensor defined as \( C_{ijkl} = A_{\mathcal{M}(n)\mathcal{M}(o)} B_{\mathcal{M}(p)\mathcal{M}(q)} \) where the multiplication order is defined by the index map \( \mathcal{M}: \{n,o,p,q\} \to \{i,j,k,l\} \). More... | |
template<int n, int o, int p, int q, int r, int s> | |
RankFourTensorTempl< T > | times (const RankFourTensorTempl< T > &b) const |
Return the single contraction of this second order tensor with a fourth order tensor defined as \( C_{ijkl} = A_{\mathcal{M}(m)\mathcal{M}(n)} B_{\mathcal{M}(p)\mathcal{M}(q)\mathcal{M}(r)\mathcal{M}(s)} \) where the multiplication order is defined by the index map \( \mathcal{M}: \{m,n,p,q,r,s\} \to \{i,j,k,l\} \). More... | |
RankFourTensorTempl< T > | outerProduct (const RankTwoTensorTempl< T > &b) const |
Return the outer product \( C_{ijkl} = A_{ij} B_{kl} \). More... | |
RankThreeTensorTempl< T > | contraction (const RankThreeTensorTempl< T > &b) const |
Return the single contraction of this second order tensor with a third order tensor \( C_{ikl} = A_{ij} B_{jkl} \). More... | |
RankThreeTensorTempl< T > | mixedProductJkI (const libMesh::VectorValue< T > &b) const |
Return the tensor product of this second order tensor with a vector \( C_{ijk} = A_{jk} b_{i} \). More... | |
RankFourTensorTempl< T > | positiveProjectionEigenDecomposition (std::vector< T > &, RankTwoTensorTempl< T > &) const |
Return the positive projection tensor. More... | |
RankTwoTensorTempl< T > | deviatoric () const |
Return the deviatoric part of this tensor \( A_{ij} - \frac{1}{3} A_{kk} \delta_{ij} \). More... | |
T | trace () const |
A wrapper for tr() More... | |
RankTwoTensorTempl< T > | dtrace () const |
Return the derivative of the trace w.r.t. More... | |
RankTwoTensorTempl< T > | inverse () const |
Return the inverse of this second order tensor. More... | |
T | generalSecondInvariant () const |
Return the principal second invariant of this second order tensor. More... | |
T | secondInvariant () const |
Return the main second invariant of this second order tensor. More... | |
RankTwoTensorTempl< T > | dsecondInvariant () const |
Return the derivative of the main second invariant w.r.t. More... | |
RankFourTensorTempl< T > | d2secondInvariant () const |
Return the second derivative of the main second invariant w.r.t. More... | |
T | sin3Lode (const T &r0, const T &r0_value) const |
Sin(3*Lode_angle) More... | |
RankTwoTensorTempl< T > | dsin3Lode (const T &r0) const |
d(sin3Lode)/dA_ij If secondInvariant() <= r0 then return zero This is to gaurd against precision-loss errors. More... | |
RankFourTensorTempl< T > | d2sin3Lode (const T &r0) const |
d^2(sin3Lode)/dA_ij/dA_kl If secondInvariant() <= r0 then return zero This is to gaurd against precision-loss errors. More... | |
T | thirdInvariant () const |
Denote the _coords[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns det(S + S.transpose())/2 Note the explicit symmeterisation. More... | |
RankTwoTensorTempl< T > | dthirdInvariant () const |
Denote the _coords[i][j] by A_ij, then this returns d(thirdInvariant()/dA_ij. More... | |
RankFourTensorTempl< T > | d2thirdInvariant () const |
Denote the _coords[i][j] by A_ij, then this returns d^2(thirdInvariant)/dA_ij/dA_kl. More... | |
RankTwoTensorTempl< T > | ddet () const |
Denote the _coords[i][j] by A_ij, then this returns d(det)/dA_ij. More... | |
T | L2norm () const |
Sqrt(_coords[i][j]*_coords[i][j]) More... | |
void | symmetricEigenvalues (std::vector< T > &eigvals) const |
computes eigenvalues, assuming tens is symmetric, and places them in ascending order in eigvals More... | |
void | symmetricEigenvaluesEigenvectors (std::vector< T > &eigvals, RankTwoTensorTempl< T > &eigvecs) const |
computes eigenvalues and eigenvectors, assuming tens is symmetric, and places them in ascending order in eigvals. More... | |
void | dsymmetricEigenvalues (std::vector< T > &eigvals, std::vector< RankTwoTensorTempl< T >> &deigvals) const |
computes eigenvalues, and their symmetric derivatives wrt vals, assuming tens is symmetric More... | |
void | d2symmetricEigenvalues (std::vector< RankFourTensorTempl< T >> &deriv) const |
Computes second derivatives of Eigenvalues of a rank two tensor. More... | |
void | getRUDecompositionRotation (RankTwoTensorTempl< T > &rot) const |
Uses the petscblaslapack.h LAPACKsyev_ routine to perform RU decomposition and obtain the rotation tensor. More... | |
RankTwoTensorTempl< T > | initialContraction (const RankFourTensorTempl< T > &b) const |
returns this_ij * b_ijkl More... | |
bool | operator== (const RankTwoTensorTempl< T > &a) const |
Defines logical equality with another RankTwoTensorTempl<T> More... | |
bool | isSymmetric () const |
Test for symmetry. More... | |
Static Public Member Functions | |
static TensorValue< Real > | intrinsic_rotation_matrix (Real phi, Real theta, Real psi) |
static TensorValue< Real > | inverse_intrinsic_rotation_matrix (Real phi, Real theta, Real psi) |
static TensorValue< Real > | extrinsic_rotation_matrix (Real angle1_deg, Real angle2_deg, Real angle3_deg) |
static TensorValue< Real > | inverse_extrinsic_rotation_matrix (Real angle1_deg, Real angle2_deg, Real angle3_deg) |
static RankTwoTensorTempl | initializeSymmetric (const libMesh::TypeVector< T > &v0, const libMesh::TypeVector< T > &v1, const libMesh::TypeVector< T > &v2) |
Named constructor for initializing symmetrically. More... | |
static RankTwoTensorTempl | initializeFromRows (const libMesh::TypeVector< T > &row0, const libMesh::TypeVector< T > &row1, const libMesh::TypeVector< T > &row2) |
Named constructor for initializing from row vectors. More... | |
static RankTwoTensorTempl | initializeFromColumns (const libMesh::TypeVector< T > &col0, const libMesh::TypeVector< T > &col1, const libMesh::TypeVector< T > &col2) |
Named constructor for initializing from row vectors. More... | |
static RankTwoTensorTempl | Identity () |
Initialize a second order identity tensor. More... | |
static RankTwoTensorTempl< T > | timesTranspose (const RankTwoTensorTempl< T > &) |
Initialize a second order tensor with expression \( B_{ij} = F_{ij} F_{ji} \). More... | |
static RankTwoTensorTempl< T > | transposeTimes (const RankTwoTensorTempl< T > &) |
Initialize a second order tensor with expression \( C_{ij} = F_{ji} F_{ij} \). More... | |
static RankTwoTensorTempl< T > | plusTranspose (const RankTwoTensorTempl< T > &) |
Initialize a second order tensor with expression \( E_{ij} = C_{ij} + C_{ji} \). More... | |
static RankTwoTensorTempl< T > | outerProduct (const libMesh::TypeVector< T > &, const libMesh::TypeVector< T > &) |
Initialize a second order tensor as the outer product of two vectors, i.e. More... | |
static RankTwoTensorTempl< T > | selfOuterProduct (const libMesh::TypeVector< T > &) |
Initialize a second order tensor as the outer product of a vector with itself, i.e. More... | |
static RankTwoTensorTempl< T > | genRandomTensor (T stddev, T mean) |
Generate a random second order tensor with all 9 components treated as independent random variables following a Gaussian distribution. More... | |
static RankTwoTensorTempl< T > | genRandomSymmTensor (T stddev, T mean) |
Generate a random symmetric second order tensor with the 6 upper-triangular components treated as independent random variables following a Gaussian distribution. More... | |
Protected Member Functions | |
void | syev (const char *calculation_type, std::vector< T > &eigvals, std::vector< T > &a) const |
Uses the petscblaslapack.h LAPACKsyev_ routine to find, for symmetric _coords: (1) the eigenvalues (if calculation_type == "N") (2) the eigenvalues and eigenvectors (if calculation_type == "V") More... | |
Protected Attributes | |
T | _coords [LIBMESH_DIM *LIBMESH_DIM] |
Static Private Attributes | |
static constexpr Real | identityCoords [N2] = {1, 0, 0, 0, 1, 0, 0, 0, 1} |
Friends | |
template<class T2 > | |
class | RankFourTensorTempl |
template<class T2 > | |
class | RankThreeTensorTempl |
template<class T2 > | |
void | dataStore (std::ostream &, RankTwoTensorTempl< T2 > &, void *) |
template<class T2 > | |
void | dataLoad (std::istream &, RankTwoTensorTempl< T2 > &, void *) |
enum | InitMethod { initNone, initIdentity } |
The initialization method. More... | |
enum | FillMethod { autodetect = 0, isotropic1 = 1, diagonal3 = 3, symmetric6 = 6, general = 9 } |
To fill up the 9 entries in the 2nd-order tensor, fillFromInputVector is called with one of the following fill_methods. More... | |
static constexpr unsigned int | N = Moose::dim |
Tensor dimension, i.e. More... | |
static constexpr unsigned int | N2 = N * N |
The square of the tensor dimension. More... | |
static void | initRandom (unsigned int) |
Initialize the random seed based on an unsigned integer. More... | |
static MooseEnum | fillMethodEnum () |
Get the available FillMethod options. More... | |
void | fillRealTensor (libMesh::TensorValue< T > &) |
Fill a libMesh::TensorValue<T> from this second order tensor. More... | |
void | print (std::ostream &stm=Moose::out) const |
Print the rank two tensor. More... | |
void | printReal (std::ostream &stm=Moose::out) const |
Print the Real part of the RankTwoTensorTempl<ADReal> More... | |
void | printADReal (unsigned int nDual, std::ostream &stm=Moose::out) const |
Print the Real part of the RankTwoTensorTempl<ADReal> along with its first nDual dual numbers. More... | |
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material.
It is designed to allow for maximum clarity of the mathematics and ease of use. Original class authors: A. M. Jokisaari, O. Heinonen, M. R. Tonks
RankTwoTensorTempl holds the 9 separate Sigma_ij or Epsilon_ij entries. The entries are accessed by index, with i, j equal to 1, 2, or 3, or internally i, j = 0, 1, 2.
Definition at line 79 of file RankTwoTensor.h.
enum RankTwoTensorTempl::FillMethod |
To fill up the 9 entries in the 2nd-order tensor, fillFromInputVector is called with one of the following fill_methods.
See the fill*FromInputVector functions for more details
Enumerator | |
---|---|
autodetect | |
isotropic1 | |
diagonal3 | |
symmetric6 | |
general |
Definition at line 110 of file RankTwoTensor.h.
enum RankTwoTensorTempl::InitMethod |
The initialization method.
Enumerator | |
---|---|
initNone | |
initIdentity |
Definition at line 99 of file RankTwoTensor.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | ) |
Empty constructor; fills to zero.
\( A_{ij} = 0 \)
Definition at line 72 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::Identity().
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const InitMethod | init | ) |
Select specific initialization pattern.
initNone
initializes an empty second order tensor.
initIdentity
initializes a second order identity tensor.
Definition at line 81 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const libMesh::TypeVector< T > & | row1, |
const libMesh::TypeVector< T > & | row2, | ||
const libMesh::TypeVector< T > & | row3 | ||
) |
Initialize from row vectors.
Deprecated in favor of initializeFromRows()
Definition at line 100 of file RankTwoTensorImplementation.h.
|
inline |
Constructor that proxies the fillFromInputVector() method.
Definition at line 211 of file RankTwoTensor.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const T & | S11, |
const T & | S22, | ||
const T & | S33, | ||
const T & | S23, | ||
const T & | S13, | ||
const T & | S12 | ||
) |
Initialize a symmetric second order tensor using the 6 arguments.
Definition at line 156 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const T & | S11, |
const T & | S21, | ||
const T & | S31, | ||
const T & | S12, | ||
const T & | S22, | ||
const T & | S32, | ||
const T & | S13, | ||
const T & | S23, | ||
const T & | S33 | ||
) |
Initialize a second order tensor using the 9 arguments in a column-major fashion.
Definition at line 168 of file RankTwoTensorImplementation.h.
|
default |
The copy constructor.
|
inline |
|
inline |
|
inline |
The conversion operator from a SymmetricRankTwoTensorTempl
Definition at line 273 of file RankTwoTensor.h.
|
inline |
The conversion operator from RankTwoTensorTempl<T2>
to RankTwoTensorTempl<T>
where T2
is convertible to T
.
Definition at line 288 of file RankTwoTensor.h.
void RankTwoTensorTempl< T >::addIa | ( | const T & | a | ) |
Add identity times a to _coords.
Add a scalar to diagonal components \( A_{ij} + a\delta_{ij} \)
Definition at line 735 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::deviatoric().
libMesh::VectorValue< T > RankTwoTensorTempl< T >::column | ( | const unsigned int | i | ) | const |
Get the i-th column of the second order tensor.
i | The column number, i = 0, 1, 2 |
Definition at line 274 of file RankTwoTensorImplementation.h.
Referenced by FactorizedRankTwoTensorTempl< T >::assemble(), SymmetricRankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition(), and RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
RankThreeTensorTempl< T > RankTwoTensorTempl< T >::contraction | ( | const RankThreeTensorTempl< T > & | b | ) | const |
Return the single contraction of this second order tensor with a third order tensor \( C_{ikl} = A_{ij} B_{jkl} \).
Definition at line 464 of file RankTwoTensorImplementation.h.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::d2secondInvariant | ( | ) | const |
Return the second derivative of the main second invariant w.r.t.
this second order tensor itself \( \frac{\partial^2 J_2}{\partial A_{ij}A_{kl}} = \delta_{ik}\delta_{jl} - \frac{1}{3}\delta_{ij}\delta_{kl} \)
Definition at line 538 of file RankTwoTensorImplementation.h.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::d2sin3Lode | ( | const T & | r0 | ) | const |
d^2(sin3Lode)/dA_ij/dA_kl If secondInvariant() <= r0 then return zero This is to gaurd against precision-loss errors.
Note that sin(3*Lode_angle) is not defined for secondInvariant() = 0
Definition at line 1539 of file RankTwoTensor.h.
void RankTwoTensorTempl< T >::d2symmetricEigenvalues | ( | std::vector< RankFourTensorTempl< T >> & | deriv | ) | const |
Computes second derivatives of Eigenvalues of a rank two tensor.
deriv | store second derivative of the current tensor in here |
Definition at line 853 of file RankTwoTensorImplementation.h.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::d2thirdInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d^2(thirdInvariant)/dA_ij/dA_kl.
Definition at line 604 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::ddet | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(det)/dA_ij.
Definition at line 694 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::deviatoric | ( | ) | const |
Return the deviatoric part of this tensor \( A_{ij} - \frac{1}{3} A_{kk} \delta_{ij} \).
Definition at line 493 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::doubleContraction | ( | const RankTwoTensorTempl< T > & | a | ) | const |
Return the double contraction with another second order tensor \( A_{ij} B_{ij} \).
Definition at line 456 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dsecondInvariant | ( | ) | const |
Return the derivative of the main second invariant w.r.t.
this second order tensor itself \( \frac{\partial J_2}{\partial A_{ij}} = S_{ij} = A_{ij} - \frac{1}{3}A_{kk}\delta_{ij} \)
Definition at line 531 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dsin3Lode | ( | const T & | r0 | ) | const |
d(sin3Lode)/dA_ij If secondInvariant() <= r0 then return zero This is to gaurd against precision-loss errors.
Note that sin(3*Lode_angle) is not defined for secondInvariant() = 0
Definition at line 1521 of file RankTwoTensor.h.
void RankTwoTensorTempl< T >::dsymmetricEigenvalues | ( | std::vector< T > & | eigvals, |
std::vector< RankTwoTensorTempl< T >> & | deigvals | ||
) | const |
computes eigenvalues, and their symmetric derivatives wrt vals, assuming tens is symmetric
eigvals | are the eigenvalues of the matrix, in ascending order |
deigvals | Here digvals[i](j,k) = (1/2)*(d(eigvals[i])/dA_jk + d(eigvals[i]/dA_kj)) Note the explicit symmeterisation here. For equal eigenvalues, these derivatives are not gauranteed to be the ones you expect, since the derivatives in this case are often defined by continuation from the un-equal case, and that is too sophisticated for this routine. |
Definition at line 814 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dthirdInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(thirdInvariant()/dA_ij.
Definition at line 584 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dtrace | ( | ) | const |
Return the derivative of the trace w.r.t.
this second order tensor itself \( \frac{\partial A_{kk}}{\partial A_{ij}} = \delta_{ij} \)
Definition at line 560 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::fillColumn | ( | unsigned int | c, |
const libMesh::TypeVector< T > & | v | ||
) |
Assign values to a specific column of the second order tensor.
c | The column number, c = 0, 1, 2 |
v | The values to be set |
Definition at line 977 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::fillFromInputVector | ( | const std::vector< T > & | input, |
FillMethod | fill_method = autodetect |
||
) |
The smart mutator that determines how to fill the second order tensor based on the size of the input vector.
input | The input vector, can be of size 1, 3, 6, or 9 |
fill_method | The fill method, default to autodetect. |
When input.size() == 1
, the vector value is used to fill the diagonal components of the second order tensor:
When input.size() == 3
, the vector values are used to fill the diagonal components of the second order tensor:
When input.size() == 6
, the second order tensor is filled symmetrically using the Voigt notation:
When input.size() == 9
, all components of the second order tensor are filled in a column-major fashion:
Definition at line 191 of file RankTwoTensorImplementation.h.
Referenced by GenericConstantRankTwoTensorTempl< is_ad >::GenericConstantRankTwoTensorTempl(), and RankTwoTensorTempl< Real >::RankTwoTensorTempl().
void RankTwoTensorTempl< T >::fillFromScalarVariable | ( | const VariableValue & | scalar_variable | ) |
The smart mutator that determines how to fill the second order tensor based on the order of the scalar_variable.
scalar_variable | The input scalar variable. Supported orders are FIRST, THIRD, and SIXTH. |
When scalar_variable.size() == 1
, the scalar value is used to fill the very first component of the second order tensor:
When scalar_variable.size() == 3
, the scalar values are used to fill the in-plane components of the second order tensor using the Voigt notation:
When scalar_variable.size() == 6
, the second order tensor is filled symmetrically using the Voigt notation:
Definition at line 241 of file RankTwoTensorImplementation.h.
|
static |
Get the available FillMethod
options.
This method is useful in validParams().
Definition at line 66 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::fillRealTensor | ( | libMesh::TensorValue< T > & | tensor | ) |
Fill a libMesh::TensorValue<T>
from this second order tensor.
Definition at line 960 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::fillRow | ( | unsigned int | r, |
const libMesh::TypeVector< T > & | v | ||
) |
Assign values to a specific row of the second order tensor.
r | The row number, r = 0, 1, 2 |
v | The values to be set |
Definition at line 969 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::generalSecondInvariant | ( | ) | const |
Return the principal second invariant of this second order tensor.
\( I_2 = \frac{1}{2} \left( A_{kk}^2 - A_{ij}A_{ij} \right) \)
Definition at line 503 of file RankTwoTensorImplementation.h.
|
static |
Generate a random symmetric second order tensor with the 6 upper-triangular components treated as independent random variables following a Gaussian distribution.
stddev | The standard deviation of the Gaussian distribution |
mean | The mean of the Gaussian distribution |
Definition at line 918 of file RankTwoTensorImplementation.h.
|
static |
Generate a random second order tensor with all 9 components treated as independent random variables following a Gaussian distribution.
stddev | The standard deviation of the Gaussian distribution |
mean | The mean of the Gaussian distribution |
Definition at line 907 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::getRUDecompositionRotation | ( | RankTwoTensorTempl< T > & | rot | ) | const |
Uses the petscblaslapack.h LAPACKsyev_ routine to perform RU decomposition and obtain the rotation tensor.
Definition at line 890 of file RankTwoTensorImplementation.h.
|
inlinestatic |
Initialize a second order identity tensor.
Definition at line 360 of file RankTwoTensor.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::initialContraction | ( | const RankFourTensorTempl< T > & | b | ) | const |
returns this_ij * b_ijkl
Definition at line 985 of file RankTwoTensorImplementation.h.
|
static |
Named constructor for initializing from row vectors.
Definition at line 147 of file RankTwoTensorImplementation.h.
|
static |
Named constructor for initializing from row vectors.
Definition at line 137 of file RankTwoTensorImplementation.h.
|
static |
Named constructor for initializing symmetrically.
The supplied vectors are used as row and column vectors to construct two tensors respectively, that are averaged to create a symmetric tensor.
Definition at line 120 of file RankTwoTensorImplementation.h.
|
static |
Initialize the random seed based on an unsigned integer.
Deprecated in favor of MooseRandom::seed().
Definition at line 900 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::inverse | ( | ) | const |
Return the inverse of this second order tensor.
Definition at line 567 of file RankTwoTensorImplementation.h.
bool RankTwoTensorTempl< T >::isSymmetric | ( | ) | const |
Test for symmetry.
Definition at line 433 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::L2norm | ( | ) | const |
Sqrt(_coords[i][j]*_coords[i][j])
Definition at line 743 of file RankTwoTensorImplementation.h.
RankThreeTensorTempl< T > RankTwoTensorTempl< T >::mixedProductJkI | ( | const libMesh::VectorValue< T > & | b | ) | const |
Return the tensor product of this second order tensor with a vector \( C_{ijk} = A_{jk} b_{i} \).
Definition at line 479 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const T2 & | a | ) | const |
Return this tensor multiplied by a scalar (component-wise)
Definition at line 1417 of file RankTwoTensor.h.
libMesh::TypeVector< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const libMesh::TypeVector< T2 > & | a | ) | const |
Return this tensor multiplied by a vector.
\( b_i = A_{ij} a_j \)
Definition at line 1425 of file RankTwoTensor.h.
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const libMesh::TypeTensor< T2 > & | a | ) | const |
Multiplication with another second order tensor.
Definition at line 1433 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator*= | ( | const T & | a | ) |
Multiply this tensor by a scalar (component-wise)
Definition at line 397 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator*= | ( | const libMesh::TypeTensor< T > & | a | ) |
Multiplication with another second order tensor.
Definition at line 413 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator+ | ( | const libMesh::TypeTensor< T2 > & | a | ) | const |
Return the sum of two second order tensors.
Definition at line 1401 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator+= | ( | const RankTwoTensorTempl< T > & | a | ) |
Add another second order tensor to this one.
Definition at line 374 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator- | ( | const libMesh::TypeTensor< T2 > & | a | ) | const |
Return the subtraction of two second order tensors.
Definition at line 1409 of file RankTwoTensor.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::operator- | ( | ) | const |
Return the negation of this tensor.
Definition at line 390 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator-= | ( | const RankTwoTensorTempl< T > & | a | ) |
Subtract another second order tensor from this one.
Definition at line 382 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< typename libMesh::CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator/ | ( | const T2 & | a | ) | const |
Return this tensor divided by a scalar (component-wise)
Definition at line 1441 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator/= | ( | const T & | a | ) |
Divide this tensor by a scalar (component-wise)
Definition at line 405 of file RankTwoTensorImplementation.h.
|
default |
Assignment operator.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator= | ( | const ColumnMajorMatrixTempl< T > & | a | ) |
Assignment operator (from a ColumnMajorMatrixTempl<T>)
Definition at line 441 of file RankTwoTensorImplementation.h.
|
inline |
Assignment-from-scalar operator.
Used only to zero out the tensor.
Definition at line 546 of file RankTwoTensor.h.
bool RankTwoTensorTempl< T >::operator== | ( | const RankTwoTensorTempl< T > & | a | ) | const |
Defines logical equality with another RankTwoTensorTempl<T>
Definition at line 421 of file RankTwoTensorImplementation.h.
|
static |
Initialize a second order tensor as the outer product of two vectors, i.e.
\( A_{ij} = a_i b_j \).
Definition at line 937 of file RankTwoTensorImplementation.h.
|
inline |
Return the outer product \( C_{ijkl} = A_{ij} B_{kl} \).
Definition at line 1153 of file RankTwoTensor.h.
|
static |
Initialize a second order tensor with expression \( E_{ij} = C_{ij} + C_{ji} \).
Definition at line 295 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::d2thirdInvariant(), RankTwoTensorTempl< Real >::dsecondInvariant(), RankTwoTensorTempl< Real >::dthirdInvariant(), and RankTwoTensorTempl< Real >::thirdInvariant().
RankFourTensorTempl< T > RankTwoTensorTempl< T >::positiveProjectionEigenDecomposition | ( | std::vector< T > & | eigval, |
RankTwoTensorTempl< T > & | eigvec | ||
) | const |
Return the positive projection tensor.
Consider the eigenvalue decomposition of this second order tensor \( A = V D V^T \), the part of this tensor that lies on the positive spectrum is defined as \( A_+ = V \left<D\right> V^T \) where the angled brackets are the Macaulay brackets. The positive projection tensor is the linear projection from the full spectrum to the positive spectrum, i.e. \( A_+ = P A \). The derivation of this positive projection tensor can be found in C. Miehe and M. Lambrecht, Commun. Numer. Meth. Engng 2001; 17:337~353
eigvals | The three eigenvalues of this second order tensor will be filled into this vector. |
eigvecs | The three eigenvectors of this second order tensor will be filled into this tensor. |
Definition at line 1448 of file RankTwoTensor.h.
void RankTwoTensorTempl< T >::print | ( | std::ostream & | stm = Moose::out | ) | const |
Print the rank two tensor.
Definition at line 713 of file RankTwoTensorImplementation.h.
void ADRankTwoTensor::printADReal | ( | unsigned int | nDual, |
std::ostream & | stm = Moose::out |
||
) | const |
Print the Real part of the RankTwoTensorTempl<ADReal> along with its first nDual dual numbers.
Definition at line 34 of file RankTwoTensorImplementation.C.
void ADRankTwoTensor::printReal | ( | std::ostream & | stm = Moose::out | ) | const |
Print the Real part of the RankTwoTensorTempl<ADReal>
Definition at line 21 of file RankTwoTensorImplementation.C.
void RankTwoTensorTempl< T >::rotate | ( | const RankTwoTensorTempl< T > & | R | ) |
Rotate the tensor in-place given a rotation tensor \( A_{ij} \leftarrow R_{ij} A_{jk} R_{jk} \).
R | The rotation tensor |
Definition at line 318 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::rotated().
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::rotated | ( | const RankTwoTensorTempl< T > & | R | ) | const |
Return the rotated tensor given a rotation tensor \( A'_{ij} = R_{ij} A_{jk} R_{jk} \).
R | The rotation tensor |
Definition at line 309 of file RankTwoTensorImplementation.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::rotateXyPlane | ( | T | a | ) |
Rotate the tensor about the z-axis.
a | The rotation angle in radians |
Definition at line 348 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::secondInvariant | ( | ) | const |
Return the main second invariant of this second order tensor.
\( J_2 = \frac{1}{2} \left( S_{ij}S_{ij} \right) \), where \( S_{ij} = A_{ij} - \frac{1}{3}A_{kk}\delta_{ij} \)
Definition at line 512 of file RankTwoTensorImplementation.h.
|
static |
Initialize a second order tensor as the outer product of a vector with itself, i.e.
\( A_{ij} = a_i a_j \).
Definition at line 949 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
void RankTwoTensorTempl< T >::setToIdentity | ( | ) |
Set the tensor to identity.
Definition at line 998 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::sin3Lode | ( | const T & | r0, |
const T & | r0_value | ||
) | const |
Sin(3*Lode_angle)
If secondInvariant() <= r0 then return r0_value This is to gaurd against precision-loss errors. Note that sin(3*Lode_angle) is not defined for secondInvariant() = 0
Definition at line 1502 of file RankTwoTensor.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::square | ( | ) | const |
Return \( A_{ij} = A_{ik}A_{kj} \).
Definition at line 302 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::surfaceFillFromInputVector | ( | const std::vector< T > & | input | ) |
sets _coords[0][0], _coords[0][1], _coords[1][0], _coords[1][1] to input, and the remainder to zero
Definition at line 756 of file RankTwoTensorImplementation.h.
|
protected |
Uses the petscblaslapack.h LAPACKsyev_ routine to find, for symmetric _coords: (1) the eigenvalues (if calculation_type == "N") (2) the eigenvalues and eigenvectors (if calculation_type == "V")
calculation_type | If "N" then calculation eigenvalues only |
eigvals | Eigenvalues are placed in this array, in ascending order |
a | Eigenvectors are placed in this array if calculation_type == "V". See code in dsymmetricEigenvalues for extracting eigenvectors from the a output. |
Definition at line 774 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::symmetricEigenvalues | ( | std::vector< T > & | eigvals | ) | const |
computes eigenvalues, assuming tens is symmetric, and places them in ascending order in eigvals
Definition at line 786 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::symmetricEigenvaluesEigenvectors | ( | std::vector< T > & | eigvals, |
RankTwoTensorTempl< T > & | eigvecs | ||
) | const |
computes eigenvalues and eigenvectors, assuming tens is symmetric, and places them in ascending order in eigvals.
eigvecs is a matrix with the first column being the first eigenvector, the second column being the second, etc.
Definition at line 797 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::thirdInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns det(S + S.transpose())/2 Note the explicit symmeterisation.
Definition at line 574 of file RankTwoTensorImplementation.h.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::times | ( | const RankTwoTensorTempl< T > & | b | ) | const |
Return the general tensor product of this second order tensor and another second order tensor defined as \( C_{ijkl} = A_{\mathcal{M}(n)\mathcal{M}(o)} B_{\mathcal{M}(p)\mathcal{M}(q)} \) where the multiplication order is defined by the index map \( \mathcal{M}: \{n,o,p,q\} \to \{i,j,k,l\} \).
The index map is specified using the template parameters. See examples below for detailed explanation.
Suppose we have two second order tensors A and B, and we denote the output indices as i, j, k, l:
The outer product of A and B is defined as \( A_{ij} B_{kl} \), hence the template specialization should be times<i, j, k, l>
The tensor product of A and B, i.e. \( A_{ik} B_{jl} \) can be expressed using the template specialization times<i, k, j, l>
Similarly, another tensor product of A and B, i.e. \( A_{il} B_{jk} \) can be expressed using the template specialization times<i, l, j, k>
The combination goes on...
Definition at line 1571 of file RankTwoTensor.h.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::times | ( | const RankFourTensorTempl< T > & | b | ) | const |
Return the single contraction of this second order tensor with a fourth order tensor defined as \( C_{ijkl} = A_{\mathcal{M}(m)\mathcal{M}(n)} B_{\mathcal{M}(p)\mathcal{M}(q)\mathcal{M}(r)\mathcal{M}(s)} \) where the multiplication order is defined by the index map \( \mathcal{M}: \{m,n,p,q,r,s\} \to \{i,j,k,l\} \).
The index map is specified using the template parameters. See examples below for detailed explanation.
Suppose we have a second order tensors A and a fourth order tensor B, and we denote the indices (four output indices and a dummy index to be contracted) as i, j, k, l, m:
The single contraction of A and B defined as \( A_{im} B_{mjkl} \) can be expressed using the template specialization times<i, m, m, j, k, l>
Similarly, another single contraction of A and B, i.e. \( A_{m, i} A_{j, k, m, l} \) can be expressed using the template specialization times<m, i, j, k, m, l>
The combination goes on. Note that this method assumes exactly one repeated index.
Definition at line 1587 of file RankTwoTensor.h.
|
static |
Initialize a second order tensor with expression \( B_{ij} = F_{ij} F_{ji} \).
Definition at line 281 of file RankTwoTensorImplementation.h.
T RankTwoTensorTempl< T >::trace | ( | ) | const |
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::transpose | ( | ) | const |
Return the tensor transposed.
Definition at line 367 of file RankTwoTensorImplementation.h.
Referenced by RankTwoTensorTempl< Real >::plusTranspose(), RankTwoTensorTempl< Real >::timesTranspose(), and RankTwoTensorTempl< Real >::transposeTimes().
|
static |
Initialize a second order tensor with expression \( C_{ij} = F_{ji} F_{ij} \).
Definition at line 288 of file RankTwoTensorImplementation.h.
void RankTwoTensorTempl< T >::vectorOuterProduct | ( | const libMesh::TypeVector< T > & | v1, |
const libMesh::TypeVector< T > & | v2 | ||
) |
Set the values of the second order tensor to be the outer product of two vectors, i.e.
\( A_{ij} = a_i b_j \).
Deprecated in favor of outerProduct()
Definition at line 926 of file RankTwoTensorImplementation.h.
|
friend |
|
friend |
Definition at line 1374 of file RankTwoTensor.h.
Definition at line 1376 of file RankTwoTensor.h.
|
staticprivate |
Definition at line 1364 of file RankTwoTensor.h.
|
static |
Tensor dimension, i.e.
number of rows/columns of the second order tensor
Definition at line 87 of file RankTwoTensor.h.
Referenced by RankTwoTensorTempl< Real >::printADReal(), and RankTwoTensorTempl< Real >::printReal().
|
static |
The square of the tensor dimension.
Definition at line 92 of file RankTwoTensor.h.