×
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

Post-Processing the stress in a section

Post-Processing the stress in a section

Post-Processing the stress in a section

(OP)
Hello,
I'm studying the carcks in a metalic material. I've done a FE analysis on my structure ans i'm now interessed by having the stresses S22 in a file .txt in order to import it into matlab.
I would like to get a file like this :
COOR1 | COOR2 | COOR3| S22
I'm trying to use a pyhon script to carry out this task but it seems that the script doesn't find the variable which corresponds to the coordinates of the node. Of course, I created a set which correspond to the section I'm interested in. With this post, I attach the script python I'm using as well as the error that occur.
I'd just like to add that i'm not familiar with Abaqus and data processing with python so if one of you wants to help me, i would be gratefull if you explain like for a noob.

x0=session.xyDataObjects[word]
KeyError : COORD:COOR1 PI: PART1-1 N:3


from abaqus import *
from abaqusConstants import *
from caeModules import *
from driverUtils import *
from odbMaterial import *
from odbAccess import *

from textRepr import *
import pickle
from sys import *
from os.path import *
from time import *
from string import *
from types import *

Pi=acos(-1.)

nom_odb='Job-1'

nom_sortie='result_'+ nom_odb +'.txt'
nom_odb=nom_odb+'.odb'

odb = session.odbs[nom_odb]

#: extrait la liste des nodes sets
setname=(odb.rootAssembly.nodeSets.keys())
print ' #: Node Set Name=', setname
#: choisir le node Set PLANHAUT
setnom=(odb.rootAssembly.nodeSets.keys())[2]
print ' #: Node Set Name=', setnom
ToAnalyse = odb.rootAssembly.nodeSets[setnom].nodes[0]
listeN=[]
for v in range(len(ToAnalyse)):
listeN=listeN+[(ToAnalyse[v].label)]
#: print 'listeN', listeN

#: creer toute les courbes
session.xyDataListFromField(odb=odb, outputPosition=NODAL, variable=(('COORD',
NODAL, ((COMPONENT, 'COOR1'), (COMPONENT, 'COOR2'), (COMPONENT, 'COOR3'),
)), ('S', INTEGRATION_POINT, ((COMPONENT, 'S22'), )), ), nodeSets=(
'SET-2', ))

#: extraire coor1 et coor2
liste_coor1=[]
liste_coor2=[]
liste_coor3=[]
liste_s22=[]

for j in range(len(listeN)):
#:for j in range(10):
word='COORD:COOR1 PI: PART1-1 N: '+ '%d' % listeN[j]
x0 = session.xyDataObjects[word]
elem=x0[0][1]
liste_coor1=liste_coor1 + [elem]

word='COORD:COOR2 PI: PART1-1 N: '+ '%d' % listeN[j]
x0 = session.xyDataObjects[word]
elem=x0[0][1]
liste_coor2=liste_coor2 + [elem]

word='COORD:COOR3 PI: PART1-1 N: '+ '%d' % listeN[j]
x0 = session.xyDataObjects[word]
elem=x0[0][1]
liste_coor3=liste_coor3 + [elem]

word='S:S22 PI: PART1-1 N: '+ '%d' % listeN[j]
x0 = session.xyDataObjects[word]
elem=x0[1][1]
liste_s22=liste_s22 + [elem]

print 'noeud: ', (j+1), ' sur: ', len(listeN)


#: ecrire les données dans un fichier
file=open(nom_sortie,'w')
file.write(' \n' )
file.write(' label, coor1, coor2, coor3, s22 ')
file.write(' \n' )
for j in range(len(listeN)):
#:for j in range(10):
file.write('%10.10E ' % listeN[j])
file.write('%10.10E ' % liste_coor1[j])
file.write('%10.10E ' % liste_coor2[j])
file.write('%10.10E ' % liste_coor3[j])
file.write('%10.10E ' % liste_s22[j])
file.write(' \n' )

file.close()

RE: Post-Processing the stress in a section

Can't be of too much help, but I can say that the easiest way to go about scripting python in abaqus is to open a new session, do what it is you want to do manually, and then start with the *.rpy file for that session, which should included python commands for everything you did via the CAE window.

That may be what you have done already, but I thought I'd mention it.

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