×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Abaqus Scripting interface

Abaqus Scripting interface

Abaqus Scripting interface

(OP)
Hello,

I needed some help in the Abaqus scripting interface. I have a .py file
from odbAccess import *
from string import *
odb = openOdb('Analysis.odb')
FirstLoadStep = odb.steps['Rise']

print 'First Load Step',FirstLoadStep
lastFrame = FirstLoadStep.frames[-1]

#print 'lastFrame',lastFrame

#print 'AVailable output',lastFrame.fieldOutputs
tempData = lastFrame.fieldOutputs['TEMP']
print tempData
elementData=[]

for val in tempData.value:
    
    #print val.data
    #elementLabel=0
    
    if val.data >=1500:
        print 'max Element',val.elementLabel

This script lets me print the values of all elements from the last frame which have a temperature greater than 1500. I would like to write these elements out to a file. (preferably a .inp file) How do I do that.

Kindly help.

Thanks
Ankur

RE: Abaqus Scripting interface

.inp file is  a text file can use:

fObj=open("myFile.inp","w")
......
 if val.data >=1500:
        print 'max Element',val.elementLabel
        # format your output string here ...
        # example... lineString=str(val.elementLabel)+"\n"
        fObj.write(lineString)


....
fObj.close()

-if you want to insert elem labels into an existing .inp file at a certain location ..probably you will need to use an aditional list of strings , each string containing the existing lines in the initial .inp file.
-then insert the labels of element (or whatever you need) in the string list.
-after you finish all the insertions
overwrite the .inp file by writing each string in the list.

it's simple

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources