×
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 Python sum of Stress components

Abaqus Python sum of Stress components

Abaqus Python sum of Stress components

(OP)
Hello everyone!
I'm trying to figure out if there is a quick and easy way on getting the sum of S11 for example.
The Script I wrote for this task is described below:
I first read out the centroidal S11 component of every Element of the model from the odb file and append it to a tuple.
In another for-loop I sum up all the components of that tuple.
The problem I have with this solution is, that it takes ages for bigger meshes.

By using the Abaqus report it "spits out the sums" within a couple second. Is there a more efficient way I can get acces to these summed values via python Script?

Let me know if there is anything unclear and thanks in advance!

RE: Abaqus Python sum of Stress components

Here are some point you could check or think about:

- Why don't you use the report?
- Why don't you use *El Print?
- Examples in the Users Scripting Guide show how to read data from the odb in an efficient way.
- Why don't you sum the data directly, instead of storing them?
- A tuple cannot be changed, so I think you store the data in a list.
- Exanding a list thousends of times is very inefficient. Create a large list at the beginning and assign the data or use a dictionary. See http://www.tek-tips.com/viewthread.cfm?qid=1750484

RE: Abaqus Python sum of Stress components

(OP)
Thanks for your tipps Mustaine3.

I tried summing the data directly. It does take less time, but still takes ages.
My workaround I managed today is that I create a report file for each step in which I have a couple of "Total" lines since there are more Sections.
The files are read via python and the Total lines are identified within the report-files and the 6 values are stored as a list. In another Step I then sum up the all the totals for each Stress component.

This only needs a couple of seconds, instead of 1.5 hours! :)

Thanks for your other tipps though!

RE: Abaqus Python sum of Stress components

hi,

I think if you go to Results -> Options you can uncheck the option "use region boundaries". Then when you generate your report you should only have one line for the totals. No python required if it works as i think it should.

Good Luck,
Dave

RE: Abaqus Python sum of Stress components

(OP)
Wow, thanks Dave.
Great Tip. That would have made my scripting easier if I knew it ahead of time. I will definately still implement that!

I have another question regarding scripting and Materials libraries. Is there some easy way to add Materials into a Material library via scripting? (the *.lib file)
I'm aware that I can add Materials into the Material Module quite easily. But I don't think there is a way to add it into library file, or is there?

RE: Abaqus Python sum of Stress components

(OP)
The Report-File Method works fine, but I can't believe there isn't a more direct way of getting to these values. Where is the Report-File getting them from?

There must be a more efficient method than what my original code is doing. See the code below. I'm trying to get the TOTAL of every stress compoment of THE WHOLE Assembly/Part within Python. The Assembly itself only consists of one Part.
Could I declare a Elementset as the region? Would this make any difference?
Thanks in advance.

odb = session.openOdb(name='C:/temp/Job-1.odb')
step_1 = odb.steps['Step-1']
stress_1=step_1.frames[-1].fieldOutputs['S']
#Step-1
sum_Sxx_1=sum_Syy_1=sum_Szz_1=0
for el in range(numElemente):
Stress=stress_1.getSubset(region=Instance.elements[el],position=CENTROID, elementType='C3D8R').values
sum_Sxx_1 = sum_Sxx_1 + Stress[0].data[0]
sum_Syy_1 = sum_Syy_1 + Stress[0].data[1]
sum_Szz_1 = sum_Szz_1 + Stress[0].data[2]

RE: Abaqus Python sum of Stress components

Scripting USers Guide 9.5 Reading from an output database

There you'll see how it's done.

RE: Abaqus Python sum of Stress components

(OP)
Thanks for pointing that out Mustaine. I figured it out now!

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