Close

Dear All, there are two channels for you to follow our research. 

1. We started a newsletter called Thoughts on Composites Modeling on LinkedIn. Please subscribe to it to get informed about our research and ideas we want to share with the community.

2. We moved our discussion forum to github at wenbinyugroup · Discussions · GitHub as it has more features which can serve you better. 

Wenbin 

Close

Wiki

Main Page / Abaqus tips and tricks /

How to access Abaqus odb field output efficiently via Abaqus python script

Article abstract

This article will introduce the efficient way to use Abaqus python script to access Abaqus odb field outputs. The considerations for Abaqus python scripting are given.
A comparison of several unpacking styles to access odb outputs is made. The demonstration code is provided in Github: https://github.com/tao364744553/Abaqus-DNN.git.


Considerations for Abaqus python performance

  1. Make use of appropriate object sequence unpacking. The style of sequence unpacking can significantly influence the efficiency of your Python scripts.
  2. Make use of python built-in functions. They are usually optimized for performance.
  3. Make use of 3rd-party modules. They are usually optimized for performance.
  4. In general, working with high-level objects is more efficient than working with low-level objects.
  5. Avoid accessing attributes that require the use of computationally intensive methods. For example: minimize the number of calls to getSubset() and addData() methods.

Comparison of unpacking sytels

The sequence unpacking style with the Abaqus object model can have a significant influence on performance. Consider the below three methods of access the same stress information:

democode1.PNG

For the first piece of code, it has to reopen the subdirectories in the odb dictionary every time it accesses stress. Thus, the cost will be significantly expensive for a large model.
The second piece of code still needs to open the Value subdirectory. But it is more efficient than the first case.
The third piece of code shows the most efficient style. It is recommended to access odb outputs in this style.


Example to access multiple fields outputs

A plane stress model is fixed at one end and under a displacement $$u_x = 0.1$$ inch. The FEM model is described below
model.png
material.PNG

democode2.PNG
democode3.PNG

The cost to access displacement for this model is shown below

result.png


Created on , Last modified on