MatrixVectorOperators
This is the collection of matrix-vector operators for three-dimensional vectors dVector3 and matrices dMatrix3x3, and elasticity tensors vStrain, vStress and dMatrix6x6.
cppextern inline dVector3 operator*(const dMatrix3x3& lhs, const dVector3& rhs);Dot product of matrix and vector.
cppextern inline dVector3 operator*(const dMatrix3x3& lhs, const iVector3& rhs);Dot product of matrix and vector. Operator overload for integer-valued vector.
cppextern inline double operator*(const iVector3& lhs, const dVector3& rhs);Dot product of two vectors. Operator overload for integer-valued
lhsvector.
cppextern inline double operator*(const dVector3& lhs, const iVector3& rhs);Dot product of two vectors. Operator overload for integer-valued
rhsvector.
cppextern inline dVector3 operator+(const iVector3& lhs, const dVector3& rhs);Sum of two vectors. Operator overload for integer-valued
lhsvector.
cppextern inline dVector3 operator+(const dVector3& lhs, const iVector3& rhs);Sum of two vectors. Operator overload for integer-valued
rhsvector.
cppextern inline dVector3 operator-(const iVector3& lhs, const dVector3& rhs);Subtraction operator. Operator overload for integer-valued
lhsvector.
cppextern inline dVector3 operator-(const dVector3& lhs, const iVector3& rhs);Subtraction operator. Operator overload for integer-valued
rhsvector.
cppextern inline dMatrix6x6 outer(const dMatrix3x3& lhs, const dMatrix3x3& rhs):Outer product of two
3x3matrices. Returns6x6matrix in Voigt notations instead of a fourth rank3x3x3x3tensor.
cppextern inline vStrain VoigtStrain(const dMatrix3x3& locStrainTensor);Converts
3x3strain tensor to the corresponding 6-component Voigt vector.
cppextern inline vStress VoigtStress(const dMatrix3x3& locStressTensor); Converts `3x3` stress tensor to the corresponding 6-component Voigt vector.
cppextern inline std::vector<dVector3> Col(const dMatrix3x3& Mat);Returns vector containing columns of a matrix.
cppextern inline vStrain operator*(const dMatrix6x6& locCompliance, const vStress& locStress);Compliance-stress product. Returns Voigt strain vector.
cppextern inline vStress operator*(const dMatrix6x6& locStiffness, const vStrain& locStrain);Stiffness-strain product. Returns Voigt stress vector.
cppextern inline double operator*(const vStrain& locStrain, const vStress& locStress);Strain-stress product. Returns elastic energy density.
cppextern inline double operator*(const vStress& locStress, const vStrain& locStrain);Stress-strain product. Returns elastic energy density.
cppextern inline void Eigensystem(dMatrix3x3 M, dMatrix3x3& Eigenvectors, dMatrix3x3& Eigenvalues, double accuracy = FLT_EPSILON);Calculates
eigenvectorsandeigenvalues(output as a diagonal matrix for convenience) of a real symmetric matrixMusing Jacobi method.
cppextern inline dMatrix3x3 sqrtM3x3(const dMatrix3x3& M, double accuracy = FLT_EPSILON);Calculates square root of
3x3matrixM.
cppextern inline dMatrix3x3 qurtM3x3(const dMatrix3x3& M, double accuracy = FLT_EPSILON);Calculates fourth order (quartic) root of
3x3matrixM.
cppextern inline dMatrix3x3 logM3x3(const dMatrix3x3& M, double accuracy = FLT_EPSILON);Calculates natural logarithm of
3x3matrixM.
cppextern inline dMatrix3x3 expM3x3(const dMatrix3x3& M, double accuracy = FLT_EPSILON);Calculates exponent of
3x3matrixM.
cppextern inline void PolarDecomposition(const dMatrix3x3& D, dMatrix3x3& R, dMatrix3x3& U, double accuracy = FLT_EPSILON);Calculates polar decomposition of a positive semi-definite matrix
D = RU, whereRis the rotation tensor amdUis the stretch tensor return via reference.
cppextern inline dMatrix3x3 AlignBaseAxes(dMatrix3x3 M);Aligns X, Y and Z axes of tensor
Mwith the base vectors. Uses Givens rotations.