从abaqus odb中找出所有节点的最大小位移(包线)的python代码,原创(转载请说明出处和作者):
run: abaqus viewer noGUI=mycode.py
author: Yinghui Tian
from: http://yhtian.blogspot.com
import odbAccess
odb = session.openOdb('EB.odb')
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
MaxU = range(101)
MinU = range(101)
MaxW = range(101)
MinW = range(101)
for i in range(101):
MaxU[i] = 0.0
MinU[i] = 0.0
MaxW[i] = -100.0
MinW[i] = 0.0
OutDispfile = open('DispEnvEB.txt','w+')
OutDispfile.write("Node ")
OutDispfile.write("MinU ")
OutDispfile.write("MaxU ")
OutDispfile.write("MinW ")
OutDispfile.write("MaxW\n")
i = 0
while (i<=2000):
print i
timeframe = odb.getFrame(i)
dispp = timeframe.fieldOutputs['U']
j = 0
for v in dispp.values:
print j
if (v.data[0] >= MaxU[j]):
MaxU[j] = v.data[0]
if (v.data[0] <= MinU[j]):
MinU[j] = v.data[0]
if (i >200):
if (v.data[2] >=MaxW[j]):
MaxW[j] = v.data[2]
if (v.data[2] <=MinW[j]):
MinW[j] = v.data[2]
j = j + 1
i = i + 1
for i in range(101):
OutDispfile.write(str(i+1))
OutDispfile.write(" ")
OutDispfile.write(str(MinU[i]))
OutDispfile.write(" ")
OutDispfile.write(str(MaxU[i]))
OutDispfile.write(" ")
OutDispfile.write(str(MinW[i]))
OutDispfile.write(" ")
OutDispfile.write(str(MaxW[i]))
OutDispfile.write("\n")
OutDispfile.close()
订阅:
博文评论 (Atom)
没有评论:
发表评论