Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

abaqus historyOutput

Status
Not open for further replies.

xchhen

Mechanical
Jun 18, 2010
6
0
0
JP
Dear viewers:

I tried to use the following python commands to get the time-displacement of a specified node. Unfortunately, an error such as " keyError:U" appeared. I can not find the errors in my commands lines, but should have. So , is there anyone who can help me to check it?? thank you in advance.

import odbAccess
step2 = odb.steps['stud']
kk=odb.rootAssembly.instances['IPCONCRETE'].nodes[0]
point1=odbAccess.HistoryPoint(node=kk)
region = step2.HistoryRegion(name='IPCONCRETE',description='dd',point=point1)

u2Data = region.historyOutputs['U2'].data

 
Replies continue below

Recommended for you


Dear optimaster or other viewers:
unfortunately, it does not work, I tried the following command lines,
(Also, I thought it was because of I did not order the histroyoutput on displacement. Thus I set the histroyoutput on 'U'. then I tested , but it still can not work)

Anyway , according to abaqus analysis user's manual, u3 is refer to an output variable of "historyoutput odb".So I am deeply confused why this error happened , indicating that u3 is not defined or somthing like that.

import odbAccess
from odbAccess import *
from abaqusConstants import *
import string
odb = openOdb(path='Job-2.odb')

step2 = odb.steps['test']
kk=odb.rootAssembly.instances['PART-1-1'].nodes[325]
point1=odbAccess.HistoryPoint(node=kk)
region = step2.HistoryRegion(name='IPCONCRETE',description='dd',point=point1)
u2Data = region.historyOutputs['U3'].data #error happens

also I tried to use:
u2Data = region.HistoryOutput(name='U3',description='dd',type=SCALAR)

the error disappeared, but
if I use
print u2Data.data

Nothing happed.

Attached is my test odb file. please do me a favor to check it .

 
 http://files.engineering.com/getfile.aspx?folder=57162ddb-7dcf-4a5a-825b-202a8c84a8fc&file=Job-2.rar
Hi,

please see following script:

...
#
import odbAccess
#
# user data
#
fileName = 'Job-2.odb'
stepName = 'test'
historyRegionName = 'Node PART-1-1.325'
historyOutputName = 'U3'
#
# open odb file
ODBFile = odbAccess.openOdb(path = fileName)
#
# assign step object
# print ODBFile.steps.keys()
step = ODBFile.steps[stepName]
#
# assign historyRegion object
# print step.historyRegions.keys()
historyRegion = step.historyRegions[historyRegionName]
#
# assign historyOutput object
# print historyRegion.historyOutputs.keys()
historyOutput = historyRegion.historyOutputs[historyOutputName].data
...

To work script needs variables defined in user section:
fileName - name of odb file
stepName - name of step from which we need to get history outputs
historyRegionName - name of region with history outputs, the name is in format 'Node instanceName.nodeNumber', so for your example it will be: 'Node PART-1-1.325'. This format is correct only for node history outputs. It can look different and it depend what kind of data are in history output.
historyOutputName - name of outputs type from region defined earlier, e.g. for displacement in z-direction it is: 'U3'

Variable "historyOutput" contains tuple with data in format ((time, u3), (time, u3), ...)
If you want to check steps, history regions and history outputs names uncomment line started with print command.

More information about how to get history data from odb with python you can find in Abaqus documentation: 9.5.8 Reading history output data.

Regards,
Barten
 
HI Barten,

First , I am really appreicate you help me solve this problem . It confused me so much.

Second,
I compared your scripts with my original scripts. The cirtical problematic lines in mine are :

# setup odbMeshNode object
#
kk=odb.rootAssembly.instances['PART-1-1'].nodes[325]
#
# setup HistoryPoint object
#
point1=odbAccess.HistoryPoint(node=kk)
#
# setup historyRgions object
#
region = step2.HistoryRegion(name='IPCONCRETE',description='dd',point=point1)

and you choose formatted historyReions name.

'Node PART-1-1.325'

Acturally, I wrote my original problematic command lines based on '9.6.6 Writing history output data'.

Before I wrote them, I succeeded in getting other values in the fieldOutput by setting up NodeSet through using the related command lines in "Regions" of "9.6.1Writing model data".

Therefore,I thought I could analogously set up the related historyregions by writing above commands to the histroy output database. However the following command line failed.

u2Data = region.historyOutputs['U3'].data #error happens
keyError:U3


So, do you konw why can't I establish the related historyPoint and histroyRegion by using the scriping command existing in the " scripting reference mannual"?
or dose it mean HistoryPoint(node=kk) and .HistoryRegion() can be just used in pure process of writing historyoutput?

Regards!







 
Hi again,

Do you want to write history output data into odb file or read them from odb file? It is not clear for me.

Lets take a look for your script. In following line:
region = step2.HistoryRegion(name='IPCONCRETE',description='dd',point=point1)
you created a new history region in your odb with name 'IPCONCRETE'. This region is empty and has no history outputs inside. You can add your own history outputs with constructor HistoryOutput.
This is a reson why in next line you are getting an error.
Since history region assigned to variable 'region' is empty python cannot find 'U3' key inside respository and gives you the error message.

Regrads,
Barten
 
I'm not sure why you need python scripts as I usually just create XY data and select field output, and the required nodal variable and node.

Tata
 
Hi, Barten
Thank you , I understand now.
I misunderstood the meaning of creating a new historyregion.

By the way , is this the only way we call an existing region??
historyRegionName = 'Node PART-1-1.325'

In "9.5.8 Reading history output data", only some examples like below are mentioned. If possible , I need some more imformations on this histroyRegion calling format.
'Node PART-1-1.1000'
'Element PART-1-1.1 Int Point 1'



TO CORUS

I need to do post data operation in other softwares. SO data expotr is important.
Only xydata is not enough.

 
>>> I need some more imformations on this histroyRegion calling format
If you are thinking about some kind of rules using to creating names I never found such informations in documentation.
I always print all region names and choose what I need to.
To print names you can use command:
...
print step.historyRegions.keys()
...

Of course you need open odb file and assign step object to 'step' variable.

Regards,
Barten


 
Status
Not open for further replies.
Back
Top