Search in sources :

Example 16 with MatrixBlock

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

the class ForceTarget method addForceJacobian.

public int addForceJacobian(SparseBlockMatrix J, int bi, int solve_index) {
    MatrixBlock blk = null;
    if (myConnector instanceof PlanarConnector) {
        blk = new Matrix1x1Block();
        blk.set(0, 0, 1d);
        J.addBlock(bi, solve_index, blk);
    } else if (myConnector instanceof SphericalJointBase) {
        blk = new Matrix3x3DiagBlock(1d, 1d, 1d);
        J.addBlock(bi, solve_index, blk);
    } else {
        System.err.println("ForceTarget.addForceJacobian: unsupported connector type: " + myConnector.getClass());
    }
    return bi++;
}
Also used : Matrix3x3DiagBlock(maspack.matrix.Matrix3x3DiagBlock) MatrixBlock(maspack.matrix.MatrixBlock) SphericalJointBase(artisynth.core.mechmodels.SphericalJointBase) PlanarConnector(artisynth.core.mechmodels.PlanarConnector) Matrix1x1Block(maspack.matrix.Matrix1x1Block)

Aggregations

MatrixBlock (maspack.matrix.MatrixBlock)16 Vector3d (maspack.matrix.Vector3d)5 Point (artisynth.core.mechmodels.Point)4 Matrix3x3Block (maspack.matrix.Matrix3x3Block)2 VectorNd (maspack.matrix.VectorNd)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 PlanarConnector (artisynth.core.mechmodels.PlanarConnector)1 SphericalJointBase (artisynth.core.mechmodels.SphericalJointBase)1 IOException (java.io.IOException)1 Matrix1x1Block (maspack.matrix.Matrix1x1Block)1 Matrix3d (maspack.matrix.Matrix3d)1 Matrix3dBase (maspack.matrix.Matrix3dBase)1 Matrix3x1 (maspack.matrix.Matrix3x1)1 Matrix3x3DiagBlock (maspack.matrix.Matrix3x3DiagBlock)1 Matrix6d (maspack.matrix.Matrix6d)1 Matrix6dBlock (maspack.matrix.Matrix6dBlock)1 RotationMatrix3d (maspack.matrix.RotationMatrix3d)1