×
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 File

ABAQUS Scripting File

ABAQUS Scripting File

(OP)
Hi All,

I have written a simple python program which will help me extract the displacement output for only the nodeset I am interested in and writes it into a text file.
Unfortunately it is giving me an error while I run the below program though I have used the right syntax

Error message: File "output.py", line 13, in ?
    disp=displacementfield.getSubset(region=first_set)
TypeError: region; found tuple, expecting OdbInstance


"Program"

# output.py" is a programme which reads the required filed output data from an
# output data base and writes it into a text file.
from odbAccess import *
from textRepr import *
from abaqusConstants import *
import odbAccess
odb=openOdb(path='shear.odb')
n=10
i=0
while (i<=n):
  first_set=odb.rootAssembly.instances['CYLINDER-1_1'].nodeSets.keys('nodeset1')
  displacementfield=odb.steps['Step_Load'].frames[i].fieldOutputs['U']
  disp=displacementfield.getSubset(region=first_set)
  dispvalues=disp.values
  for v in dispvalues:
   print v.data[0],v.data[1],v.data[2]
   dispfile=open('disp.txt','w')
   dispfile.Write(v.data[0],v.data[1],v.data[2])
disp.save()
disp.close()
odb.close()


PS: if anyone of you can help me figure out what is wrong in the above code, it will be really helpful.

I thank you in advance

Hoping to hear from some one soon.

-Anjali





 

RE: ABAQUS Scripting File

You should try

first_set=odb.rootAssembly.instances['CYLINDER-1_1'].nodeSets['nodeset1']
 

RE: ABAQUS Scripting File

(OP)
Hi,

Thank you for the reply. WEll The error msg is for the line :disp=displacementfield.getSubset(region=first_set). The previous line which points to the "nodeset1" works fine with nodesets.keys('nodeset1') syntax where in it didnt work with nodesets['nodeset1'] syntax.

I dont know why it says found a tuple , expected an odb instance.


Regards
Anjali
 

RE: ABAQUS Scripting File

(OP)
Hi xerf,

Thank you for the reply. WEll The error msg is for the line :disp=displacementfield.getSubset(region=first_set). The previous line which points to the "nodeset1" works fine with nodesets.keys('nodeset1') syntax where in it didnt work with nodesets['nodeset1'] syntax.

I dont know why it says found a tuple , expected an odb instance.


Regards
Anjali

RE: ABAQUS Scripting File

Have you tried to check to type of first_set ?

The access to the odbSet objects is:

session.odbs[name].rootAssembly.instances[name].nodeSets[name]

For details,  see ABAQUS Scripting Reference Manual.
   

There are some potential other mistakes I noticed in the code:

1. the counter i is not increased in the loop while (i<=n):
therefore you have an infinite loop

2. dispfile.Write(v.data[0],v.data[1],v.data[2])
The file method is write(string).

3.  ????
disp.save()
disp.close()

Best.
 

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