use of maspack.matrix.SymmetricMatrix3d in project artisynth_core by artisynth.
the class OgdenMaterial method computeStress.
public void computeStress(SymmetricMatrix3d sigma, SolidDeformation def, Matrix3d Q, FemMaterial baseMat) {
double J = def.getDetF();
double avgp = def.getAveragePressure();
sigma.setZero();
// Calculate Deviatoric left Cauchy-Green tensor
def.computeDevLeftCauchyGreen(myB);
Vector3d principalStretch = new Vector3d();
Vector3d principalStretch2 = new Vector3d();
Matrix3d principalDirection = new Matrix3d();
// Calculate principal stretches and principal directions
myB.getEigenValues(principalStretch2, principalDirection);
for (int i = 0; i < 3; i++) {
principalStretch.set(i, Math.sqrt(principalStretch2.get(i)));
}
// Calculate principal stresses
for (int i = 0; i < 3; i++) {
for (int n = 0; n < Nmax; n++) {
if (myMu[n] != 0) {
sigma.set(i, i, sigma.get(i, i) + myMu[n] / myAlpha[n] / J * (Math.pow(principalStretch.get(i), myAlpha[n])));
}
}
}
// Calculate stress tensor from principal stresses and directions
sigma.mulLeftAndTransposeRight(principalDirection);
sigma.deviator();
sigma.m00 += avgp;
sigma.m11 += avgp;
sigma.m22 += avgp;
}
use of maspack.matrix.SymmetricMatrix3d 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.SymmetricMatrix3d 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);
}
}
Aggregations