Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Create and display a user-defined field output with a Python script

Status
Not open for further replies.

FlamengoDomingo

New member
May 17, 2013
3
Hello everybody,

I'm using a Python script to run my model with Abaqus 6.12-1.
I post-processed my data outside the software and now I would like to visualize them into Abaqus.

I wrote the following code to create my own fieldOutput object:
Python:
OdbName = 'Job-1.odb'
myodb = odbAccess.openOdb(path=OdbName)
myOdbInstance = myodb.rootAssembly.instances['MYINSTANCE']
myFrame = myodb.steps['myStep'].frames[-1] # Use the last frame of the calculation

nodesLabels = [0,1,2] # list with all the node labels (example)
stresses = [[1,2,3,4,5,6],[1,2,3,4,5,6],[1,2,3,4,5,6]] # list with all the components of the stresses (example)

# Create a fieldOuput object
myFieldOutput = myFrame.FieldOutput(name='VARI',description='my specific variable for my fieldOutput object', type=TENSOR_3D_FULL)

# Put my post-processed data in my fieldOutput object
myFieldOutput.addData(position=NODAL, instance=myOdbInstance, labels=nodesLabels, data=stresses)

I checked that my fieldOutput object has been created:
myFrame.fieldOutputs.keys('')
And I get:
Python:
['COORD', 'E', 'EVOL', 'Extrap. E', 'Extrap. S', 'S', 'VARI', 'U']

Thus my field - 'VARI' - is correctly created but I don't know how to display it within Abaqus viewport as I can't see it in the fieldOutput dialog box.

Is somebody have an idea?
Thank you in advance for what you can do,
 
Replies continue below

Recommended for you

Hi,
have you added

myOdb.save()
myOdb.close()

at the end of your script??

[wink]
 
Did you actually get this working with the code you have above (type = TENSOR_3D_FULL and Position = NODAL)?

I am trying to do this and it will add the data to the odb. Everything appears to be correct, but the results will not display in Viewer. It gives an error message.

If I use Type=VECTOR I can add 3 components to the nodes, but 6 will not work for me....

I am thinking there is a limitation on the number of fieldvalues that can be assigned to a node (limited to 3)? But if this worked for you with 6 values than I'm still lost.

Let me know.

Thanks,

Jeff
 
You are right I effectively put (CENTROID and TENSOR_3D_FULL) or (NODAL and VECTOR) so I have the same limitation.

Cheers,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor