2014-07-02 16:12:51 +05:30
|
|
|
|
#!/usr/bin/python
|
|
|
|
|
# -*- coding: UTF-8 no BOM -*-
|
|
|
|
|
|
2014-07-23 03:29:58 +05:30
|
|
|
|
import threading,time,os,subprocess,shlex,string
|
2014-07-02 16:12:51 +05:30
|
|
|
|
import numpy as np
|
|
|
|
|
from scipy.optimize import curve_fit
|
|
|
|
|
from scipy.linalg import svd
|
2014-07-09 15:01:26 +05:30
|
|
|
|
from optparse import OptionParser
|
2014-07-23 03:29:58 +05:30
|
|
|
|
import damask
|
2015-02-06 19:31:04 +05:30
|
|
|
|
from damask.util import curve_fit_bound
|
2014-07-09 15:01:26 +05:30
|
|
|
|
|
2014-10-03 02:57:03 +05:30
|
|
|
|
scriptID = string.replace('$Id$','\n','\\n')
|
|
|
|
|
scriptName = scriptID.split()[1][:-3]
|
2014-07-07 19:47:44 +05:30
|
|
|
|
|
2014-10-03 02:57:03 +05:30
|
|
|
|
def execute(cmd,streamIn=None,wd='./'):
|
|
|
|
|
'''
|
|
|
|
|
executes a command in given directory and returns stdout and stderr for optional stdin
|
|
|
|
|
'''
|
2014-07-07 19:47:44 +05:30
|
|
|
|
initialPath=os.getcwd()
|
2014-10-03 02:57:03 +05:30
|
|
|
|
os.chdir(wd)
|
|
|
|
|
process = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr = subprocess.PIPE,stdin=subprocess.PIPE)
|
|
|
|
|
if streamIn != None:
|
|
|
|
|
out,error = process.communicate(streamIn.read())
|
|
|
|
|
else:
|
|
|
|
|
out,error = process.communicate()
|
2014-07-07 19:47:44 +05:30
|
|
|
|
os.chdir(initialPath)
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
2014-10-03 02:57:03 +05:30
|
|
|
|
return out,error
|
|
|
|
|
|
|
|
|
|
def principalStresses(sigmas):
|
|
|
|
|
'''
|
|
|
|
|
computes principal stresses (i.e. eigenvalues) for a set of Cauchy stresses.
|
|
|
|
|
sorted in descending order.
|
|
|
|
|
'''
|
|
|
|
|
lambdas=np.zeros(0,'d')
|
2014-10-06 18:17:52 +05:30
|
|
|
|
for i in xrange(np.shape(sigmas)[1]):
|
2015-02-06 19:18:14 +05:30
|
|
|
|
eigenvalues = np.linalg.eigvalsh(sym6to33(sigmas[:,i]))
|
2014-10-03 02:57:03 +05:30
|
|
|
|
lambdas = np.append(lambdas,np.sort(eigenvalues)[::-1]) #append eigenvalues in descending order
|
2015-02-03 17:48:53 +05:30
|
|
|
|
lambdas = np.transpose(lambdas.reshape(np.shape(sigmas)[1],3))
|
2014-10-06 18:17:52 +05:30
|
|
|
|
return lambdas
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
|
|
|
|
def stressInvariants(lambdas):
|
|
|
|
|
'''
|
|
|
|
|
computes stress invariants (i.e. eigenvalues) for a set of principal Cauchy stresses.
|
|
|
|
|
'''
|
|
|
|
|
Is=np.zeros(0,'d')
|
2014-10-06 18:17:52 +05:30
|
|
|
|
for i in xrange(np.shape(lambdas)[1]):
|
|
|
|
|
I = np.array([lambdas[0,i]+lambdas[1,i]+lambdas[2,i],\
|
|
|
|
|
lambdas[0,i]*lambdas[1,i]+lambdas[1,i]*lambdas[2,i]+lambdas[2,i]*lambdas[0,i],\
|
|
|
|
|
lambdas[0,i]*lambdas[1,i]*lambdas[2,i]])
|
2014-10-03 02:57:03 +05:30
|
|
|
|
Is = np.append(Is,I)
|
2014-10-06 18:17:52 +05:30
|
|
|
|
Is = Is.reshape(3,np.shape(lambdas)[1])
|
2014-10-03 02:57:03 +05:30
|
|
|
|
return Is
|
|
|
|
|
|
2015-02-04 22:17:35 +05:30
|
|
|
|
def formatOutput(n, type='%-14.6f'):
|
2015-02-02 23:11:19 +05:30
|
|
|
|
return ''.join([type for i in xrange(n)])
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
2015-02-06 19:18:14 +05:30
|
|
|
|
def sym6to33(sigma6):
|
|
|
|
|
''' Shape the symmetric stress tensor(6,1) into (3,3) '''
|
|
|
|
|
sigma33 = np.empty((3,3))
|
|
|
|
|
sigma33[0,0] = sigma6[0]; sigma33[1,1] = sigma6[1]; sigma33[2,2] = sigma6[2];
|
|
|
|
|
sigma33[0,1] = sigma6[3]; sigma33[1,0] = sigma6[3]
|
|
|
|
|
sigma33[1,2] = sigma6[4]; sigma33[2,1] = sigma6[4]
|
|
|
|
|
sigma33[2,0] = sigma6[5]; sigma33[0,2] = sigma6[5]
|
|
|
|
|
return sigma33
|
|
|
|
|
|
2015-02-04 22:17:35 +05:30
|
|
|
|
def array2tuple(array):
|
|
|
|
|
'''transform numpy.array into tuple'''
|
|
|
|
|
try:
|
|
|
|
|
return tuple(array2tuple(i) for i in array)
|
|
|
|
|
except TypeError:
|
|
|
|
|
return array
|
2015-02-03 17:48:53 +05:30
|
|
|
|
def get_weight(ndim):
|
|
|
|
|
#more to do
|
|
|
|
|
return np.ones(ndim)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
# ---------------------------------------------------------------------------------------------
|
|
|
|
|
# isotropic yield surfaces
|
|
|
|
|
# ---------------------------------------------------------------------------------------------
|
|
|
|
|
|
2014-10-03 14:57:20 +05:30
|
|
|
|
def Tresca(sigmas, sigma0):
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
|
|
|
|
residuum of Tresca yield criterion (eq. 2.26)
|
|
|
|
|
'''
|
|
|
|
|
lambdas = principalStresses(sigmas)
|
2014-10-06 18:17:52 +05:30
|
|
|
|
r = np.amax(np.array([abs(lambdas[2,:]-lambdas[1,:]),\
|
|
|
|
|
abs(lambdas[1,:]-lambdas[0,:]),\
|
|
|
|
|
abs(lambdas[0,:]-lambdas[2,:])]),0) - sigma0
|
2014-10-03 02:57:03 +05:30
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
|
2015-02-03 17:48:53 +05:30
|
|
|
|
def vonMises(sigmas, sigma0):
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
|
|
|
|
residuum of Huber-Mises-Hencky yield criterion (eq. 2.37)
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
return Hosford(sigmas, sigma0, 2.0)
|
|
|
|
|
|
|
|
|
|
|
2014-10-03 14:57:20 +05:30
|
|
|
|
def Drucker(sigmas, sigma0, C_D):
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
2014-10-03 14:57:20 +05:30
|
|
|
|
residuum of Drucker yield criterion (eq. 2.41, F = sigma0)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
|
|
|
|
|
2014-10-03 14:57:20 +05:30
|
|
|
|
return generalDrucker(sigmas, sigma0, C_D, 1.0)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
|
|
|
|
|
2014-10-03 14:57:20 +05:30
|
|
|
|
def generalDrucker(sigmas, sigma0, C_D, p):
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
2014-10-03 14:57:20 +05:30
|
|
|
|
residuum of general Drucker yield criterion (eq. 2.42, F = sigma0)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
2014-10-03 14:57:20 +05:30
|
|
|
|
Is = stressInvariants(principalStresses(sigmas))
|
2014-10-06 18:17:52 +05:30
|
|
|
|
r = (Is[1,:]**(3.0*p)-C_D*Is[2,:]**(2.0*p)) - sigma0
|
2014-10-03 14:57:20 +05:30
|
|
|
|
return r.ravel()
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def Hosford(sigmas, sigma0, a):
|
|
|
|
|
'''
|
|
|
|
|
residuum of Hershey yield criterion (eq. 2.43, Y = sigma0)
|
|
|
|
|
'''
|
|
|
|
|
lambdas = principalStresses(sigmas)
|
2015-02-07 16:37:45 +05:30
|
|
|
|
r = ((abs(lambdas[2,:]-lambdas[1,:]))**a\
|
|
|
|
|
+ (abs(lambdas[1,:]-lambdas[0,:]))**a\
|
|
|
|
|
+ (abs(lambdas[0,:]-lambdas[2,:]))**a) **(1.0/a)\
|
|
|
|
|
-2.0**(1.0/a)*sigma0
|
2014-10-03 02:57:03 +05:30
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
#more to do
|
|
|
|
|
# KarafillisAndBoyce
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------
|
|
|
|
|
# isotropic yield surfaces
|
|
|
|
|
# ---------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
def Hill1948(sigmas, F,G,H,L,M,N):
|
|
|
|
|
'''
|
|
|
|
|
residuum of Hill 1948 quadratic yield criterion (eq. 2.48)
|
|
|
|
|
'''
|
2015-02-06 19:18:14 +05:30
|
|
|
|
r = F*(sigmas[1]-sigmas[2])**2.0\
|
|
|
|
|
+ G*(sigmas[2]-sigmas[0])**2.0\
|
|
|
|
|
+ H*(sigmas[0]-sigmas[1])**2.0\
|
|
|
|
|
+ 2.0*L* sigmas[4]**2.0\
|
|
|
|
|
+ 2.0*M* sigmas[5]**2.0\
|
|
|
|
|
+ 2.0*N* sigmas[3]**2.0\
|
2014-10-03 02:57:03 +05:30
|
|
|
|
- 1.0
|
|
|
|
|
return r.ravel()/2.0
|
|
|
|
|
|
|
|
|
|
#more to do
|
|
|
|
|
# Hill 1979
|
|
|
|
|
|
|
|
|
|
# Hill 1990,1993 need special stresses to fit
|
|
|
|
|
|
|
|
|
|
def generalHosford(sigmas, sigma0, a):
|
|
|
|
|
'''
|
|
|
|
|
residuum of Hershey yield criterion (eq. 2.104, sigma = sigma0)
|
|
|
|
|
'''
|
|
|
|
|
lambdas = principalStresses(sigmas)
|
|
|
|
|
r = np.amax(np.array([F*(abs(lambdas[:,1]-lambdas[:,2]))**a,\
|
|
|
|
|
G*(abs(lambdas[:,2]-lambdas[:,0]))**a,\
|
|
|
|
|
H*(abs(lambdas[:,0]-lambdas[:,1]))**a]),1) - sigma0**a
|
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
|
2015-02-07 16:37:45 +05:30
|
|
|
|
def Barlat1991(sigmas, sigma0, order, a, b, c, f, g, h):
|
2015-02-03 18:24:16 +05:30
|
|
|
|
'''
|
|
|
|
|
residuum of Barlat 1997 yield criterion
|
|
|
|
|
'''
|
|
|
|
|
cos = np.cos; pi = np.pi; abs = np.abs
|
2015-02-06 19:18:14 +05:30
|
|
|
|
A = a*(sigmas[1] - sigmas[2])
|
|
|
|
|
B = b*(sigmas[2] - sigmas[0])
|
|
|
|
|
C = c*(sigmas[0] - sigmas[1])
|
|
|
|
|
F = f*sigmas[4]
|
|
|
|
|
G = g*sigmas[5]
|
|
|
|
|
H = h*sigmas[3]
|
|
|
|
|
|
2015-02-07 16:37:45 +05:30
|
|
|
|
I2 = (F*F + G*G + H*H)/3.0 + ((A-C)**2+(C-B)**2+(B-A)**2)/54.0
|
|
|
|
|
I3 = (C-B)*(A-C) * (B-A)/54.0 + F*G*H - \
|
|
|
|
|
( (C-B)*F*F + (A-C)*G*G + (B-A)*H*H )/6.0
|
|
|
|
|
theta = np.arccos(I3/I2**1.5)
|
|
|
|
|
Phi = np.sqrt(3.0*I2)* (
|
|
|
|
|
(abs(2.0*cos((2.0*theta + pi)/6.0)))**order +
|
|
|
|
|
(abs(2.0*cos((2.0*theta + pi*3.0)/6.0)))**order +
|
|
|
|
|
(abs(2.0*cos(( 2.0*theta + pi*5.0)/6.0)))**order
|
|
|
|
|
)**(1.0/order)
|
|
|
|
|
r = Phi/2.0**(1.0/order) - sigma0
|
|
|
|
|
|
2015-02-03 18:24:16 +05:30
|
|
|
|
|
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
def Barlat1991iso(sigmas, sigma0, m):
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
2015-02-03 18:24:16 +05:30
|
|
|
|
residuum of isotropic Barlat 1991 yield criterion (eq. 2.37)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
'''
|
2015-02-07 16:37:45 +05:30
|
|
|
|
return Barlat1991(sigmas, sigma0, m, 1.0,1.0,1.0,1.0,1.0,1.0)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
2015-02-07 16:37:45 +05:30
|
|
|
|
def Barlat1991aniso(sigmas, sigma0, a,b,c,f,g,h, m):
|
2015-02-03 18:24:16 +05:30
|
|
|
|
'''
|
|
|
|
|
residuum of anisotropic Barlat 1991 yield criterion (eq. 2.37)
|
|
|
|
|
'''
|
|
|
|
|
return Barlat1991(sigmas, sigma0, m, a,b,c,f,g,h)
|
2014-10-03 02:57:03 +05:30
|
|
|
|
|
2014-10-06 18:17:52 +05:30
|
|
|
|
|
2014-10-03 02:57:03 +05:30
|
|
|
|
def Barlat1994(sigmas, sigma0, a):
|
|
|
|
|
'''
|
|
|
|
|
residuum of Hershey yield criterion (eq. 2.104, sigma_e = sigma0)
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
return None
|
|
|
|
|
|
2015-02-07 22:28:57 +05:30
|
|
|
|
def Cazacu_Barlat3D(sigmas, sigma0,
|
|
|
|
|
a1,a2,a3,a4,a5,a6, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11, c):
|
|
|
|
|
'''
|
|
|
|
|
residuum of the Cazacu<EFBFBD>Barlat (CZ) yield criterion
|
|
|
|
|
'''
|
|
|
|
|
s11 = sigmas[0]; s22 = sigmas[1]; s33 = sigmas[2]
|
|
|
|
|
s12 = sigmas[3]; s23 = sigmas[4]; s31 = sigmas[5]
|
|
|
|
|
|
|
|
|
|
J20 = ( a1*(s22-s33)**2 + a2*(s33-s11)**2 + a3*(s11-s22)**2 )/6.0 + \
|
|
|
|
|
a4* s23**2 + a5* s31**2 + a6* s12**2
|
|
|
|
|
|
|
|
|
|
J30 = ( (b1 +b2 )*s11**3 + (b3 +b4 )*s22**3 + ( b1+b4-b2 + b1+b4-b3 )*s33**3)/27.0- \
|
|
|
|
|
( (b1*s22+b2*s33)*s11**2 + (b3*s33+b4*s11)*s22**2 + ((b1+b4-b2)*s11 + (b1+b4-b3)*s22)*s33**2)/9.0 + \
|
|
|
|
|
( (b1+b4)*s11*s22*s33/9.0 + b11*s12*s23*s31 )*2.0 - \
|
|
|
|
|
( ( 2.0*b9 *s22 - b8*s33 - (2*b9 -b8)*s11 )*s31**2 +
|
|
|
|
|
( 2.0*b10*s33 - b5*s22 - (2*b10-b5)*s11 )*s12**2 +
|
|
|
|
|
( (b6+b7)*s11 - b6*s22 - b7*s33 )*s23**2
|
|
|
|
|
)/3.0
|
|
|
|
|
|
|
|
|
|
f0 = (J20**3 - c*J30**2)**(1.0/6.0)
|
|
|
|
|
k2 = (sigma0/3.0) *18.0 **(1.0/6.0)
|
|
|
|
|
r = f0/k2 - 1.0
|
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
def Cazacu_Barlat2D(sigmas, sigma0,
|
|
|
|
|
a1,a2,a3,a6, b1,b2,b3,b4,b5,b10, c):
|
|
|
|
|
'''
|
|
|
|
|
residuum of the Cazacu<EFBFBD>Barlat (CZ) yield criterion for plain stress
|
|
|
|
|
'''
|
|
|
|
|
s11 = sigmas[0]; s22 = sigmas[1]; s12 = sigmas[3]
|
|
|
|
|
|
|
|
|
|
J20 = ( (a2+a3)*s11**2 + (a1+a3)*s22**2 - 2.0*a3*s11*s22 )/6.0 + a6*s12**2
|
|
|
|
|
|
|
|
|
|
J30 = ( (b1 + b2 )*s11**3 + (b3 +b4 )*s22**3 )/27.0- \
|
|
|
|
|
( (b1*s11 + b4*s22)*s11*s22 )/9.0 + \
|
|
|
|
|
( b5*s22 + (2*b10-b5)*s11 )*s12**2/3.0
|
|
|
|
|
|
|
|
|
|
f0 = (J20**3 - c*J30**2)**(1.0/6.0)
|
|
|
|
|
k2 = (sigma0/3.0) *18.0 **(1.0/6.0)
|
|
|
|
|
r = f0/k2 - 1.0
|
|
|
|
|
return r.ravel()
|
|
|
|
|
|
|
|
|
|
def BBC2003(sigmas, sigma0, a,b,c, d,e,f,g, k):
|
|
|
|
|
'''
|
|
|
|
|
residuum of the BBC2003 yield criterion for plain stress
|
|
|
|
|
'''
|
|
|
|
|
s11 = sigmas[0]; s22 = sigmas[1]; s12 = sigmas[3]
|
|
|
|
|
k2 = 2.0*k
|
|
|
|
|
|
|
|
|
|
Gamma = s11*(d+e) + s22*(e+f)
|
|
|
|
|
Psi = ( ( s11*(d-e)/2.0 + s22*(e-f)/2.0 )**2 + (g*s12)**2 )**0.5
|
2014-08-05 19:59:36 +05:30
|
|
|
|
|
2015-02-07 22:28:57 +05:30
|
|
|
|
sBar = ( a*(b*Gamma + c*Psi)**k2 + a*(b*Gamma - c*Psi)**k2 +
|
|
|
|
|
(1-a)*(2.0*c*Psi)**k2 )**(1.0/k2)
|
|
|
|
|
r = sBar/sigma0 - 1.0
|
|
|
|
|
return r.ravel()
|
2014-08-05 19:59:36 +05:30
|
|
|
|
|
|
|
|
|
fittingCriteria = {
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'tresca' :{'func' : Tresca,
|
|
|
|
|
'num' : 1,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Tresca',
|
|
|
|
|
'paras': 'Initial yield stress:',
|
|
|
|
|
'text' : '\nCoefficient of Tresca criterion:\nsigma0: ',
|
|
|
|
|
'error': 'The standard deviation error is: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'vonmises' :{'func' : vonMises,
|
|
|
|
|
'num' : 1,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Huber-Mises-Hencky(von Mises)',
|
|
|
|
|
'paras': 'Initial yield stress:',
|
|
|
|
|
'text' : '\nCoefficient of Huber-Mises-Hencky criterion:\nsigma0: ',
|
|
|
|
|
'error': 'The standard deviation error is: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'hosford' :{'func' : Hosford,
|
|
|
|
|
'num' : 2,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Gerenal Hosford',
|
|
|
|
|
'paras': 'Initial yield stress:',
|
2015-02-07 22:28:57 +05:30
|
|
|
|
'text' : '\nCoefficients of Hosford criterion:\nsigma0, a: ',
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'hill1948' :{'func' : Hill1948,
|
|
|
|
|
'num' : 6,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Hill1948',
|
|
|
|
|
'paras': 'Normalized [F, G, H, L, M, N]',
|
2015-02-07 22:28:57 +05:30
|
|
|
|
'text' : '\nCoefficients of Hill1948 criterion:\n[F, G, H, L, M, N]:',
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'drucker' :{'func' : Drucker,
|
|
|
|
|
'num' : 2,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Drucker',
|
|
|
|
|
'paras': 'Initial yield stress, C_D:',
|
2015-02-07 22:28:57 +05:30
|
|
|
|
'text' : '\nCoefficients of Drucker criterion:\nsigma0, C_D: ',
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'barlat1991iso' :{'func' : Barlat1991iso,
|
|
|
|
|
'num' : 2,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Barlat1991iso',
|
|
|
|
|
'paras': 'Initial yield stress, m:',
|
2015-02-07 22:28:57 +05:30
|
|
|
|
'text' : '\nCoefficients of isotropic Barlat 1991 criterion:\nsigma0, m:\n',
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
2015-02-07 16:37:45 +05:30
|
|
|
|
'barlat1991aniso':{'func' : Barlat1991aniso,
|
|
|
|
|
'num' : 8,'err':np.inf,
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'name' : 'Barlat1991aniso',
|
|
|
|
|
'paras': 'Initial yield stress, m, a, b, c, f, g, h:',
|
2015-02-07 22:28:57 +05:30
|
|
|
|
'text' : '\nCoefficients of anisotropic Barlat 1991 criterion:\nsigma0, a, b, c, f, g, h, m:\n',
|
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
|
|
|
|
'bbc2003' :{'func' : BBC2003,
|
|
|
|
|
'num' : 9,'err':np.inf,
|
|
|
|
|
'name' : 'Barlat1991aniso',
|
|
|
|
|
'paras': 'Initial yield stress, a, b, c, d, e, f, g, k:',
|
|
|
|
|
'text' : '\nCoefficients of anisotropic Barlat 1991 criterion:\nsigma0, a, b, c, d, e, f, g, k:\n',
|
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
|
|
|
|
'Cazacu_Barlat2D':{'func' : Cazacu_Barlat2D,
|
|
|
|
|
'num' : 12,'err':np.inf,
|
|
|
|
|
'name' : 'Barlat1991aniso',
|
|
|
|
|
'paras': 'Initial yield stress, a1,a2,a3,a6; b1,b2,b3,b4,b5,b10; c:',
|
|
|
|
|
'text' : '\nCoefficients of Cazacu Barlat yield criterion for plane stress: \
|
|
|
|
|
\n Y, a1,a2,a3,a6; b1,b2,b3,b4,b5,b10; c:\n',
|
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
|
|
|
|
'Cazacu_Barlat3D':{'func' : Cazacu_Barlat3D,
|
|
|
|
|
'num' : 19,'err':np.inf,
|
|
|
|
|
'name' : 'Barlat1991aniso',
|
|
|
|
|
'paras': 'Initial yield stress, a1,a2,a3,a4,a5,a6; b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11; c:',
|
|
|
|
|
'text' : '\nCoefficients of Cazacu Barlat yield criterion for plane stress: \
|
|
|
|
|
\n Y, a1,a2,a3,a4,a5,a6; b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11; c\n',
|
2015-02-06 19:31:04 +05:30
|
|
|
|
'error': 'The standard deviation errors are: '
|
|
|
|
|
},
|
|
|
|
|
'worst' :{'err':np.inf},
|
|
|
|
|
'best' :{'err':np.inf}
|
|
|
|
|
}
|
2015-02-03 17:48:53 +05:30
|
|
|
|
|
2015-02-07 16:37:45 +05:30
|
|
|
|
for key in fittingCriteria.keys():
|
|
|
|
|
if 'num' in fittingCriteria[key].keys():
|
|
|
|
|
fittingCriteria[key]['bound']=[(None,None)]*fittingCriteria[key]['num']
|
|
|
|
|
fittingCriteria[key]['guess']=np.ones(fittingCriteria[key]['num'],'d')
|
2015-02-03 18:27:18 +05:30
|
|
|
|
|
2014-08-05 19:59:36 +05:30
|
|
|
|
thresholdParameter = ['totalshear','equivalentStrain']
|
|
|
|
|
|
2014-07-02 16:12:51 +05:30
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
class Loadcase():
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
'''
|
|
|
|
|
Class for generating load cases for the spectral solver
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------
|
2014-07-09 15:01:26 +05:30
|
|
|
|
def __init__(self,finalStrain,incs,time):
|
2014-07-02 16:12:51 +05:30
|
|
|
|
print('using the random load case generator')
|
2014-07-09 15:01:26 +05:30
|
|
|
|
self.finalStrain = finalStrain
|
|
|
|
|
self.incs = incs
|
|
|
|
|
self.time = time
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
2014-07-09 15:01:26 +05:30
|
|
|
|
def getLoadcase(self,N=0):
|
2014-07-02 16:12:51 +05:30
|
|
|
|
defgrad=['*']*9
|
|
|
|
|
stress =[0]*9
|
2014-07-09 15:01:26 +05:30
|
|
|
|
values=(np.random.random_sample(9)-.5)*self.finalStrain*2
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
|
|
|
|
main=np.array([0,4,8])
|
|
|
|
|
np.random.shuffle(main)
|
2014-07-25 03:32:10 +05:30
|
|
|
|
for i in main[:2]: # fill 2 out of 3 main entries
|
2014-07-02 16:12:51 +05:30
|
|
|
|
defgrad[i]=1.+values[i]
|
|
|
|
|
stress[i]='*'
|
2014-07-25 03:32:10 +05:30
|
|
|
|
for off in [[1,3,0],[2,6,0],[5,7,0]]: # fill 3 off-diagonal pairs of defgrad (1 or 2 entries)
|
2014-07-02 16:12:51 +05:30
|
|
|
|
off=np.array(off)
|
|
|
|
|
np.random.shuffle(off)
|
2014-07-07 19:47:44 +05:30
|
|
|
|
for i in off[0:2]:
|
|
|
|
|
if i != 0:
|
|
|
|
|
defgrad[i]=values[i]
|
|
|
|
|
stress[i]='*'
|
|
|
|
|
|
2014-07-02 16:12:51 +05:30
|
|
|
|
return 'f '+' '.join(str(c) for c in defgrad)+\
|
|
|
|
|
' p '+' '.join(str(c) for c in stress)+\
|
2014-07-09 15:01:26 +05:30
|
|
|
|
' incs %s'%self.incs+\
|
|
|
|
|
' time %s'%self.time
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
class Criterion(object):
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
'''
|
|
|
|
|
Fitting to certain criterion
|
|
|
|
|
'''
|
2014-07-23 03:29:58 +05:30
|
|
|
|
def __init__(self,name='worst'):
|
|
|
|
|
self.name = name
|
2014-08-05 19:59:36 +05:30
|
|
|
|
self.results = fittingCriteria
|
|
|
|
|
|
|
|
|
|
if self.name.lower() not in map(str.lower, self.results.keys()):
|
2014-07-25 03:32:10 +05:30
|
|
|
|
raise Exception('no suitable fitting criterion selected')
|
2014-07-23 03:29:58 +05:30
|
|
|
|
else:
|
|
|
|
|
print('fitting to the %s criterion'%name)
|
|
|
|
|
|
2014-07-02 16:12:51 +05:30
|
|
|
|
def fit(self,stress):
|
2015-02-03 17:48:53 +05:30
|
|
|
|
global fitResults
|
2015-02-06 19:31:04 +05:30
|
|
|
|
|
2015-02-07 16:37:45 +05:30
|
|
|
|
nameCriterion = self.name.lower()
|
|
|
|
|
funResidum = fittingCriteria[nameCriterion]['func']
|
|
|
|
|
numParas = fittingCriteria[nameCriterion]['num']
|
|
|
|
|
textParas = fittingCriteria[nameCriterion]['text'] + formatOutput(numParas)
|
|
|
|
|
textError = fittingCriteria[nameCriterion]['error']+ formatOutput(numParas,'%-14.8f')+'\n'
|
|
|
|
|
bounds = fittingCriteria[nameCriterion]['bound'] # Default bounds, no bound
|
|
|
|
|
guess0 = fittingCriteria[nameCriterion]['guess'] # Default initial guess, depends on bounds
|
|
|
|
|
|
|
|
|
|
if fitResults == [] : initialguess = guess0
|
2015-02-06 19:31:04 +05:30
|
|
|
|
else : initialguess = np.array(fitResults[-1])
|
2015-02-03 17:48:53 +05:30
|
|
|
|
weight = get_weight(np.shape(stress)[1])
|
2015-02-04 22:17:35 +05:30
|
|
|
|
try:
|
2015-02-03 17:48:53 +05:30
|
|
|
|
popt, pcov = \
|
2015-02-06 19:31:04 +05:30
|
|
|
|
curve_fit_bound(funResidum, stress, np.zeros(np.shape(stress)[1]),
|
|
|
|
|
initialguess, weight, bounds)
|
2015-02-04 18:34:34 +05:30
|
|
|
|
perr = np.sqrt(np.diag(pcov))
|
2015-02-03 17:48:53 +05:30
|
|
|
|
fitResults.append(popt.tolist())
|
2015-02-06 19:31:04 +05:30
|
|
|
|
print (textParas%array2tuple(popt))
|
|
|
|
|
print (textError%array2tuple(perr))
|
2014-07-07 19:47:44 +05:30
|
|
|
|
except Exception as detail:
|
|
|
|
|
print detail
|
|
|
|
|
pass
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
2014-08-05 02:45:56 +05:30
|
|
|
|
class myThread (threading.Thread):
|
2014-07-02 16:12:51 +05:30
|
|
|
|
#---------------------------------------------------------------------------------------------------
|
|
|
|
|
'''
|
|
|
|
|
Runner class
|
|
|
|
|
'''
|
|
|
|
|
def __init__(self, threadID):
|
|
|
|
|
threading.Thread.__init__(self)
|
|
|
|
|
self.threadID = threadID
|
|
|
|
|
def run(self):
|
|
|
|
|
s.acquire()
|
|
|
|
|
conv=converged()
|
|
|
|
|
s.release()
|
|
|
|
|
while not conv:
|
|
|
|
|
doSim(4.,self.name)
|
|
|
|
|
s.acquire()
|
|
|
|
|
conv=converged()
|
|
|
|
|
s.release()
|
|
|
|
|
|
|
|
|
|
def doSim(delay,thread):
|
2014-07-21 23:19:45 +05:30
|
|
|
|
|
2014-07-02 16:12:51 +05:30
|
|
|
|
s.acquire()
|
2014-07-04 19:10:15 +05:30
|
|
|
|
me=getLoadcase()
|
2014-07-08 21:39:02 +05:30
|
|
|
|
if not os.path.isfile('%s.load'%me):
|
|
|
|
|
print('generating loadcase for sim %s from %s'%(me,thread))
|
|
|
|
|
f=open('%s.load'%me,'w')
|
2014-07-21 23:19:45 +05:30
|
|
|
|
f.write(myLoad.getLoadcase(me))
|
2014-07-08 21:39:02 +05:30
|
|
|
|
f.close()
|
|
|
|
|
s.release()
|
|
|
|
|
else: s.release()
|
|
|
|
|
|
|
|
|
|
s.acquire()
|
2014-08-05 02:45:56 +05:30
|
|
|
|
if not os.path.isfile('%s_%i.spectralOut'%(options.geometry,me)):
|
2014-07-09 12:47:58 +05:30
|
|
|
|
print('starting simulation %s from %s'%(me,thread))
|
2014-07-08 21:39:02 +05:30
|
|
|
|
s.release()
|
2014-08-05 02:45:56 +05:30
|
|
|
|
execute('DAMASK_spectral -g %s -l %i'%(options.geometry,me))
|
2014-07-08 21:39:02 +05:30
|
|
|
|
else: s.release()
|
|
|
|
|
|
|
|
|
|
s.acquire()
|
2014-08-05 02:45:56 +05:30
|
|
|
|
if not os.path.isfile('./postProc/%s_%i.txt'%(options.geometry,me)):
|
2014-07-08 21:39:02 +05:30
|
|
|
|
print('starting post processing for sim %i from %s'%(me,thread))
|
|
|
|
|
s.release()
|
2014-08-05 19:59:36 +05:30
|
|
|
|
try:
|
|
|
|
|
execute('postResults --cr f,p --co totalshear %s_%i.spectralOut'%(options.geometry,me))
|
|
|
|
|
except:
|
|
|
|
|
execute('postResults --cr f,p %s_%i.spectralOut'%(options.geometry,me))
|
2014-08-05 02:45:56 +05:30
|
|
|
|
execute('addCauchy ./postProc/%s_%i.txt'%(options.geometry,me))
|
|
|
|
|
execute('addStrainTensors -l -v ./postProc/%s_%i.txt'%(options.geometry,me))
|
|
|
|
|
execute('addMises -s Cauchy -e ln(V) ./postProc/%s_%i.txt'%(options.geometry,me))
|
2014-07-08 21:39:02 +05:30
|
|
|
|
else: s.release()
|
2014-07-07 19:47:44 +05:30
|
|
|
|
|
|
|
|
|
s.acquire()
|
2015-02-04 18:34:34 +05:30
|
|
|
|
print('-'*10)
|
2014-07-08 21:39:02 +05:30
|
|
|
|
print('reading values for sim %i from %s'%(me,thread))
|
2014-07-07 19:47:44 +05:30
|
|
|
|
s.release()
|
|
|
|
|
|
2014-08-05 02:45:56 +05:30
|
|
|
|
refFile = open('./postProc/%s_%i.txt'%(options.geometry,me))
|
2014-07-07 19:47:44 +05:30
|
|
|
|
table = damask.ASCIItable(refFile)
|
|
|
|
|
table.head_read()
|
2014-08-18 23:51:36 +05:30
|
|
|
|
if options.fitting =='equivalentStrain':
|
|
|
|
|
thresholdKey = 'Mises(ln(V))'
|
|
|
|
|
elif options.fitting =='totalshear':
|
|
|
|
|
thresholdKey = 'totalshear'
|
|
|
|
|
s.acquire()
|
|
|
|
|
for l in [thresholdKey,'1_Cauchy']:
|
|
|
|
|
if l not in table.labels: print '%s not found'%l
|
|
|
|
|
s.release()
|
|
|
|
|
table.data_readArray(['%i_Cauchy'%(i+1) for i in xrange(9)]+[thresholdKey])
|
|
|
|
|
|
|
|
|
|
line = 0
|
|
|
|
|
lines = np.shape(table.data)[0]
|
2015-02-06 19:18:14 +05:30
|
|
|
|
yieldStress = np.empty((int(options.yieldValue[2]),6),'d')
|
2014-08-19 01:39:09 +05:30
|
|
|
|
for i,threshold in enumerate(np.linspace(options.yieldValue[0],options.yieldValue[1],options.yieldValue[2])):
|
2014-08-18 23:51:36 +05:30
|
|
|
|
while line < lines:
|
2014-08-19 01:39:09 +05:30
|
|
|
|
if table.data[line,9]>= threshold:
|
|
|
|
|
upper,lower = table.data[line,9],table.data[line-1,9] # values for linear interpolation
|
2015-02-06 19:18:14 +05:30
|
|
|
|
stress = np.array(table.data[line-1,0:9] * (upper-threshold)/(upper-lower) + \
|
|
|
|
|
table.data[line ,0:9] * (threshold-lower)/(upper-lower)).reshape(3,3) # linear interpolation of stress values
|
|
|
|
|
yieldStress[i,0]= stress[0,0]; yieldStress[i,1]=stress[1,1]; yieldStress[i,2]=stress[2,2]
|
|
|
|
|
yieldStress[i,3]=(stress[0,1] + stress[1,0])/2.0 # 0 3 5
|
|
|
|
|
yieldStress[i,4]=(stress[1,2] + stress[2,1])/2.0 # * 1 4 yieldStress
|
|
|
|
|
yieldStress[i,5]=(stress[2,0] + stress[0,2])/2.0 # * * 2
|
2014-08-11 02:52:22 +05:30
|
|
|
|
break
|
2014-08-18 23:51:36 +05:30
|
|
|
|
else:
|
|
|
|
|
line+=1
|
2014-07-08 21:39:02 +05:30
|
|
|
|
|
2014-07-07 19:47:44 +05:30
|
|
|
|
s.acquire()
|
2014-08-18 23:51:36 +05:30
|
|
|
|
global stressAll
|
2015-02-02 23:11:19 +05:30
|
|
|
|
print('number of yield points of sim %i: %i'%(me,len(yieldStress)))
|
2014-08-18 23:51:36 +05:30
|
|
|
|
print('starting fitting for sim %i from %s'%(me,thread))
|
2014-08-11 02:52:22 +05:30
|
|
|
|
try:
|
2014-08-18 23:51:36 +05:30
|
|
|
|
for i in xrange(int(options.yieldValue[2])):
|
2015-02-02 23:11:19 +05:30
|
|
|
|
stressAll[i]=np.append(yieldStress[i]/unitGPa,stressAll[i])
|
2015-02-06 19:18:14 +05:30
|
|
|
|
myFit.fit(stressAll[i].reshape(len(stressAll[i])//6,6).transpose())
|
2015-02-04 22:17:35 +05:30
|
|
|
|
except Exception as detail:
|
2014-08-11 02:52:22 +05:30
|
|
|
|
print('could not fit for sim %i from %s'%(me,thread))
|
2015-02-04 22:17:35 +05:30
|
|
|
|
print detail
|
2014-08-11 02:52:22 +05:30
|
|
|
|
s.release()
|
|
|
|
|
return
|
2014-07-02 16:12:51 +05:30
|
|
|
|
s.release()
|
|
|
|
|
|
|
|
|
|
def getLoadcase():
|
|
|
|
|
global N_simulations
|
|
|
|
|
N_simulations+=1
|
|
|
|
|
return N_simulations
|
|
|
|
|
|
|
|
|
|
def converged():
|
|
|
|
|
global N_simulations
|
2014-08-05 19:59:36 +05:30
|
|
|
|
if N_simulations < options.max:
|
2014-07-02 16:12:51 +05:30
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
return True
|
|
|
|
|
|
2014-07-09 15:01:26 +05:30
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
# MAIN
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
parser = OptionParser(option_class=damask.extendableOption, usage='%prog options [file[s]]', description = """
|
2014-07-21 23:19:45 +05:30
|
|
|
|
Performs calculations with various loads on given geometry file and fits yield surface.
|
2014-07-09 15:01:26 +05:30
|
|
|
|
|
|
|
|
|
""", version=string.replace(scriptID,'\n','\\n')
|
|
|
|
|
)
|
|
|
|
|
|
2014-08-05 02:45:56 +05:30
|
|
|
|
parser.add_option('-l','--load' , dest='load', type='float', nargs=3,
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='load: final strain; increments; time %default', metavar='float int float')
|
2014-08-05 02:45:56 +05:30
|
|
|
|
parser.add_option('-g','--geometry', dest='geometry', type='string',
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='name of the geometry file [%default]', metavar='string')
|
2015-02-02 23:11:19 +05:30
|
|
|
|
parser.add_option('-c','--criterion', dest='criterion', choices=fittingCriteria.keys(),
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='criterion for stopping simulations [%default]', metavar='string')
|
2015-02-02 23:11:19 +05:30
|
|
|
|
parser.add_option('-f','--fitting', dest='fitting', choices=thresholdParameter,
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='yield criterion [%default]', metavar='string')
|
2015-02-02 23:11:19 +05:30
|
|
|
|
parser.add_option('-y','--yieldvalue', dest='yieldValue', type='float', nargs=3,
|
2014-08-18 23:51:36 +05:30
|
|
|
|
help='yield points: start; end; count %default', metavar='float float int')
|
2014-08-05 02:45:56 +05:30
|
|
|
|
parser.add_option('--min', dest='min', type='int',
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='minimum number of simulations [%default]', metavar='int')
|
2014-08-05 02:45:56 +05:30
|
|
|
|
parser.add_option('--max', dest='max', type='int',
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='maximum number of iterations [%default]', metavar='int')
|
2015-02-02 23:11:19 +05:30
|
|
|
|
parser.add_option('-t','--threads', dest='threads', type='int',
|
2014-08-05 19:59:36 +05:30
|
|
|
|
help='number of parallel executions [%default]', metavar='int')
|
|
|
|
|
parser.set_defaults(min = 12)
|
|
|
|
|
parser.set_defaults(max = 30)
|
|
|
|
|
parser.set_defaults(threads = 4)
|
2014-10-06 18:17:52 +05:30
|
|
|
|
parser.set_defaults(yieldValue = (0.002,0.004,2))
|
2014-08-18 23:51:36 +05:30
|
|
|
|
parser.set_defaults(load = (0.010,100,100.0))
|
2014-08-05 19:59:36 +05:30
|
|
|
|
parser.set_defaults(criterion = 'worst')
|
|
|
|
|
parser.set_defaults(fitting = 'totalshear')
|
|
|
|
|
parser.set_defaults(geometry = '20grains16x16x16')
|
2014-07-09 15:01:26 +05:30
|
|
|
|
|
|
|
|
|
options = parser.parse_args()[0]
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
2014-08-05 19:59:36 +05:30
|
|
|
|
if not os.path.isfile(options.geometry+'.geom'):
|
|
|
|
|
parser.error('geometry file %s.geom not found'%options.geometry)
|
|
|
|
|
if not os.path.isfile('material.config'):
|
|
|
|
|
parser.error('material.config file not found')
|
|
|
|
|
if options.threads<1:
|
|
|
|
|
parser.error('invalid number of threads %i'%options.threads)
|
|
|
|
|
if options.min<0:
|
|
|
|
|
parser.error('invalid minimum number of simulations %i'%options.min)
|
|
|
|
|
if options.max<options.min:
|
2014-08-18 23:51:36 +05:30
|
|
|
|
parser.error('invalid maximum number of simulations (below minimum)')
|
|
|
|
|
if options.yieldValue[0]>options.yieldValue[1]:
|
|
|
|
|
parser.error('invalid yield start (below yield end)')
|
|
|
|
|
if options.yieldValue[2] != int(options.yieldValue[2]):
|
|
|
|
|
parser.error('count must be an integer')
|
2014-08-05 19:59:36 +05:30
|
|
|
|
if not os.path.isfile('numerics.config'):
|
|
|
|
|
print('numerics.config file not found')
|
2014-08-05 02:45:56 +05:30
|
|
|
|
|
2014-08-18 23:51:36 +05:30
|
|
|
|
if not os.path.isfile('material.config'):
|
|
|
|
|
print('material.config file not found')
|
|
|
|
|
|
2015-02-02 23:11:19 +05:30
|
|
|
|
unitGPa = 10.e8
|
2014-07-02 16:12:51 +05:30
|
|
|
|
N_simulations=0
|
2015-02-03 17:48:53 +05:30
|
|
|
|
fitResults = []
|
2014-07-02 16:12:51 +05:30
|
|
|
|
s=threading.Semaphore(1)
|
|
|
|
|
|
2014-08-18 23:51:36 +05:30
|
|
|
|
stressAll=[np.zeros(0,'d').reshape(0,0) for i in xrange(int(options.yieldValue[2]))]
|
2014-07-09 15:01:26 +05:30
|
|
|
|
myLoad = Loadcase(options.load[0],options.load[1],options.load[2])
|
2014-08-05 19:59:36 +05:30
|
|
|
|
myFit = Criterion(options.criterion)
|
|
|
|
|
|
|
|
|
|
threads=[]
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
2014-08-05 02:45:56 +05:30
|
|
|
|
for i in range(options.threads):
|
2014-08-05 19:59:36 +05:30
|
|
|
|
threads.append(myThread(i))
|
|
|
|
|
threads[i].start()
|
2014-07-02 16:12:51 +05:30
|
|
|
|
|
2014-08-05 02:45:56 +05:30
|
|
|
|
for i in range(options.threads):
|
2014-08-05 19:59:36 +05:30
|
|
|
|
threads[i].join()
|
2014-08-05 02:45:56 +05:30
|
|
|
|
|
|
|
|
|
print 'finished fitting to yield criteria'
|