fixed wrong order in linear interpolation for stress

This commit is contained in:
Martin Diehl 2014-08-18 20:09:09 +00:00
parent 862389c94b
commit c6eab9dab7
1 changed files with 5 additions and 5 deletions

View File

@ -185,12 +185,12 @@ def doSim(delay,thread):
line = 0
lines = np.shape(table.data)[0]
yieldStress=[None for i in xrange(int(options.yieldValue[2]))]
for i,j in enumerate(np.linspace(options.yieldValue[0],options.yieldValue[1],options.yieldValue[2])):
for i,threshold in enumerate(np.linspace(options.yieldValue[0],options.yieldValue[1],options.yieldValue[2])):
while line < lines:
if table.data[line,9]>= j:
upper,lower = table.data[line,9],table.data[line-1,9] # weights for linear interpolation
yieldStress[i] = table.data[line, 0:9] * (upper-j)/(upper-lower) \
+ table.data[line-1,0:9] * (j-lower)/(upper-lower) # linear interpolation of stress values
if table.data[line,9]>= threshold:
upper,lower = table.data[line,9],table.data[line-1,9] # values for linear interpolation
yieldStress[i] = table.data[line-1 0:9] * (upper-threshold)/(upper-lower) \
+ table.data[line ,0:9] * (threshold-lower)/(upper-lower) # linear interpolation of stress values
break
else:
line+=1