Search in sources :

Example 1 with Matrix6x1

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

Aggregations

IntegrationData3d (artisynth.core.femmodels.IntegrationData3d)1 IntegrationPoint3d (artisynth.core.femmodels.IntegrationPoint3d)1 SolidDeformation (artisynth.core.materials.SolidDeformation)1 Matrix3d (maspack.matrix.Matrix3d)1 Matrix6d (maspack.matrix.Matrix6d)1 Matrix6x1 (maspack.matrix.Matrix6x1)1 SymmetricMatrix3d (maspack.matrix.SymmetricMatrix3d)1