Skip to content

Instantly share code, notes, and snippets.

@sherbondy
Created May 15, 2013 21:15
Show Gist options
  • Save sherbondy/5587460 to your computer and use it in GitHub Desktop.
Save sherbondy/5587460 to your computer and use it in GitHub Desktop.
// From ElementADPK2:
virtual void computeSecondPiolaKirchhoff(Vec3DiffMatrix3x3 &matS, const Vec3DiffMatrix3x3 &matF, const MaterialParams &matParams) const {
//*****************ASSIGNMENT 4 START HERE ***********************
//Compute Strain
// Vec3DiffMatrix3x3 matE =
//Compute Second Piola Kirchoff Stress (S)
// matS =
// matF is the deformation matrix
Vec3DiffMatrix3x3 matE = 0.5 * matF.transposed() * matF - Vec3DiffMatrix3x3::id();
//Vec3DiffMatrix3x3 matE = 0.5 * (matF.transposed() + matF) - Vec3DiffMatrix3x3::id();
matS = matParams.getLambda() * matE.trace() * Vec3DiffMatrix3x3::id() + 2 * matParams.getMu() * matE;
//*****************ASSIGNMENT 4 END HERE **************************
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment