Search in sources :

Example 1 with Matrix1x1Block

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

PlanarConnector (artisynth.core.mechmodels.PlanarConnector)1 SphericalJointBase (artisynth.core.mechmodels.SphericalJointBase)1 Matrix1x1Block (maspack.matrix.Matrix1x1Block)1 Matrix3x3DiagBlock (maspack.matrix.Matrix3x3DiagBlock)1 MatrixBlock (maspack.matrix.MatrixBlock)1