10.11.08

Python script in ABAQUS to read displacement and write to a file

import odbAccess
odb = session.openOdb('case3.odb')
timeFrame = odb.steps['Step-2'].frames[99]
displacement = timeFrame.fieldOutputs['U']
Pipenode = odb.rootAssembly.instances['PART-1-1'].nodeSets['PIPENODE']
PipenodeDisp = displacement.getSubset(region=Pipenode)
myoutfile = open('tryout.txt','w+')
myoutfile.write("Node ")
myoutfile.write("x disp ")
myoutfile.write("y disp ")
myoutfile.write("z disp\n")
for v in PipenodeDisp.values:
print 'Node label =', v.nodeLabel
myoutfile.write(str(v.nodeLabel))
myoutfile.write(" ")
print 'x disp =', v.data[0]
myoutfile.write(str(v.data[0]))
myoutfile.write(" ")
print 'x disp =', v.data[1]
myoutfile.write(str(v.data[1]))
myoutfile.write(" ")
print 'x disp =', v.data[2]
myoutfile.write(str(v.data[2]))
myoutfile.write("\n")
myoutfile.close()
odb.close()

没有评论: