Create and display a user-defined field output with a Python script
Create and display a user-defined field output with a Python script
(OP)
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:
I checked that my fieldOutput object has been created:
myFrame.fieldOutputs.keys('')
And I get:
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,
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:
CODE --> 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:
CODE --> 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,





RE: Create and display a user-defined field output with a Python script
have you added
myOdb.save()
myOdb.close()
at the end of your script??
RE: Create and display a user-defined field output with a Python script
You were right I forgot to save it!
Thank you for the help ;)
RE: Create and display a user-defined field output with a Python script
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
RE: Create and display a user-defined field output with a Python script
Cheers,