hiwiansys
Mechanical
- May 4, 2007
- 23
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.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
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.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