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;
}
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));
}
}
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);
}
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;
}
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;
}
Aggregations