×
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 and Python

Abaqus and Python

Abaqus and Python

(OP)
hello all,

I am using a python script in order to calculate the angle of the maximum principle stress. To do so I need the numerical library "numarray" to calculate the eigenvalues and the eigenvectors of the stress matrix. I managed to download the "numarray" library and used it sucessfully outside abaqus, in a python shell. But when i import the library from withing abaqus, the module can not be found. I made sure that the sys.path in abaqus is set to the same one in the python shell.

the command "import numarray " works with no error.
but when i issue, " from nummarray import linear_algebra" i get:
from numarray import linear_algebra
File "C:\Python24\lib\numarray\linear_algebra\__init__.py", line 1, in ?
    from LinearAlgebra2 import *
File "C:\Python24\lib\numarray\linear_algebra\LinearAlgebra2.py", line 21, in ?
    import numarray.numeric as num
File "C:\Python24\lib\numarray\numeric.py", line 2, in ?
    import libnumeric
ImportError: DLL load failed: The specified module could not be found.

this command is working perfectly in a python shell. this is really driving me crazy.

any help?
thx in advance

RE: Abaqus and Python

A couple of issues:

1. Look at the version of the Python you are trying to import from... What version ABAQUS are you running? Be aware that ABAQUS V6.5 uses Python 2.0

...but more importantly...

2. In V6.5 you are limited to the python modules that are compiled into and shipped with ABAQUS python. Namely, you can not import an external python package. Note, this capability is coming with ABAQUS V6.6!! (NB V6.6 uses Python 2.3)

RE: Abaqus and Python

I would have thought that the principal stresses could be plotted as vectors so you can at least see the directions.

corus

RE: Abaqus and Python

alan14,
use:

from Numeric import *
import LinearAlgebra

In general, for stress field the principal stresses are computed by default, see the description of the objects:
odb-> FieldOutput (maxPrincipal, midPrincipal and minPrincipal members) and FieldValue.


As brep said ABAQUS has its own Python installation(version 2.0 for ABAQUS 6.4 & 6.5) which (by default) does not share modules with other Python installations (like the modules typically installed in C:\Python2x). Therefore,
it is quite possible the scripts you tested under other shells not to work under ABAQUS Python shell.

 The worst part is that you cannot find useful modules (e.g. scipy) compatible with this old Python 2.0 version.

brep, thanks for the information pertaining to ABAQUS v6.6! I was looking forward to having available that improvement.

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