Fix the bug of calculating principal stresses. Now the fitting result is better for the criteria which expressed in principal stresses.

Thanks to Martin.
This commit is contained in:
Haiming Zhang 2015-02-02 16:52:28 +00:00
parent 16cee5e3ee
commit fd75772a3f
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ def principalStresses(sigmas):
for i in xrange(np.shape(sigmas)[1]):
eigenvalues = np.linalg.eigvalsh(np.array(sigmas[:,i]).reshape(3,3))
lambdas = np.append(lambdas,np.sort(eigenvalues)[::-1]) #append eigenvalues in descending order
lambdas = lambdas.reshape(3,np.shape(sigmas)[1])
lambdas = np.transpose( lambdas.reshape(np.shape(sigmas)[1],3) )
return lambdas
def stressInvariants(lambdas):