Search in sources :

Example 36 with SymmetricMatrix3d

use of maspack.matrix.SymmetricMatrix3d in project artisynth_core by artisynth.

the class OgdenMaterial method computeStress.

public void computeStress(SymmetricMatrix3d sigma, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
    double J = def.getDetF();
    double avgp = def.getAveragePressure();
    sigma.setZero();
    // Calculate Deviatoric left Cauchy-Green tensor
    def.computeDevLeftCauchyGreen(myB);
    Vector3d principalStretch = new Vector3d();
    Vector3d principalStretch2 = new Vector3d();
    Matrix3d principalDirection = new Matrix3d();
    // Calculate principal stretches and principal directions
    myB.getEigenValues(principalStretch2, principalDirection);
    for (int i = 0; i < 3; i++) {
        principalStretch.set(i, Math.sqrt(principalStretch2.get(i)));
    }
    // Calculate principal stresses
    for (int i = 0; i < 3; i++) {
        for (int n = 0; n < Nmax; n++) {
            if (myMu[n] != 0) {
                sigma.set(i, i, sigma.get(i, i) + myMu[n] / myAlpha[n] / J * (Math.pow(principalStretch.get(i), myAlpha[n])));
            }
        }
    }
    // Calculate stress tensor from principal stresses and directions
    sigma.mulLeftAndTransposeRight(principalDirection);
    sigma.deviator();
    sigma.m00 += avgp;
    sigma.m11 += avgp;
    sigma.m22 += avgp;
}
Also used : SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) Matrix3d(maspack.matrix.Matrix3d) Vector3d(maspack.matrix.Vector3d)

Example 37 with SymmetricMatrix3d

use of maspack.matrix.SymmetricMatrix3d in project artisynth_core by artisynth.

the class LinearMaterialBase method computeTangent.

@Override
public void computeTangent(Matrix6d D, SymmetricMatrix3d stress, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
    // get spatial stiffness tensor
    getC(D);
    // rotate if corotated
    if (isCorotated()) {
        // need to rotate this tensor from linear frame into material one
        RotationMatrix3d R = def.getR();
        if (R == null) {
            Matrix3d F = def.getF();
            R = computeRotation(F, null);
        }
        // R rotates from material frame to the spatial one. Transpose
        // of R rotates from spatial frame to material one.
        TensorUtils.unrotateTangent(D, D, R);
    }
}
Also used : SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) RotationMatrix3d(maspack.matrix.RotationMatrix3d) Matrix3d(maspack.matrix.Matrix3d) RotationMatrix3d(maspack.matrix.RotationMatrix3d)

Example 38 with SymmetricMatrix3d

use of maspack.matrix.SymmetricMatrix3d in project artisynth_core by artisynth.

the class LinearMaterialBase method computeStress.

public void computeStress(SymmetricMatrix3d sigma, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
    RotationMatrix3d R = def.getR();
    Matrix3d F = def.getF();
    // cauchy strain, rotated if necessary
    if (myCorotated) {
        if (R == null) {
            R = computeRotation(F, sigma);
        } else {
            // remove rotation from F
            sigma.mulTransposeLeftSymmetric(R, F);
        }
    } else {
        sigma.setSymmetric(F);
    }
    sigma.m00 -= 1;
    sigma.m11 -= 1;
    sigma.m22 -= 1;
    multiplyC(sigma, sigma);
    // rotate stress back to original frame
    if (isCorotated()) {
        sigma.mulLeftAndTransposeRight(R);
    }
}
Also used : SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) RotationMatrix3d(maspack.matrix.RotationMatrix3d) Matrix3d(maspack.matrix.Matrix3d) RotationMatrix3d(maspack.matrix.RotationMatrix3d)

Aggregations

SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)38 Matrix3d (maspack.matrix.Matrix3d)21 Vector3d (maspack.matrix.Vector3d)13 Matrix6d (maspack.matrix.Matrix6d)11 RotationMatrix3d (maspack.matrix.RotationMatrix3d)11 Point3d (maspack.matrix.Point3d)6 VectorNd (maspack.matrix.VectorNd)3 FemMaterial (artisynth.core.materials.FemMaterial)2 Point (artisynth.core.mechmodels.Point)2 MatrixNd (maspack.matrix.MatrixNd)2 RigidTransform3d (maspack.matrix.RigidTransform3d)2 IncompressibleMaterial (artisynth.core.materials.IncompressibleMaterial)1 SolidDeformation (artisynth.core.materials.SolidDeformation)1 ViscoelasticBehavior (artisynth.core.materials.ViscoelasticBehavior)1 ViscoelasticState (artisynth.core.materials.ViscoelasticState)1 StringReader (java.io.StringReader)1 CholeskyDecomposition (maspack.matrix.CholeskyDecomposition)1 Matrix3x6Block (maspack.matrix.Matrix3x6Block)1 Matrix6x3Block (maspack.matrix.Matrix6x3Block)1 MatrixBlock (maspack.matrix.MatrixBlock)1