Skip to content

MatrixVectorOperators

This is the collection of matrix-vector operators for three-dimensional vectors dVector3 and matrices dMatrix3x3, and elasticity tensors vStrain, vStress and dMatrix6x6.

cpp
extern inline dVector3 operator*(const dMatrix3x3& lhs, const dVector3& rhs);

Dot product of matrix and vector.

cpp
extern inline dVector3 operator*(const dMatrix3x3& lhs, const iVector3& rhs);

Dot product of matrix and vector. Operator overload for integer-valued vector.

cpp
extern inline double operator*(const iVector3& lhs, const dVector3& rhs);

Dot product of two vectors. Operator overload for integer-valued lhs vector.

cpp
extern inline double operator*(const dVector3& lhs, const iVector3& rhs);

Dot product of two vectors. Operator overload for integer-valued rhs vector.

cpp
extern inline dVector3 operator+(const iVector3& lhs, const dVector3& rhs);

Sum of two vectors. Operator overload for integer-valued lhs vector.

cpp
extern inline dVector3 operator+(const dVector3& lhs, const iVector3& rhs);

Sum of two vectors. Operator overload for integer-valued rhs vector.

cpp
extern inline dVector3 operator-(const iVector3& lhs, const dVector3& rhs);

Subtraction operator. Operator overload for integer-valued lhs vector.

cpp
extern inline dVector3 operator-(const dVector3& lhs, const iVector3& rhs);

Subtraction operator. Operator overload for integer-valued rhs vector.

cpp
extern inline dMatrix6x6 outer(const dMatrix3x3& lhs, const dMatrix3x3& rhs):

Outer product of two 3x3 matrices. Returns 6x6 matrix in Voigt notations instead of a fourth rank 3x3x3x3 tensor.

cpp
extern inline vStrain VoigtStrain(const dMatrix3x3& locStrainTensor);

Converts 3x3 strain tensor to the corresponding 6-component Voigt vector.

cpp
extern inline vStress VoigtStress(const dMatrix3x3& locStressTensor);
Converts `3x3` stress tensor to the corresponding 6-component Voigt vector.
cpp
extern inline std::vector<dVector3> Col(const dMatrix3x3& Mat);

Returns vector containing columns of a matrix.

cpp
extern inline vStrain operator*(const dMatrix6x6& locCompliance, const vStress& locStress);

Compliance-stress product. Returns Voigt strain vector.

cpp
extern inline vStress operator*(const dMatrix6x6& locStiffness, const vStrain& locStrain);

Stiffness-strain product. Returns Voigt stress vector.

cpp
extern inline double operator*(const vStrain& locStrain, const vStress& locStress);

Strain-stress product. Returns elastic energy density.

cpp
extern inline double operator*(const vStress& locStress, const vStrain& locStrain);

Stress-strain product. Returns elastic energy density.

cpp
extern inline void Eigensystem(dMatrix3x3 M, 
                               dMatrix3x3& Eigenvectors,
                               dMatrix3x3& Eigenvalues,
                               double accuracy = FLT_EPSILON);

Calculates eigenvectors and eigenvalues (output as a diagonal matrix for convenience) of a real symmetric matrix M using Jacobi method.

cpp
extern inline dMatrix3x3 sqrtM3x3(const dMatrix3x3& M,
                                  double accuracy = FLT_EPSILON);

Calculates square root of 3x3 matrix M.

cpp
extern inline dMatrix3x3 qurtM3x3(const dMatrix3x3& M,
                                  double accuracy = FLT_EPSILON);

Calculates fourth order (quartic) root of 3x3 matrix M.

cpp
extern inline dMatrix3x3 logM3x3(const dMatrix3x3& M,
                                 double accuracy = FLT_EPSILON);

Calculates natural logarithm of 3x3 matrix M.

cpp
extern inline dMatrix3x3 expM3x3(const dMatrix3x3& M,
                                 double accuracy = FLT_EPSILON);

Calculates exponent of 3x3 matrix M.

cpp
extern 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, where R is the rotation tensor amd U is the stretch tensor return via reference.

cpp
extern inline dMatrix3x3 AlignBaseAxes(dMatrix3x3 M);

Aligns X, Y and Z axes of tensor Mwith the base vectors. Uses Givens rotations.

Released under the GNU GPLv3 License.