Search in sources :

Example 21 with Matrix6d

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

the class BlemkerMuscle method main.

public static void main(String[] args) {
    BlemkerMuscle mat = new BlemkerMuscle();
    SolidDeformation def = new SolidDeformation();
    def.setF(new Matrix3d(1, 3, 5, 2, 1, 4, 6, 1, 2));
    Matrix6d D = new Matrix6d();
    SymmetricMatrix3d sig = new SymmetricMatrix3d();
    FemMaterial baseMat = new MooneyRivlinMaterial();
    Vector3d a = new Vector3d(1, 0, 0);
    // a.setRandom();
    mat.computeStress(sig, 1.0, a, def, baseMat);
    // def.setStress (sig);
    mat.computeTangent(D, sig, 1.0, a, def, baseMat);
    System.out.println("sig=\n" + sig.toString("%12.6f"));
    System.out.println("D=\n" + D.toString("%12.6f"));
}
Also used : SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) Matrix3d(maspack.matrix.Matrix3d) Vector3d(maspack.matrix.Vector3d) SymmetricMatrix3d(maspack.matrix.SymmetricMatrix3d) Matrix6d(maspack.matrix.Matrix6d)

Example 22 with Matrix6d

use of maspack.matrix.Matrix6d 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 23 with Matrix6d

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

the class TransverseLinearMaterial method updateStiffnessTensor.

protected void updateStiffnessTensor() {
    Matrix6d invC = new Matrix6d();
    invC.m00 = 1.0 / myE.x;
    invC.m01 = -myNu.x / myE.x;
    invC.m02 = -myNu.y / myE.y;
    invC.m10 = invC.m01;
    invC.m11 = invC.m00;
    invC.m12 = invC.m02;
    invC.m20 = invC.m02;
    invC.m21 = invC.m20;
    invC.m22 = 1.0 / myE.y;
    invC.m33 = 2 * (1 + myNu.x) / myE.x;
    invC.m44 = 1.0 / myG;
    invC.m55 = invC.m44;
    SVDecomposition svd = new SVDecomposition(invC);
    if (myC == null) {
        myC = new Matrix6d();
    }
    svd.pseudoInverse(myC);
// Matrix6d C = AnisotropicLinearMaterial.createIsotropicStiffness((myE.x + myE.y)/2, (myNu.x + myNu.y)/2);
// Matrix6d Cinv = new Matrix6d();
// svd.factor(C);
// svd.pseudoInverse(Cinv);
// 
// if (!C.epsilonEquals(myC, 1e-6)) {
// System.out.println("Hmm...");
// System.out.println(C);
// System.out.println(" vs ");
// System.out.println(myC);
// }
}
Also used : Matrix6d(maspack.matrix.Matrix6d) SVDecomposition(maspack.matrix.SVDecomposition)

Aggregations

Matrix6d (maspack.matrix.Matrix6d)23 Matrix3d (maspack.matrix.Matrix3d)15 SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)13 Vector3d (maspack.matrix.Vector3d)8 RotationMatrix3d (maspack.matrix.RotationMatrix3d)7 SolidDeformation (artisynth.core.materials.SolidDeformation)4 RigidTransform3d (maspack.matrix.RigidTransform3d)3 FrameMaterial (artisynth.core.materials.FrameMaterial)2 RotAxisFrameMaterial (artisynth.core.materials.RotAxisFrameMaterial)2 Point (artisynth.core.mechmodels.Point)2 Matrix6dBlock (maspack.matrix.Matrix6dBlock)2 VectorNd (maspack.matrix.VectorNd)2 IntegrationData3d (artisynth.core.femmodels.IntegrationData3d)1 IntegrationPoint3d (artisynth.core.femmodels.IntegrationPoint3d)1 FemMaterial (artisynth.core.materials.FemMaterial)1 IncompressibleMaterial (artisynth.core.materials.IncompressibleMaterial)1 ViscoelasticBehavior (artisynth.core.materials.ViscoelasticBehavior)1 ViscoelasticState (artisynth.core.materials.ViscoelasticState)1 StringReader (java.io.StringReader)1 CholeskyDecomposition (maspack.matrix.CholeskyDecomposition)1