Search in sources :

Example 1 with Matrix3x3DiagBlock

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

the class PointFem3dAttachment method addTargetJacobian.

public int addTargetJacobian(SparseBlockMatrix J, int bi) {
    for (int i = 0; i < myNodes.length; i++) {
        double c = myCoords.get(i);
        Matrix3x3DiagBlock blk = new Matrix3x3DiagBlock();
        blk.set(c, c, c);
        if (myNodes[i].getSolveIndex() != -1)
            J.addBlock(bi, myNodes[i].getSolveIndex(), blk);
    }
    return bi++;
}
Also used : Matrix3x3DiagBlock(maspack.matrix.Matrix3x3DiagBlock) Point(artisynth.core.mechmodels.Point)

Example 2 with Matrix3x3DiagBlock

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

the class Point method addTargetJacobian.

/**
 * {@inheritDoc}
 */
public int addTargetJacobian(SparseBlockMatrix J, int bi) {
    if (!isControllable()) {
        throw new IllegalStateException("Target point is not controllable");
    }
    Matrix3x3DiagBlock blk = new Matrix3x3DiagBlock();
    blk.setIdentity();
    J.addBlock(bi, getSolveIndex(), blk);
    return bi++;
}
Also used : Matrix3x3DiagBlock(maspack.matrix.Matrix3x3DiagBlock)

Example 3 with Matrix3x3DiagBlock

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

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