RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material. More...
#include <MooseTypes.h>
Public Types | |
enum | InitMethod { initNone, initIdentity } |
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... | |
Public Member Functions | |
RankTwoTensorTempl () | |
Default constructor; fills to zero. More... | |
RankTwoTensorTempl (const InitMethod) | |
Select specific initialization pattern. More... | |
RankTwoTensorTempl (const TypeVector< T > &row1, const TypeVector< T > &row2, const TypeVector< T > &row3) | |
Constructor that takes in 3 vectors and uses them to create rows _coords[0][i] = row1(i), _coords[1][i] = row2(i), _coords[2][i] = row3(i) More... | |
RankTwoTensorTempl (const std::vector< T > &input) | |
Constructor that proxies the fillFromInputVector method. More... | |
RankTwoTensorTempl (T S11, T S22, T S33, T S23, T S13, T S12) | |
Initialization list replacement constructors, 6 arguments. More... | |
RankTwoTensorTempl (T S11, T S21, T S31, T S12, T S22, T S32, T S13, T S23, T S33) | |
Initialization list replacement constructors, 9 arguments. More... | |
RankTwoTensorTempl (const RankTwoTensorTempl< T > &a)=default | |
Copy assignment operator must be defined if used. More... | |
RankTwoTensorTempl (const TensorValue< T > &a) | |
Copy constructor from TensorValue<T> More... | |
RankTwoTensorTempl (const TypeTensor< T > &a) | |
Copy constructor from TypeTensor<T> More... | |
template<typename T2 > | |
RankTwoTensorTempl (const RankTwoTensorTempl< T2 > &a) | |
Construct from other template. More... | |
void | fillFromInputVector (const std::vector< T > &input, FillMethod fill_method=autodetect) |
fillFromInputVector takes 6 or 9 inputs to fill in the Rank-2 tensor. More... | |
void | fillFromScalarVariable (const VariableValue &scalar_variable) |
fillFromScalarVariable takes FIRST/THIRD/SIXTH order scalar variable to fill in the Rank-2 tensor. More... | |
TypeVector< T > | column (const unsigned int c) const |
returns _coords[i][c], ie, column c, with c = 0, 1, 2 More... | |
RankTwoTensorTempl< T > | rotated (const RankTwoTensorTempl< T > &R) const |
Returns a rotated version of the tensor data given a rank two tensor rotation tensor _coords[i][j] = R_ij * R_jl * _coords[k][l]. More... | |
void | rotate (const RankTwoTensorTempl< T > &R) |
rotates the tensor data given a rank two tensor rotation tensor _coords[i][j] = R_ij * R_jl * _coords[k][l] More... | |
RankTwoTensorTempl< T > | rotateXyPlane (T a) |
rotates the tensor data anticlockwise around the z-axis More... | |
RankTwoTensorTempl< T > | transpose () const |
Returns a matrix that is the transpose of the matrix this was called on. More... | |
RankTwoTensorTempl< T > & | operator= (const RankTwoTensorTempl< T > &a) |
sets _coords to a, and returns _coords More... | |
template<typename Scalar > | |
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, RankTwoTensorTempl & >::type | operator= (const Scalar &libmesh_dbg_var(p)) |
Assignment-from-scalar operator. More... | |
RankTwoTensorTempl< T > & | operator+= (const RankTwoTensorTempl< T > &a) |
adds a to _coords More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > | operator+ (const TypeTensor< T2 > &a) const |
returns _coords + a More... | |
RankTwoTensorTempl< T > & | operator-= (const RankTwoTensorTempl< T > &a) |
sets _coords -= a and returns vals More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > | operator- (const TypeTensor< T2 > &a) const |
returns _coords - a More... | |
RankTwoTensorTempl< T > | operator- () const |
returns -_coords More... | |
RankTwoTensorTempl< T > & | operator*= (const T &a) |
performs _coords *= a More... | |
template<typename T2 , typename std::enable_if< ScalarTraits< T2 >::value, int >::type = 0> | |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > | operator* (const T2 &a) const |
returns _coords*a More... | |
RankTwoTensorTempl< T > & | operator/= (const T &a) |
performs _coords /= a More... | |
template<typename T2 , typename std::enable_if< ScalarTraits< T2 >::value, int >::type = 0> | |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > | operator/ (const T2 &a) const |
returns _coords/a More... | |
template<typename T2 > | |
TypeVector< typename CompareTypes< T, T2 >::supertype > | operator* (const TypeVector< T2 > &a) const |
Defines multiplication with a vector to get a vector. More... | |
template<typename T2 > | |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > | operator* (const TypeTensor< T2 > &a) const |
Defines multiplication with a TypeTensor<T> More... | |
RankTwoTensorTempl< T > & | operator*= (const TypeTensor< T > &a) |
Defines multiplication with a TypeTensor<T> More... | |
bool | operator== (const RankTwoTensorTempl< T > &a) const |
Defines logical equality with another RankTwoTensorTempl<T> More... | |
RankTwoTensorTempl< T > & | operator= (const ColumnMajorMatrixTempl< T > &a) |
Sets _coords to the values in a ColumnMajorMatrix (must be 3x3) More... | |
T | doubleContraction (const RankTwoTensorTempl< T > &a) const |
returns _coords_ij * a_ij (sum on i, j) More... | |
RankFourTensorTempl< T > | outerProduct (const RankTwoTensorTempl< T > &a) const |
returns C_ijkl = a_ij * b_kl More... | |
RankFourTensorTempl< T > | mixedProductIkJl (const RankTwoTensorTempl< T > &a) const |
returns C_ijkl = a_ik * b_jl More... | |
RankFourTensorTempl< T > | mixedProductJkIl (const RankTwoTensorTempl< T > &a) const |
returns C_ijkl = a_jk * b_il More... | |
RankFourTensorTempl< T > | mixedProductIlJk (const RankTwoTensorTempl< T > &a) const |
returns C_ijkl = a_il * b_jk More... | |
RankFourTensorTempl< T > | positiveProjectionEigenDecomposition (std::vector< T > &eigval, RankTwoTensorTempl< T > &eigvec) const |
return positive projection tensor of eigen-decomposition More... | |
RankTwoTensorTempl< T > | deviatoric () const |
returns A_ij - de_ij*tr(A)/3, where A are the _coords More... | |
T | trace () const |
returns the trace of the tensor, ie _coords[i][i] (sum i = 0, 1, 2) More... | |
RankTwoTensorTempl< T > | inverse () const |
retuns the inverse of the tensor More... | |
RankTwoTensorTempl< T > | dtrace () const |
Denote the _coords[i][j] by A_ij, then this returns d(trace)/dA_ij. More... | |
T | generalSecondInvariant () const |
Denote the _coords[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns (S_ij + S_ji)*(S_ij + S_ji)/8 Note the explicit symmeterisation. More... | |
T | secondInvariant () const |
Calculates the second invariant (I2) of a tensor. More... | |
RankTwoTensorTempl< T > | dsecondInvariant () const |
Denote the _coords[i][j] by A_ij, then this returns d(secondInvariant)/dA_ij. More... | |
RankFourTensorTempl< T > | d2secondInvariant () const |
Denote the _coords[i][j] by A_ij, then this returns d^2(secondInvariant)/dA_ij/dA_kl. More... | |
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. 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... | |
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 DualReal rank two tensor. More... | |
void | printDualReal (unsigned int nDual, std::ostream &stm=Moose::out) const |
Print the Real part of the DualReal rank two tensor along with its first nDual dual numbers. More... | |
void | addIa (const T &a) |
Add identity times a to _coords. More... | |
T | L2norm () const |
Sqrt(_coords[i][j]*_coords[i][j]) 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 | symmetricEigenvalues (std::vector< T > &eigvals) const |
computes eigenvalues, assuming tens is symmetric, and places them in ascending order in eigvals More... | |
RankTwoTensorTempl< T > | permutationTensor (const std::array< unsigned int, LIBMESH_DIM > &old_elements, const std::array< unsigned int, LIBMESH_DIM > &new_elements) const |
computes and returns the permutation matrix P More... | |
RankTwoTensorTempl< T > | givensRotation (unsigned int row1, unsigned int row2, unsigned int col) const |
computes and returns the Givens rotation matrix R More... | |
void | hessenberg (RankTwoTensorTempl< T > &H, RankTwoTensorTempl< T > &U) const |
computes the Hessenberg form of this matrix A and its unitary transformation U such that A = U * H * U^T More... | |
void | QR (RankTwoTensorTempl< T > &Q, RankTwoTensorTempl< T > &R, unsigned int dim=RankTwoTensorTempl< T >::N) const |
computes the QR factorization such that A = Q * R, where Q is the unitary matrix and R an upper triangular matrix 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 | 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... | |
void | getRUDecompositionRotation (RankTwoTensorTempl< T > &rot) const |
Uses the petscblaslapack.h LAPACKsyev_ routine to perform RU decomposition and obtain the rotation tensor. More... | |
void | vectorOuterProduct (const TypeVector< T > &, const TypeVector< T > &) |
RankTwoTensorTempl<T> from outer product of vectors. More... | |
void | fillRealTensor (TensorValue< T > &) |
Return real tensor of a rank two tensor. More... | |
void | fillRow (unsigned int, const TypeVector< T > &) |
Assigns value to the columns of a specified row. More... | |
void | fillColumn (unsigned int, const TypeVector< T > &) |
Assigns value to the rows of a specified column. More... | |
RankTwoTensorTempl< T > | initialContraction (const RankFourTensorTempl< T > &b) const |
returns this_ij * b_ijkl More... | |
void | setToIdentity () |
set the tensor to the identity matrix More... | |
template<> | |
void | printReal (std::ostream &stm) const |
template<> | |
void | printDualReal (unsigned int nDual, std::ostream &stm) const |
template<> | |
void | QR (RankTwoTensorTempl< DualReal > &Q, RankTwoTensorTempl< DualReal > &R, unsigned int dim) const |
template<> | |
void | symmetricEigenvaluesEigenvectors (std::vector< DualReal > &eigvals, RankTwoTensorTempl< DualReal > &eigvecs) const |
template<> | |
void | syev (const char *, std::vector< DualReal > &, std::vector< DualReal > &) const |
template<> | |
void | getRUDecompositionRotation (RankTwoTensorTempl< DualReal > &) const |
Static Public Member Functions | |
static RankTwoTensorTempl | initializeFromRows (const TypeVector< T > &row0, const TypeVector< T > &row1, const TypeVector< T > &row2) |
named constructor for initializing from row vectors More... | |
static RankTwoTensorTempl | initializeFromColumns (const TypeVector< T > &col0, const TypeVector< T > &col1, const TypeVector< T > &col2) |
named constructor for initializing from column vectors More... | |
static RankTwoTensorTempl | Identity () |
static MooseEnum | fillMethodEnum () |
Static method for use in validParams for getting the "fill_method". More... | |
static void | initRandom (unsigned int) |
This function initializes random seed based on a user-defined number. More... | |
static RankTwoTensorTempl< T > | genRandomTensor (T, T) |
This function generates a random unsymmetric rank two tensor. More... | |
static RankTwoTensorTempl< T > | genRandomSymmTensor (T, T) |
This function generates a random symmetric rank two tensor. More... | |
Static Private Attributes | |
static constexpr unsigned int | N = LIBMESH_DIM |
static constexpr unsigned int | N2 = N * N |
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 *) |
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 114 of file MooseTypes.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 94 of file RankTwoTensor.h.
enum RankTwoTensorTempl::InitMethod |
Enumerator | |
---|---|
initNone | |
initIdentity |
Definition at line 77 of file RankTwoTensor.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | ) |
Default constructor; fills to zero.
Definition at line 65 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::Identity().
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const InitMethod | init | ) |
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | const TypeVector< T > & | row1, |
const TypeVector< T > & | row2, | ||
const TypeVector< T > & | row3 | ||
) |
Constructor that takes in 3 vectors and uses them to create rows _coords[0][i] = row1(i), _coords[1][i] = row2(i), _coords[2][i] = row3(i)
TODO: deprecate this method in favor of initializeFromRows.
Definition at line 94 of file RankTwoTensor.C.
|
inline |
Constructor that proxies the fillFromInputVector method.
Definition at line 122 of file RankTwoTensor.h.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | T | S11, |
T | S22, | ||
T | S33, | ||
T | S23, | ||
T | S13, | ||
T | S12 | ||
) |
Initialization list replacement constructors, 6 arguments.
Definition at line 131 of file RankTwoTensor.C.
RankTwoTensorTempl< T >::RankTwoTensorTempl | ( | T | S11, |
T | S21, | ||
T | S31, | ||
T | S12, | ||
T | S22, | ||
T | S32, | ||
T | S13, | ||
T | S23, | ||
T | S33 | ||
) |
Initialization list replacement constructors, 9 arguments.
Definition at line 142 of file RankTwoTensor.C.
|
default |
Copy assignment operator must be defined if used.
|
inline |
Copy constructor from TensorValue<T>
Definition at line 134 of file RankTwoTensor.h.
|
inline |
Copy constructor from TypeTensor<T>
Definition at line 137 of file RankTwoTensor.h.
|
inline |
Construct from other template.
Definition at line 141 of file RankTwoTensor.h.
void RankTwoTensorTempl< T >::addIa | ( | const T & | a | ) |
Add identity times a to _coords.
Definition at line 874 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::deviatoric(), RankTwoTensorTempl< Real >::hessenberg(), RankTwoTensorTempl< Real >::QR(), and RankTwoTensorTempl< Real >::symmetricEigenvaluesEigenvectors().
TypeVector< T > RankTwoTensorTempl< T >::column | ( | const unsigned int | c | ) | const |
returns _coords[i][c], ie, column c, with c = 0, 1, 2
Definition at line 241 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
RankFourTensorTempl< T > RankTwoTensorTempl< T >::d2secondInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d^2(secondInvariant)/dA_ij/dA_kl.
Definition at line 581 of file RankTwoTensor.C.
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 778 of file RankTwoTensor.C.
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 1149 of file RankTwoTensor.C.
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 659 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::ddet | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(det)/dA_ij.
Definition at line 804 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::deviatoric | ( | ) | const |
returns A_ij - de_ij*tr(A)/3, where A are the _coords
Definition at line 531 of file RankTwoTensor.C.
T RankTwoTensorTempl< T >::doubleContraction | ( | const RankTwoTensorTempl< T > & | a | ) | const |
returns _coords_ij * a_ij (sum on i, j)
Definition at line 402 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dsecondInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(secondInvariant)/dA_ij.
Definition at line 574 of file RankTwoTensor.C.
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 765 of file RankTwoTensor.C.
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 1110 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dthirdInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(thirdInvariant()/dA_ij.
Definition at line 636 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::dtrace | ( | ) | const |
Denote the _coords[i][j] by A_ij, then this returns d(trace)/dA_ij.
Definition at line 613 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::fillColumn | ( | unsigned int | c, |
const TypeVector< T > & | v | ||
) |
Assigns value to the rows of a specified column.
Definition at line 1331 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::fillFromInputVector | ( | const std::vector< T > & | input, |
FillMethod | fill_method = autodetect |
||
) |
fillFromInputVector takes 6 or 9 inputs to fill in the Rank-2 tensor.
If 6 inputs, then symmetry is assumed S_ij = S_ji, and _coords[0][0] = input[0] _coords[1][1] = input[1] _coords[2][2] = input[2] _coords[1][2] = input[3] _coords[0][2] = input[4] _coords[0][1] = input[5] If 9 inputs then input order is [0][0], [1][0], [2][0], [0][1], [1][1], ..., [2][2]
Definition at line 158 of file RankTwoTensor.C.
Referenced by GenericConstantRankTwoTensor::GenericConstantRankTwoTensor(), and RankTwoTensorTempl< Real >::RankTwoTensorTempl().
void RankTwoTensorTempl< T >::fillFromScalarVariable | ( | const VariableValue & | scalar_variable | ) |
fillFromScalarVariable takes FIRST/THIRD/SIXTH order scalar variable to fill in the Rank-2 tensor.
Definition at line 208 of file RankTwoTensor.C.
|
static |
Static method for use in validParams for getting the "fill_method".
Definition at line 59 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::fillRealTensor | ( | TensorValue< T > & | tensor | ) |
Return real tensor of a rank two tensor.
Definition at line 1314 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::fillRow | ( | unsigned int | r, |
const TypeVector< T > & | v | ||
) |
Assigns value to the columns of a specified row.
Definition at line 1323 of file RankTwoTensor.C.
T RankTwoTensorTempl< T >::generalSecondInvariant | ( | ) | const |
Denote the _coords[i][j] by A_ij, then S_ij = A_ij - de_ij*tr(A)/3 Then this returns (S_ij + S_ji)*(S_ij + S_ji)/8 Note the explicit symmeterisation.
Definition at line 540 of file RankTwoTensor.C.
|
static |
This function generates a random symmetric rank two tensor.
The first real scales the random number. The second real offsets the uniform random number
Definition at line 1292 of file RankTwoTensor.C.
|
static |
This function generates a random unsymmetric rank two tensor.
The first real scales the random number. The second real offsets the uniform random number
Definition at line 1279 of file RankTwoTensor.C.
void RankTwoTensorTempl< DualReal >::getRUDecompositionRotation | ( | RankTwoTensorTempl< DualReal > & | ) | const |
Definition at line 1265 of file RankTwoTensor.C.
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 1228 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::givensRotation | ( | unsigned int | row1, |
unsigned int | row2, | ||
unsigned int | col | ||
) | const |
computes and returns the Givens rotation matrix R
row1 | is the row number of the first component to rotate |
row2 | is the row number of the second component to rotate |
col | is the column number of the components to rotate consider a RankTwoTensor A = [ a11 a12 a13 a21 a22 a23 a31 a32 a33] and we want to rotate a21 and a31. Then row1 = 1, row2 = 2, col = 0. It retunrs the Givens rotation matrix R of this tensor A such that R * A rotates the second component to zero, i.e. R * A = [ a11 a12 a13 r a22 a23 0 a32 a33] A DualReal instantiation is available to rotate dual numbers as well. |
Definition at line 948 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::QR().
void RankTwoTensorTempl< T >::hessenberg | ( | RankTwoTensorTempl< T > & | H, |
RankTwoTensorTempl< T > & | U | ||
) | const |
computes the Hessenberg form of this matrix A and its unitary transformation U such that A = U * H * U^T
Definition at line 987 of file RankTwoTensor.C.
|
inlinestatic |
Definition at line 146 of file RankTwoTensor.h.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::initialContraction | ( | const RankFourTensorTempl< T > & | b | ) | const |
|
static |
named constructor for initializing from column vectors
Definition at line 122 of file RankTwoTensor.C.
|
static |
|
static |
This function initializes random seed based on a user-defined number.
Definition at line 1272 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::inverse | ( | ) | const |
retuns the inverse of the tensor
Definition at line 606 of file RankTwoTensor.C.
T RankTwoTensorTempl< T >::L2norm | ( | ) | const |
RankFourTensorTempl< T > RankTwoTensorTempl< T >::mixedProductIkJl | ( | const RankTwoTensorTempl< T > & | a | ) | const |
returns C_ijkl = a_ik * b_jl
Definition at line 427 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
RankFourTensorTempl< T > RankTwoTensorTempl< T >::mixedProductIlJk | ( | const RankTwoTensorTempl< T > & | a | ) | const |
returns C_ijkl = a_il * b_jk
Definition at line 446 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
RankFourTensorTempl< T > RankTwoTensorTempl< T >::mixedProductJkIl | ( | const RankTwoTensorTempl< T > & | a | ) | const |
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const T2 & | a | ) | const |
returns _coords*a
Definition at line 559 of file RankTwoTensor.h.
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const TypeTensor< T2 > & | a | ) | const |
Defines multiplication with a TypeTensor<T>
Definition at line 575 of file RankTwoTensor.h.
TypeVector< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator* | ( | const TypeVector< T2 > & | a | ) | const |
Defines multiplication with a vector to get a vector.
Definition at line 567 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator*= | ( | const T & | a | ) |
performs _coords *= a
Definition at line 351 of file RankTwoTensor.C.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator*= | ( | const TypeTensor< T > & | a | ) |
Defines multiplication with a TypeTensor<T>
Definition at line 367 of file RankTwoTensor.C.
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator+ | ( | const TypeTensor< T2 > & | a | ) | const |
returns _coords + a
Definition at line 543 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator+= | ( | const RankTwoTensorTempl< T > & | a | ) |
adds a to _coords
Definition at line 328 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::operator- | ( | ) | const |
returns -_coords
Definition at line 344 of file RankTwoTensor.C.
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator- | ( | const TypeTensor< T2 > & | a | ) | const |
returns _coords - a
Definition at line 551 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator-= | ( | const RankTwoTensorTempl< T > & | a | ) |
sets _coords -= a and returns vals
Definition at line 336 of file RankTwoTensor.C.
RankTwoTensorTempl< typename CompareTypes< T, T2 >::supertype > RankTwoTensorTempl< T >::operator/ | ( | const T2 & | a | ) | const |
returns _coords/a
Definition at line 583 of file RankTwoTensor.h.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator/= | ( | const T & | a | ) |
performs _coords /= a
Definition at line 359 of file RankTwoTensor.C.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator= | ( | const ColumnMajorMatrixTempl< T > & | a | ) |
Sets _coords to the values in a ColumnMajorMatrix (must be 3x3)
Definition at line 387 of file RankTwoTensor.C.
RankTwoTensorTempl< T > & RankTwoTensorTempl< T >::operator= | ( | const RankTwoTensorTempl< T > & | a | ) |
sets _coords to a, and returns _coords
Definition at line 320 of file RankTwoTensor.C.
|
inline |
Assignment-from-scalar operator.
Used only to zero out vectors.
Definition at line 208 of file RankTwoTensor.h.
bool RankTwoTensorTempl< T >::operator== | ( | const RankTwoTensorTempl< T > & | a | ) | const |
Defines logical equality with another RankTwoTensorTempl<T>
Definition at line 375 of file RankTwoTensor.C.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::outerProduct | ( | const RankTwoTensorTempl< T > & | a | ) | const |
returns C_ijkl = a_ij * b_kl
Definition at line 410 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::permutationTensor | ( | const std::array< unsigned int, LIBMESH_DIM > & | old_elements, |
const std::array< unsigned int, LIBMESH_DIM > & | new_elements | ||
) | const |
computes and returns the permutation matrix P
old_elements | is the original row/column numbering |
new_elements | is the permuted row/column numbering Dual numbers are permuted as well P * A permutes rows and A * P^T permutes columns |
Definition at line 934 of file RankTwoTensor.C.
RankFourTensorTempl< T > RankTwoTensorTempl< T >::positiveProjectionEigenDecomposition | ( | std::vector< T > & | eigval, |
RankTwoTensorTempl< T > & | eigvec | ||
) | const |
return positive projection tensor of eigen-decomposition
Definition at line 480 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::print | ( | std::ostream & | stm = Moose::out | ) | const |
void RankTwoTensorTempl< DualReal >::printDualReal | ( | unsigned int | nDual, |
std::ostream & | stm | ||
) | const |
Definition at line 856 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::printDualReal | ( | unsigned int | nDual, |
std::ostream & | stm = Moose::out |
||
) | const |
Print the Real part of the DualReal rank two tensor along with its first nDual dual numbers.
void RankTwoTensorTempl< DualReal >::printReal | ( | std::ostream & | stm | ) | const |
Definition at line 843 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::printReal | ( | std::ostream & | stm = Moose::out | ) | const |
Print the Real part of the DualReal rank two tensor.
void RankTwoTensorTempl< DualReal >::QR | ( | RankTwoTensorTempl< DualReal > & | Q, |
RankTwoTensorTempl< DualReal > & | R, | ||
unsigned int | dim | ||
) | const |
Definition at line 1023 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::QR | ( | RankTwoTensorTempl< T > & | Q, |
RankTwoTensorTempl< T > & | R, | ||
unsigned int | dim = RankTwoTensorTempl<T>::N |
||
) | const |
computes the QR factorization such that A = Q * R, where Q is the unitary matrix and R an upper triangular matrix
Definition at line 1003 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::symmetricEigenvaluesEigenvectors().
void RankTwoTensorTempl< T >::rotate | ( | const RankTwoTensorTempl< T > & | R | ) |
rotates the tensor data given a rank two tensor rotation tensor _coords[i][j] = R_ij * R_jl * _coords[k][l]
R | rotation matrix as a RankTwoTensorTempl |
Definition at line 262 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::rotated().
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::rotated | ( | const RankTwoTensorTempl< T > & | R | ) | const |
Returns a rotated version of the tensor data given a rank two tensor rotation tensor _coords[i][j] = R_ij * R_jl * _coords[k][l].
R | rotation matrix as another RankTwoTensorTempl |
Definition at line 253 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::rotateXyPlane | ( | T | a | ) |
rotates the tensor data anticlockwise around the z-axis
a | angle in radians |
Definition at line 294 of file RankTwoTensor.C.
T RankTwoTensorTempl< T >::secondInvariant | ( | ) | const |
void RankTwoTensorTempl< T >::setToIdentity | ( | ) |
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 751 of file RankTwoTensor.C.
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 895 of file RankTwoTensor.C.
void RankTwoTensorTempl< DualReal >::syev | ( | const char * | , |
std::vector< DualReal > & | , | ||
std::vector< DualReal > & | |||
) | const |
Definition at line 1219 of file RankTwoTensor.C.
void RankTwoTensorTempl< T >::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")
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 1186 of file RankTwoTensor.C.
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 913 of file RankTwoTensor.C.
void RankTwoTensorTempl< DualReal >::symmetricEigenvaluesEigenvectors | ( | std::vector< DualReal > & | eigvals, |
RankTwoTensorTempl< DualReal > & | eigvecs | ||
) | const |
Definition at line 1058 of file RankTwoTensor.C.
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 921 of file RankTwoTensor.C.
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 620 of file RankTwoTensor.C.
T RankTwoTensorTempl< T >::trace | ( | ) | const |
returns the trace of the tensor, ie _coords[i][i] (sum i = 0, 1, 2)
Definition at line 598 of file RankTwoTensor.C.
RankTwoTensorTempl< T > RankTwoTensorTempl< T >::transpose | ( | ) | const |
Returns a matrix that is the transpose of the matrix this was called on.
Definition at line 313 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::d2thirdInvariant(), RankTwoTensorTempl< Real >::dthirdInvariant(), RankTwoTensorTempl< Real >::getRUDecompositionRotation(), RankTwoTensorTempl< Real >::hessenberg(), RankTwoTensorTempl< Real >::QR(), and RankTwoTensorTempl< Real >::thirdInvariant().
void RankTwoTensorTempl< T >::vectorOuterProduct | ( | const TypeVector< T > & | v1, |
const TypeVector< T > & | v2 | ||
) |
RankTwoTensorTempl<T> from outer product of vectors.
Definition at line 1305 of file RankTwoTensor.C.
Referenced by RankTwoTensorTempl< Real >::positiveProjectionEigenDecomposition().
|
friend |
|
friend |
Definition at line 532 of file RankTwoTensor.h.
Definition at line 534 of file RankTwoTensor.h.
|
staticconstexprprivate |
Definition at line 524 of file RankTwoTensor.h.
|
staticconstexprprivate |
Definition at line 522 of file RankTwoTensor.h.
|
staticconstexprprivate |
Definition at line 523 of file RankTwoTensor.h.