Search in sources :

Example 1 with SVDecomposition

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());
    }
}
Also used : MatrixNd(maspack.matrix.MatrixNd) SVDecomposition(maspack.matrix.SVDecomposition)

Example 2 with SVDecomposition

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();
}
Also used : SVDecomposition(maspack.matrix.SVDecomposition)

Example 3 with SVDecomposition

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);
// }
}
Also used : Matrix6d(maspack.matrix.Matrix6d) SVDecomposition(maspack.matrix.SVDecomposition)

Aggregations

SVDecomposition (maspack.matrix.SVDecomposition)3 Matrix6d (maspack.matrix.Matrix6d)1 MatrixNd (maspack.matrix.MatrixNd)1