use of maspack.matrix.SVDecomposition in project artisynth_core by artisynth.
the class MLSShapeFunction method update.
@Override
public void update(Point3d pnt, MFreeNode3d[] nodes) {
this.myPnt.set(pnt);
this.myNodes = nodes;
if (M == null) {
M = new MatrixNd(nBasis, nBasis);
}
if (Minv == null) {
Minv = new MatrixNd(nBasis, nBasis);
}
computeM(M, pnt, nodes);
SVDecomposition svd = new SVDecomposition(M);
svd.pseudoInverse(Minv);
if (svd.condition() > 1e10) {
System.out.println("Warning: poor condition number, " + svd.condition());
}
}
use of maspack.matrix.SVDecomposition in project artisynth_core by artisynth.
the class MLSShapeFunction method computeMInv.
public double computeMInv(MatrixNd MInv, Point3d pnt, MFreeNode3d[] nodeList) {
computeM(MInv, pnt, nodeList);
SVDecomposition svd = new SVDecomposition(MInv);
svd.pseudoInverse(MInv);
if (svd.condition() > 1e10) {
System.out.println("Warning: poor condition number, " + svd.condition());
}
return svd.condition();
}
use of maspack.matrix.SVDecomposition in project artisynth_core by artisynth.
the class TransverseLinearMaterial method updateStiffnessTensor.
protected void updateStiffnessTensor() {
Matrix6d invC = new Matrix6d();
invC.m00 = 1.0 / myE.x;
invC.m01 = -myNu.x / myE.x;
invC.m02 = -myNu.y / myE.y;
invC.m10 = invC.m01;
invC.m11 = invC.m00;
invC.m12 = invC.m02;
invC.m20 = invC.m02;
invC.m21 = invC.m20;
invC.m22 = 1.0 / myE.y;
invC.m33 = 2 * (1 + myNu.x) / myE.x;
invC.m44 = 1.0 / myG;
invC.m55 = invC.m44;
SVDecomposition svd = new SVDecomposition(invC);
if (myC == null) {
myC = new Matrix6d();
}
svd.pseudoInverse(myC);
// Matrix6d C = AnisotropicLinearMaterial.createIsotropicStiffness((myE.x + myE.y)/2, (myNu.x + myNu.y)/2);
// Matrix6d Cinv = new Matrix6d();
// svd.factor(C);
// svd.pseudoInverse(Cinv);
//
// if (!C.epsilonEquals(myC, 1e-6)) {
// System.out.println("Hmm...");
// System.out.println(C);
// System.out.println(" vs ");
// System.out.println(myC);
// }
}
Aggregations