use of maspack.matrix.Matrix3d 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.Matrix3d in project artisynth_core by artisynth.
the class LinearMaterialBase method computeTangent.
@Override
public void computeTangent(Matrix6d D, SymmetricMatrix3d stress, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
// get spatial stiffness tensor
getC(D);
// rotate if corotated
if (isCorotated()) {
// need to rotate this tensor from linear frame into material one
RotationMatrix3d R = def.getR();
if (R == null) {
Matrix3d F = def.getF();
R = computeRotation(F, null);
}
// R rotates from material frame to the spatial one. Transpose
// of R rotates from spatial frame to material one.
TensorUtils.unrotateTangent(D, D, R);
}
}
use of maspack.matrix.Matrix3d in project artisynth_core by artisynth.
the class LinearMaterialBase method computeStress.
public void computeStress(SymmetricMatrix3d sigma, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
RotationMatrix3d R = def.getR();
Matrix3d F = def.getF();
// cauchy strain, rotated if necessary
if (myCorotated) {
if (R == null) {
R = computeRotation(F, sigma);
} else {
// remove rotation from F
sigma.mulTransposeLeftSymmetric(R, F);
}
} else {
sigma.setSymmetric(F);
}
sigma.m00 -= 1;
sigma.m11 -= 1;
sigma.m22 -= 1;
multiplyC(sigma, sigma);
// rotate stress back to original frame
if (isCorotated()) {
sigma.mulLeftAndTransposeRight(R);
}
}
use of maspack.matrix.Matrix3d in project artisynth_core by artisynth.
the class SimpleForceMuscle method clone.
public SimpleForceMuscle clone() {
SimpleForceMuscle mat = (SimpleForceMuscle) super.clone();
mat.myTmp = new Vector3d();
mat.myMat = new Matrix3d();
return mat;
}
Aggregations