use of maspack.matrix.Matrix6x1 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));
}
}
}
}
Aggregations