×
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

Create Custom Field Output

Create Custom Field Output

Create Custom Field Output

(OP)
Hi Abaqus experts out there,

I am trying to create custom Field Output in Abaqus, where I relate two types of stress invariants to each other, for example MISES and PRESSURE, e.g.:
s15f1_MISESMAX - 0.35 * s15f1_PRESSONLY (--> s15f1 = step 15 frame 1)

I know how to do this inside the Visualization module using the Create Field Output dialog box (Tools > Create Field Output > From Fields): this creates a Field Output object, but with the following limitations:
- Only stored as temporary step (by default: "Session Step") and not permanently saved to the ODB.
- Only applicable for 1 step and 1 frame (by default: last step and last frame) and not for more/all steps/frames.

I would like to overcome the above limitations, and make this custom Field Output 1) permanently available in the ODB, and 2) have this available for all analysis steps. However, at this point I do not know how to do this or where to even start (as I am a scripting newbie), and this is where I need your help...

My questions:
1) Should the focus be to manipulate the job input file (*.INP) or output database (*.ODB) to create this additional custom Field Output in the ODB?
2) Is it required to create a macro which records a sequence of Abaqus Scripting Interface commands or write a custom Python script for this? Or is there a more simple straightforward solution (like e.g. adding lines of Abaqus keyword commands to the job input file)?

Any help or suggestions are highly appreciated!

Kind regards,
David

RE: Create Custom Field Output

Record and save a macro and then edit the .rpy file. You should be able to see how the python script was written without knowing much about python.

RE: Create Custom Field Output

(OP)
Hi corus,

Thanks for your help and sorry for my delayed response...
After aquiring the basic skills of Python programming, reading the Abaqus Scripting User's Manual, consulting the Abaqus Scripting Reference Manual, and analyzing the macro/replay file as you suggested, I put together the puzzle pieces into the below Python script. This script accomplished my desired task, and writes the custom Field Output (in my case 'Osteogenic Index') back to the Abaqus output database (*.ODB) for all analysis steps (independently of their names) and all frames.

Hope this code can be of any help for others facing similar tasks in the future...

David

----------------------------------------------

from abaqusConstants import *
from odbAccess import *

# ******************************************************************************
# Modify the next variables accordingly:
odbPath = "D:\\Temp\\database_name.odb"         # path to output database
k = 0.35                                        # constant in 'Osteogenic Index'
# ******************************************************************************

odb = session.openOdb(name=odbPath,readOnly=FALSE)
allSteps = session.odbData[odbPath].steps.keys()
for i in range(len(allSteps)):
step = odb.steps[allSteps[i]]
allFrames = session.odbData[odbPath].steps[allSteps[i]].frames.keys()
for j in range(len(allFrames)):
frame = step.frames[j]
octahedral = (sqrt(2)/3) * frame.fieldOutputs['MISESONLY']
hydrostatic = frame.fieldOutputs['PRESSONLY']
OImaxmin = octahedral - k * hydrostatic
newField = frame.FieldOutput(name='OImaxmin', description='Osteogenic Index', field=OImaxmin)
print 'stepName = ', allSteps[i], ' frameNumber = ', allFrames[j]
odb.save()
odb.close()

# You must re-open the output database to see the new custom field output

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