|
IFEM
90A354
|
Simple class for representing a symmetric second-order tensor. More...
#include <Tensor.h>


Public Member Functions | |
| SymmTensor (const t_ind nsd, bool with33=false) | |
| Constructor creating a zero tensor. More... | |
| SymmTensor (const std::vector< Real > &vec) | |
| Constructor creating a symmetric tensor from a vector. | |
| SymmTensor (const SymmTensor &T) | |
| Copy constructor. | |
| SymmTensor & | operator= (Real val) |
| Assignment operator. | |
| void | copy (const SymmTensor &T) |
| Copies a symmetric tensor, possibly with dimension change. | |
| bool | symmetric () const override |
| Query whether this tensor is symmetric or not. | |
| Tensor & | transpose () override |
| Transposes the symmetric tensor (i.e., does nothing). | |
| Tensor & | symmetrize () override |
| Makes the symmetric tensor symmetric (i.e., does nothing). | |
| Real | trace () const override |
| Returns the trace of the symmetric tensor. | |
| Real | det () const override |
| Returns the determinant of the symmetric tensor. | |
| Real | inverse (Real tol=Real(0)) override |
| Inverts the symmetric tensor. More... | |
| SymmTensor & | transform (const Tensor &T) |
| Congruence transformation of a symmetric tensor. More... | |
| SymmTensor & | rightCauchyGreen (const Tensor &F) |
| Constructs the right Cauchy-Green tensor from a deformation tensor. | |
| SymmTensor & | outerProd (const Vec3 &u) |
| Dyadic (outer) product between two identical vectors. | |
| Real | L2norm (bool doSqrt=true) const |
| Returns the inner-product (L2-norm) of the symmetric tensor. | |
| Real | vonMises (bool doSqrt=true) const |
| Returns the von Mises value of the symmetric tensor. More... | |
| bool | principal (Vec3 &p, bool sorted=true) const |
| Computes the principal values of the symmetric tensor. | |
| bool | principal (Vec3 &p, Tensor &pdir) const |
| Computes the principal values and associated principal directions. More... | |
| bool | principal (Vec3 &p, Vec3 *pdir, int ndir=0) const |
| Computes the principal values and associated principal directions. | |
| bool | principal (Vec3 &p, SymmTensor *M) const |
| Computes the principal values and associated principal directions. | |
| std::ostream & | print (std::ostream &os, int prec=0) const override |
| Prints out the lower triangle of the tensor to an output stream. | |
Public Member Functions inherited from Tensor | |
| Tensor (const t_ind nsd, bool identity=false) | |
| Constructor creating a zero or identity tesnor. | |
| Tensor (const Vec3 &vn, bool vnIsX=false) | |
| Constructor creating a transformation from a face normal vector. More... | |
| Tensor (const Vec3 &t1, const Vec3 &t2, bool t1isZ=false, bool t2isXZ=false) | |
| Constructor creating a transformation from two tangent vectors. More... | |
| Tensor (const Vec3 &v1, const Vec3 &v2, const Vec3 &v3) | |
| Constructor creating a transformation from three unit vectors. More... | |
| Tensor (Real a1, Real a2, Real a3) | |
| Constructor creating a transformation from three rotation angles. More... | |
| Tensor (const Tensor &T, bool transpose=false) | |
| Copy constructor, optionally creating the transpose of T. | |
| Tensor (const std::vector< Real > &a, bool transpose=false) | |
| Constructor copying its content from a one-dimensional array. | |
| virtual | ~Tensor () |
| Empty destructor. | |
| void | zero () |
| Sets *this to the 0-tensor. | |
| void | diag (Real value=Real(1)) |
| Sets *this to a diagonal tensor with value on the diagonal. | |
| void | diag (const Vec3 &diagonal) |
| Sets *this to a diagonal tensor with given vector as diagonal. | |
| operator const std::vector< Real > & () const | |
| Type casting to a one-dimensional vector, for referencing. | |
| operator std::vector< Real > & () | |
| Type casting to a one-dimensional vector, for assignment. | |
| const Real * | ptr () const |
| Reference through a pointer. | |
| const Real & | operator() (t_ind i, t_ind j) const |
| Index-1 based component reference. | |
| Real & | operator() (t_ind i, t_ind j) |
| Index-1 based component access. | |
| Vec3 | operator[] (t_ind i) const |
| Index-0 based column reference. | |
| Tensor & | operator= (const Tensor &T) |
| Assignment operator. | |
| Tensor & | operator= (const std::vector< Real > &val) |
| Overloaded assignment operator. | |
| Tensor & | operator= (Real val) |
| Overloaded assignment operator. | |
| Tensor & | operator+= (const Tensor &T) |
| Incrementation operator. | |
| Tensor & | operator+= (Real val) |
| Incrementation operator. | |
| Tensor & | operator-= (const Tensor &T) |
| Decrementation operator. | |
| Tensor & | operator-= (Real val) |
| Decrementation operator. | |
| Tensor & | operator*= (Real val) |
| Scaling operator. | |
| Tensor & | operator*= (const Tensor &B) |
| Post-multiplication with another Tensor. | |
| Tensor & | postMult (const Tensor &B) |
| Post-multiplication with another Tensor. | |
| Tensor & | preMult (const Tensor &A) |
| Pre-multiplication with another Tensor. | |
| Tensor & | rotate (Real alpha, t_ind axis) |
| Rotates the tensor about given coordinate axis. | |
| Tensor & | outerProd (const Vec3 &a, const Vec3 &b) |
| Dyadic (outer) product between two vectors. | |
| Real | innerProd (const Tensor &T) const |
| Returns the inner-product of *this and the given tensor. | |
| t_ind | dim () const |
| Returns the dimension of this tensor. | |
| size_t | size () const |
| Returns the size of this tensor. | |
| bool | equal (const Tensor &T, Real tol=Real(1.0e-6)) const |
| Query whether this tensor equals another within given tolerance. | |
| bool | isZero (Real tol=Real(1.0e-6)) const |
| Query whether this tensor is zero within given tolerance. | |
| Tensor & | shift (short int idx=1) |
| Performs a cyclic permutation of the tensor columns. | |
| Vec3 | rotVec () const |
| Returns the rotation angles corresponding to the tensor. | |
Protected Member Functions | |
| t_ind | index (t_ind i, t_ind j) const override |
| Returns a 0-based array index for the given tensor indices. More... | |
Private Member Functions | |
| bool | redim (const t_ind nsd, bool with33=false) |
| Resets the number of spatial dimensions of the tensor. More... | |
Friends | |
| SymmTensor | operator+ (const SymmTensor &T, Real a) |
| Adding a scaled unit tensor to a symmetric tensor. | |
| SymmTensor | operator- (const SymmTensor &T, Real a) |
| Subtracting a scaled unit tensor from a symmetric tensor. | |
| SymmTensor | operator* (Real a, const SymmTensor &T) |
| Multiplication between a scalar and a symmetric tensor. | |
| SymmTensor | operator* (const SymmTensor &A, const SymmTensor &B) |
| Multiplication between two symmetric tensors. | |
Additional Inherited Members | |
Protected Types inherited from Tensor | |
| using | t_ind = unsigned short int |
| Tensor index type (for convenience) | |
Protected Attributes inherited from Tensor | |
| const t_ind | n |
| Number of spatial dimensions for the tensor. | |
| std::vector< Real > | v |
| The actual tensor component values. | |
Simple class for representing a symmetric second-order tensor.
|
explicit |
Constructor creating a zero tensor.
| [in] | nsd | The tensor dimension (1, 2 or 3) |
| [in] | with33 | If true and nsd = 2, include the 33 term also |
The combination nsd = 2 and with33 = true results in a 2D tensor with the 33-term as the forth component. This is typically used to represent the symmetric stress tensor in 2D plane strain models, where the \(\sigma_{zz}\) component is nonzero.
References redim().
Returns a 0-based array index for the given tensor indices.
Symmetric 3D tensors are assumed stored with the following order: s11, s22, s33, s12, s23, s13. Symmetric 2D tensors have the order s11, s22, s12 and if the 33 component is included: s11, s22, s33, s12.
Reimplemented from Tensor.
Computes the principal values and associated principal directions.
This version is only for 3D tensors. It is a re-implementation of the Fortran-77 subroutine EIGS3D from FENRIS by Kjell Magne Mathisen (2010). The eigenvectors are stored as columns of the Tensor object pdir.
References Vec3::asum(), Tensor::diag(), epsZ, Tensor::n, Real, and Tensor::v.
|
private |
Resets the number of spatial dimensions of the tensor.
| [in] | nsd | The new tensor dimension |
| [in] | with33 | If true and nsd = 2, include the 33 term also |
This method is private because the tensor dimension is not supposed to be changed by the application. It is only for internal use.
References Tensor::n, Real, and Tensor::v.
Referenced by copy(), rightCauchyGreen(), and SymmTensor().
| SymmTensor & SymmTensor::transform | ( | const Tensor & | T | ) |
Congruence transformation of a symmetric tensor.
Perform the triple matrix product
\[{\bf A} = {\bf T A T}^T\]
where A = *this
References Tensor::dim(), Tensor::n, Real, Tensor::symmetric(), and Tensor::v.
| Real SymmTensor::vonMises | ( | bool | doSqrt = true | ) | const |