Search in sources :

Example 11 with VectorNd

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

the class RectangleField method rectangleToVector.

private static VectorNd rectangleToVector(Rectangle2d rect) {
    VectorNd vec = new VectorNd(4);
    vec.set(0, rect.x);
    vec.set(1, rect.y);
    vec.set(2, rect.width);
    vec.set(3, rect.height);
    return vec;
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 12 with VectorNd

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

the class VariableVectorField method setVectorSize.

/**
 * Sets the size of the vector associated with this vector field. Changing
 * the vector size will cause the result holder to be cleared, and the
 * current vector value to be reset to a zero vector of the indicated size.
 * The number of columns in the field will also be reset.
 *
 * @param size
 * new vector size
 */
public void setVectorSize(int size) {
    if (size < 0) {
        size = 0;
    }
    if (size != myVectorSize) {
        setColumns(5 * size);
        myResultHolder = null;
        myVectorSize = size;
        setValue(new VectorNd(size));
    }
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 13 with VectorNd

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

the class VectorMultiField method textToValue.

@Override
public Object textToValue(String[] text, boolean[] corrected, StringHolder errMsg) {
    VectorNd tmp = new VectorNd(myVectorSize);
    try {
        for (int i = 0; i < myVectorSize; i++) {
            if (LabeledTextField.isBlank(text[i])) {
                return setVoidIfPossible(errMsg);
            }
            double val = parseDouble(text[i], i);
            corrected[i] = false;
            tmp.set(i, val);
        }
    } catch (Exception e) {
        return illegalValue(e.getMessage(), errMsg);
    }
    return validValue(tmp, errMsg);
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 14 with VectorNd

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

the class SymmetricMatrix3dField method matrixToVector.

private static VectorNd matrixToVector(SymmetricMatrix3d M) {
    VectorNd vec = new VectorNd(6);
    vec.set(0, M.m00);
    vec.set(1, M.m11);
    vec.set(2, M.m22);
    vec.set(3, M.m01);
    vec.set(4, M.m02);
    vec.set(5, M.m12);
    return vec;
}
Also used : VectorNd(maspack.matrix.VectorNd)

Example 15 with VectorNd

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

the class FemModel3d method configureHardIncomp.

private void configureHardIncomp() {
    if (!hasActiveNodes()) {
        return;
    }
    IncompMethod method = getHardIncompMethod();
    if (method == IncompMethod.NODAL) {
        configureHardNodalIncomp();
    } else if (method == IncompMethod.ELEMENT) {
        configureHardElementIncomp();
    } else {
        throw new IllegalArgumentException("unsupported hard incompressibility method " + method);
    }
    myDg = new VectorNd(myNumIncompressConstraints);
    myHardIncompConfigValidP = true;
// myHardIncompConstraintsChangedP = true;
}
Also used : VectorNd(maspack.matrix.VectorNd)

Aggregations

VectorNd (maspack.matrix.VectorNd)136 Point (artisynth.core.mechmodels.Point)29 Point3d (maspack.matrix.Point3d)16 Vector3d (maspack.matrix.Vector3d)15 PointParticleAttachment (artisynth.core.mechmodels.PointParticleAttachment)11 ArrayList (java.util.ArrayList)11 ContactPoint (artisynth.core.mechmodels.ContactPoint)9 MatrixNd (maspack.matrix.MatrixNd)9 Vertex3d (maspack.geometry.Vertex3d)8 SparseMatrixNd (maspack.matrix.SparseMatrixNd)8 IntegrationPoint3d (artisynth.core.femmodels.IntegrationPoint3d)7 PointAttachment (artisynth.core.mechmodels.PointAttachment)7 PointFem3dAttachment (artisynth.core.femmodels.PointFem3dAttachment)6 FemNode (artisynth.core.femmodels.FemNode)5 PolygonalMesh (maspack.geometry.PolygonalMesh)5 ReaderTokenizer (maspack.util.ReaderTokenizer)5 FemNode3d (artisynth.core.femmodels.FemNode3d)4 IntegrationData3d (artisynth.core.femmodels.IntegrationData3d)4 StringReader (java.io.StringReader)4 HashMap (java.util.HashMap)4