![]() |
|
Implementation of a 3D matrix. More...
#include <Matrix.h>
Public Member Functions | |
| Matrix3D () | |
| default constructor More... | |
| Matrix3D (Mdouble xx, Mdouble xy, Mdouble xz, Mdouble yx, Mdouble yy, Mdouble yz, Mdouble zx, Mdouble zy, Mdouble zz) | |
| Alternative constructor, which let you define all elements. More... | |
| Matrix3D (const SmallMatrix< 3, 3 > &matrix) | |
| Alternative constructor, which takes a matrix of the same size. More... | |
| void | setZero () |
| Sets all elements to zero. More... | |
| double | trace () const |
| Sum of the diagonal elements. More... | |
| Vec3D | diag () const |
| The diagonal elements. More... | |
| double | determinant () const |
| double | deviator () const |
| Deviator. More... | |
| Matrix3D | operator+ (const Matrix3D &A) const |
| Matrix addition. More... | |
| Matrix3D | operator- (const Matrix3D &A) const |
| Matrix subtraction. More... | |
| Matrix3D | operator+ (Mdouble a) const |
| Scalar addition. More... | |
| Matrix3D | operator- (Mdouble a) const |
| Scalar subtraction. More... | |
| Matrix3D | operator* (Mdouble a) const |
| Scalar multiplication. More... | |
| Vec3D | operator* (const Vec3D &a) const |
| Vector multiplication. More... | |
| Matrix3D | operator* (const Matrix3D &a) const |
| Matrix multiplication. More... | |
| Matrix3D | operator/ (Mdouble a) const |
| Scalar division. More... | |
| Matrix3D & | operator+= (const Matrix3D &A) |
| Matrix addition. More... | |
| Matrix3D & | operator-= (const Matrix3D &A) |
| Matrix substraction. More... | |
| Matrix3D & | operator/= (Mdouble a) |
| Scalar division. More... | |
| Vec3D | ldivide (const Vec3D &b) |
| A.ldivide(b) computes the solution x to A*x=b. More... | |
| Matrix3D | getCylindricalTensorField (const Vec3D &p) const |
| Returns the matrix in cylindrical coordinates. More... | |
Static Public Member Functions | |
| static Matrix3D | square (const Matrix3D &A) |
| Calculates the pointwise square. More... | |
| static Matrix3D | sqrt (const Matrix3D &A) |
| Calculates the pointwise square root. More... | |
| static Matrix3D | dyadic (const Vec3D &a, const Vec3D &b) |
| Calculates the dyadic product of a two Vec3D: \(a \otimes b\). More... | |
| static Matrix3D | cross (const Vec3D &a, const Matrix3D &b) |
| 'Special' cross product; CP of vector with each column of a matrix More... | |
| static Matrix3D | inverse (const Matrix3D &A) |
| Computes the inverse of a matrix. More... | |
Public Attributes | |
| Mdouble | XX |
| all nine matrix elements More... | |
| Mdouble | XY |
| Mdouble | XZ |
| Mdouble | YX |
| Mdouble | YY |
| Mdouble | YZ |
| Mdouble | ZX |
| Mdouble | ZY |
| Mdouble | ZZ |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Matrix3D &A) |
| Add elements to ostream. More... | |
| std::istream & | operator>> (std::istream &is, Matrix3D &A) |
| Add elements to istream. More... | |
Implementation of a 3D matrix.
| Matrix3D::Matrix3D | ( | ) |
default constructor
default constructor, which is empty (i.e., only creates the object)
References setZero().
Referenced by cross(), dyadic(), getCylindricalTensorField(), operator*(), operator+(), operator-(), operator/(), sqrt(), and square().
| Matrix3D::Matrix3D | ( | Mdouble | xx, |
| Mdouble | xy, | ||
| Mdouble | xz, | ||
| Mdouble | yx, | ||
| Mdouble | yy, | ||
| Mdouble | yz, | ||
| Mdouble | zx, | ||
| Mdouble | zy, | ||
| Mdouble | zz | ||
| ) |
Alternative constructor, which let you define all elements.
Alternative constructor. Let's you specify ALL 9 elements of the 3x3 matrix.
| [in] | [all] | xx/xy/xz /yx/yy/yz /zx/zy/zz are all nine elements (left-to-right, top-to-bottom) of the 3D matrix. |
| Matrix3D::Matrix3D | ( | const SmallMatrix< 3, 3 > & | matrix | ) |
Alternative constructor, which takes a matrix of the same size.
References matrix(), XX, XY, XZ, YX, YY, YZ, ZX, ZY, and ZZ.
'Special' cross product; CP of vector with each column of a matrix
Returns a matrix, who's columns are the inner product of a given vector with the corresponding columns of a given matrix
| [in] | a | vector |
| [in] | B | matrix |
References a, and Matrix3D().
|
inline |
| Mdouble Matrix3D::deviator | ( | ) | const |
Deviator.
Returns an invariant of the deviatoric tensor, scaled such that it is equal to shear stress for the stress tensor.
References Global_Physical_Variables::P, sqrt(), mathsFunc::square(), trace(), XX, XY, XZ, YX, YY, YZ, ZX, ZY, and ZZ.
| Vec3D Matrix3D::diag | ( | ) | const |
Calculates the dyadic product of a two Vec3D: \(a \otimes b\).
Dyadic product of two vectors
| [in] | a | first vector |
| [in] | b | second vector |
References a, b, and Matrix3D().
Referenced by CGFields::GradVelocityField::addParticleDifferentialStatistics(), DPMBase::getKineticStress(), DPMBase::getStaticStress(), main(), CGFields::StandardFields::setFields(), and CGFields::StandardFieldsBinning::setFields().
Returns the matrix in cylindrical coordinates.
Transforms the (Cartesian) vector to cylindrical coordinates. See https://en.wikipedia.org/wiki/Vector_fields_in_cylindrical_and_spherical_coordinates
References calibrate::c, Matrix3D(), p, UniformPSDSelfTest::r, s, sqrt(), XX, XY, XZ, YX, YY, YZ, ZX, ZY, and ZZ.
Referenced by main(), and CGFields::StandardFields::setCylindricalFields().
Computes the inverse of a matrix.
| [in] | A | Matrix that should be inverted. |
A.ldivide(b) computes the solution x to A*x=b.
Solve the linear system Ax = b: A.ldivide(b) computes the solution x to A*x=b.
| [in] | b | Right-handside in Ax = b, as a const-reference to a Vec3D |
Vector multiplication.
Multiplication with vector
| [in] | a | Vector to be multiplied with |
Matrix addition.
Adds all elements of a given matrix to its own
| [in] | A | 3D matrix to be added |
Matrix substraction.
Substract all elements of a given matrix from its own
| [in] | A | 3D matrix to be subtracted |
Scalar division.
Division by a scalar
| [in] | a | scalar to be divided by |
| void Matrix3D::setZero | ( | ) |
Sets all elements to zero.
Sets all elements to zero.
References XX, XY, XZ, YX, YY, YZ, ZX, ZY, and ZZ.
Referenced by CylinderInsertionBoundary::CylinderInsertionBoundary(), Matrix3D(), CGFields::GradVelocityField::setZero(), CGFields::StandardFields::setZero(), and StressStrainControlBoundary::StressStrainControlBoundary().
Calculates the pointwise square root.
Takes the square root of all the elements in given matrix
| [in] | A | Matrix to be pointwise square rooted |
References Matrix3D(), and sqrt().
Calculates the pointwise square.
Squares all the elements in given matrix
| [in] | A | Matrix to be pointwise squared |
References Matrix3D(), and mathsFunc::square().
Referenced by CGFields::GradVelocityField::getSquared(), and CGFields::StandardFields::getSquared().
| Mdouble Matrix3D::trace | ( | ) | const |
|
friend |
Add elements to ostream.
Adds all elements of a matrix to an ostream
| [out] | os | output stream |
| [in] | A | 3D matrix |
|
friend |
| Mdouble Matrix3D::XX |
all nine matrix elements
Referenced by StressStrainControlBoundary::activateStrainRateControl(), StressStrainControlBoundary::checkBoundaryAfterParticlesMove(), StressStrainControlBoundary::computeStrainRate(), StressStrainControlBoundary::computeStressError(), determinant(), deviator(), diag(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e1(), ClumpParticle::getPrincipalDirections_e1(), CylinderInsertionBoundary::getRotationMatrixX(), CylinderInsertionBoundary::getRotationMatrixY(), CylinderInsertionBoundary::getRotationMatrixZ(), inverse(), ldivide(), main(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e1(), setZero(), Packing::test(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), ShapeGradientHessianTester::testSphere(), trace(), and StressStrainControlBoundary::updateDomainSize().
| Mdouble Matrix3D::XY |
Referenced by ShearStage::actionsAfterTimeStep(), StressStrainControlBoundary::activateStrainRateControl(), StressStrainControlBoundary::checkBoundaryAfterParticlesMove(), StressStrainControlBoundary::computeStrainRate(), determinant(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e2(), ClumpParticle::getPrincipalDirections_e2(), CylinderInsertionBoundary::getRotationMatrixZ(), inverse(), ldivide(), main(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), ShearStage::printTime(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e2(), setZero(), and ShapeGradientHessianTester::testCushion().
| Mdouble Matrix3D::XZ |
Referenced by determinant(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e3(), ClumpParticle::getPrincipalDirections_e3(), CylinderInsertionBoundary::getRotationMatrixY(), inverse(), ldivide(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e3(), and setZero().
| Mdouble Matrix3D::YX |
Referenced by determinant(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e1(), ClumpParticle::getPrincipalDirections_e1(), CylinderInsertionBoundary::getRotationMatrixZ(), inverse(), ldivide(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), ClumpParticle::setPrincipalDirections_e1(), setZero(), and ShapeGradientHessianTester::testCushion().
| Mdouble Matrix3D::YY |
Referenced by ShearStage::actionsAfterTimeStep(), StressStrainControlBoundary::activateStrainRateControl(), StressStrainControlBoundary::checkBoundaryAfterParticlesMove(), StressStrainControlBoundary::computeStrainRate(), determinant(), deviator(), diag(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e2(), ClumpParticle::getPrincipalDirections_e2(), CylinderInsertionBoundary::getRotationMatrixX(), CylinderInsertionBoundary::getRotationMatrixY(), CylinderInsertionBoundary::getRotationMatrixZ(), inverse(), ldivide(), main(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), ShearStage::printTime(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e2(), setZero(), Packing::test(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), ShapeGradientHessianTester::testSphere(), trace(), and StressStrainControlBoundary::updateDomainSize().
| Mdouble Matrix3D::YZ |
Referenced by determinant(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e3(), ClumpParticle::getPrincipalDirections_e3(), CylinderInsertionBoundary::getRotationMatrixX(), inverse(), ldivide(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e3(), and setZero().
| Mdouble Matrix3D::ZX |
Referenced by determinant(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e1(), ClumpParticle::getPrincipalDirections_e1(), CylinderInsertionBoundary::getRotationMatrixY(), inverse(), ldivide(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e1(), and setZero().
| Mdouble Matrix3D::ZY |
Referenced by determinant(), deviator(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e2(), ClumpParticle::getPrincipalDirections_e2(), CylinderInsertionBoundary::getRotationMatrixX(), inverse(), ldivide(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e2(), and setZero().
| Mdouble Matrix3D::ZZ |
Referenced by StressStrainControlBoundary::activateStrainRateControl(), StressStrainControlBoundary::checkBoundaryAfterParticlesMove(), StressStrainControlBoundary::computeStrainRate(), determinant(), deviator(), diag(), getCylindricalTensorField(), ClumpParticle::getInitPrincipalDirections_e3(), ClumpParticle::getPrincipalDirections_e3(), CylinderInsertionBoundary::getRotationMatrixX(), CylinderInsertionBoundary::getRotationMatrixY(), CylinderInsertionBoundary::getRotationMatrixZ(), inverse(), ldivide(), main(), Matrix3D(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), StressStrainControlBoundary::set(), ClumpParticle::setPrincipalDirections_e3(), setZero(), Packing::test(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), ShapeGradientHessianTester::testSphere(), trace(), and StressStrainControlBoundary::updateDomainSize().