fixed wrong order in linear interpolation for stress
This commit is contained in:
parent
862389c94b
commit
c6eab9dab7
|
@ -185,12 +185,12 @@ def doSim(delay,thread):
|
||||||
line = 0
|
line = 0
|
||||||
lines = np.shape(table.data)[0]
|
lines = np.shape(table.data)[0]
|
||||||
yieldStress=[None for i in xrange(int(options.yieldValue[2]))]
|
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:
|
while line < lines:
|
||||||
if table.data[line,9]>= j:
|
if table.data[line,9]>= threshold:
|
||||||
upper,lower = table.data[line,9],table.data[line-1,9] # weights for linear interpolation
|
upper,lower = table.data[line,9],table.data[line-1,9] # values for linear interpolation
|
||||||
yieldStress[i] = table.data[line, 0:9] * (upper-j)/(upper-lower) \
|
yieldStress[i] = table.data[line-1 0:9] * (upper-threshold)/(upper-lower) \
|
||||||
+ table.data[line-1,0:9] * (j-lower)/(upper-lower) # linear interpolation of stress values
|
+ table.data[line ,0:9] * (threshold-lower)/(upper-lower) # linear interpolation of stress values
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
line+=1
|
line+=1
|
||||||
|
|
Loading…
Reference in New Issue