ABAQUS Python Code – Find the max/min displacement (envelope) of all nodes

从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()

Advertisements

About yhtian

I am an academic researcher working on Offshore Geotechnical Engineering. My blog aims to write down some work related trivial things and tricks about software, programming. It is basically a memo for me to back up some thoughts and small details. But I am more than happy if someone would visit and discuss.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s