Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimization problem with abaqus and python

Status
Not open for further replies.

vsvirane

Mechanical
Joined
Jul 31, 2014
Messages
1
Location
DE
Hi All,
I am having a little problem. I am into parametric design and optimization. I have been able to successfully generate the .odb file using matlab but I am having problem reading the data from it. I have written a python script for it but everytime I run it using matlab I get the error that says that it cannot understand the lastframe.
I am new to python and any help would be great. I am using the following to run python script from matlab
[highlight #CC0000] ! abaqus interactive job=Job-1
! abaqus python ReadODB_Job1.py Job-1.odb Job-1.m[/b][/highlight]

also below ull find the python code
import odbAccess
names=["odbRes_Job1"]
nameOfStep="Step-Torsion"

for y in range(len(names)):
NameOfFile = names[y]+".txt"
FileResultsX = open(NameOfFile,"w")

myOdb = odbAccess.openOdb(path="Job-1.odb")
lastStep = myOdb.steps[nameOfStep]

for z in range(len(lastStep.frames)):
lastFrame = myOdb.steps[nameOfStep].frames[z]
Times=lastFrame.frameValue
U = lastFrame.fieldOutputs["U"]
UR = lastFrame.fieldOutputs["UR"]
UT = lastFrame.fieldOutputs["UT"]

# FileResultsX.write("Node\tUR1\n")

for nodeNumber in range(14,15):
FileResultsX.write("%d\t" % nodeNumber)
for ur in UR.values:
if ur.nodeLabel == nodeNumber:
FileResultsX.write("%10.8E\t" % (ur.data[0]))

myOdb.close()
FileResultsX.close()

Any help will be greatly appreciated
 
you can do optimization with python too. look up numpy (included in recent abq distributions i think) and scipy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top