Search in sources :

Example 61 with Matrix3d

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

the class BeamBody method computeStiffnessFromIntegration.

public void computeStiffnessFromIntegration() {
    int numc = numElasticCoords();
    Matrix6d D = new Matrix6d();
    Matrix3d DS = new Matrix3d();
    Matrix6x1 Bi = new Matrix6x1();
    Matrix6x1 Bj = new Matrix6x1();
    Matrix6x1 Bx = new Matrix6x1();
    myStiffnessMatrix.setZero();
    for (int k = 0; k < myIntegrationPoints.length; k++) {
        SolidDeformation def = new SolidDeformation();
        IntegrationPoint3d pt = myIntegrationPoints[k];
        IntegrationData3d dt = new IntegrationData3d();
        pt.setF(Matrix3d.IDENTITY);
        def.setF(Matrix3d.IDENTITY);
        // get the tangent at the rest position
        Matrix3d Q = Matrix3d.IDENTITY;
        // myMaterial.computeTangent (D, pt.getStress(), pt, dt, null);
        myMaterial.computeTangent(D, SymmetricMatrix3d.ZERO, def, Q, null);
        double dl = (myLen / 2) * pt.getWeight();
        for (int i = 0; i < numc; i++) {
            getDShape(DS, i, pt.getCoords());
            computeBFromDShape(Bi, DS);
            for (int j = 0; j < numc; j++) {
                getDShape(DS, j, pt.getCoords());
                computeBFromDShape(Bj, DS);
                Bx.mul(D, Bj);
                myStiffnessMatrix.add(i, j, dl * Bi.dot(Bx));
            }
        }
    }
}
Also used : SolidDeformation(artisynth.core.materials.SolidDeformation) SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) Matrix3d(maspack.matrix.Matrix3d) IntegrationPoint3d(artisynth.core.femmodels.IntegrationPoint3d) IntegrationData3d(artisynth.core.femmodels.IntegrationData3d) Matrix6d(maspack.matrix.Matrix6d) Matrix6x1(maspack.matrix.Matrix6x1)

Example 62 with Matrix3d

use of maspack.matrix.Matrix3d 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 63 with Matrix3d

use of maspack.matrix.Matrix3d 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)

Example 64 with Matrix3d

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

the class SimpleForceMuscle method clone.

public SimpleForceMuscle clone() {
    SimpleForceMuscle mat = (SimpleForceMuscle) super.clone();
    mat.myTmp = new Vector3d();
    mat.myMat = new Matrix3d();
    return mat;
}
Also used : SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) Matrix3d(maspack.matrix.Matrix3d) Vector3d(maspack.matrix.Vector3d)

Aggregations

Matrix3d (maspack.matrix.Matrix3d)64 SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)42 Vector3d (maspack.matrix.Vector3d)32 RotationMatrix3d (maspack.matrix.RotationMatrix3d)22 Matrix6d (maspack.matrix.Matrix6d)15 Point3d (maspack.matrix.Point3d)9 RigidTransform3d (maspack.matrix.RigidTransform3d)7 SVDecomposition3d (maspack.matrix.SVDecomposition3d)7 IntegrationData3d (artisynth.core.femmodels.IntegrationData3d)6 AffineTransform3d (maspack.matrix.AffineTransform3d)4 VectorNd (maspack.matrix.VectorNd)4 IntegrationPoint3d (artisynth.core.femmodels.IntegrationPoint3d)3 SolidDeformation (artisynth.core.materials.SolidDeformation)3 FemMaterial (artisynth.core.materials.FemMaterial)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 BVNode (maspack.geometry.BVNode)2 BVTree (maspack.geometry.BVTree)2 Boundable (maspack.geometry.Boundable)2 LineSegment (maspack.geometry.LineSegment)2