×
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

python script to read J-Integral from odb file

python script to read J-Integral from odb file

python script to read J-Integral from odb file

(OP)
Hello:

My problem is very simple, I guess.

I want to extract the J-Integral values from the odb file. I have written the following script, see the next lines:
#######################################################
import odbAccess
names2=['J-Integral_test']
nameOfStep='Step-1'
Name=names2+'.odb'
myOdb = odbAccess.openOdb(path=Name)
lastStep=myOdb.steps[nameOfStep]
# using print command I figured out the keys for the region
# print lastStep.historyRegions.keys()
historyRegion=lastStep.historyRegions['ElementSet ALL ELEMENTS']
# again using print option I figured out the variables inside historyOutputs
for res in historyRegion.historyOutputs.keys():
print res
# The result of the previous print is:
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_01
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_02
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_03
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_04
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_05
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_06
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_07
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_08
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_09
#: J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_10
# ...
# ...
# ...
# The question is:
# What is the VariableName (???) that I must use to write the J-Integral values
historyOutputJ = historyRegion.historyOutputs['<VariableName>'].data
J-IntegralFile = open('Jval.dat','w')
for time,Jdata in historyOutputJ:
J-IntegralFile.write('%10.4E %10.4E\n' % (time, Jdata))
J-IntegralFile.close()

# I have tried for <VariableName>:_PICKEDSET4-1_;_PICKEDSET4-1__Contour_01; J at H-OUTPUT-1_CRACK-1__PICKEDSET4-1__Contour_0
# without success!
#If the result were displacement , the keyword for <VariableName> would be 'U'
##############################################################################
My question is:

What is the name of output variable regarding to J-Integral ?

Any idea?

Thanks in advance

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