use of maspack.matrix.Matrix6d in project artisynth_core by artisynth.
the class BlemkerMuscle method main.
public static void main(String[] args) {
BlemkerMuscle mat = new BlemkerMuscle();
SolidDeformation def = new SolidDeformation();
def.setF(new Matrix3d(1, 3, 5, 2, 1, 4, 6, 1, 2));
Matrix6d D = new Matrix6d();
SymmetricMatrix3d sig = new SymmetricMatrix3d();
FemMaterial baseMat = new MooneyRivlinMaterial();
Vector3d a = new Vector3d(1, 0, 0);
// a.setRandom();
mat.computeStress(sig, 1.0, a, def, baseMat);
// def.setStress (sig);
mat.computeTangent(D, sig, 1.0, a, def, baseMat);
System.out.println("sig=\n" + sig.toString("%12.6f"));
System.out.println("D=\n" + D.toString("%12.6f"));
}
use of maspack.matrix.Matrix6d in project artisynth_core by artisynth.
the class BeamBody method computeStiffnessFromIntegration.
public void computeStiffnessFromIntegration() {
int numc = numElasticCoords();
Matrix6d D = new Matrix6d();
Matrix3d DS = new Matrix3d();
Matrix6x1 Bi = new Matrix6x1();
Matrix6x1 Bj = new Matrix6x1();
Matrix6x1 Bx = new Matrix6x1();
myStiffnessMatrix.setZero();
for (int k = 0; k < myIntegrationPoints.length; k++) {
SolidDeformation def = new SolidDeformation();
IntegrationPoint3d pt = myIntegrationPoints[k];
IntegrationData3d dt = new IntegrationData3d();
pt.setF(Matrix3d.IDENTITY);
def.setF(Matrix3d.IDENTITY);
// get the tangent at the rest position
Matrix3d Q = Matrix3d.IDENTITY;
// myMaterial.computeTangent (D, pt.getStress(), pt, dt, null);
myMaterial.computeTangent(D, SymmetricMatrix3d.ZERO, def, Q, null);
double dl = (myLen / 2) * pt.getWeight();
for (int i = 0; i < numc; i++) {
getDShape(DS, i, pt.getCoords());
computeBFromDShape(Bi, DS);
for (int j = 0; j < numc; j++) {
getDShape(DS, j, pt.getCoords());
computeBFromDShape(Bj, DS);
Bx.mul(D, Bj);
myStiffnessMatrix.add(i, j, dl * Bi.dot(Bx));
}
}
}
}
use of maspack.matrix.Matrix6d 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