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!

deviatoric stress 1

Status
Not open for further replies.

Abaqus_2018

Bioengineer
May 3, 2018
2
Hi
I am going to extract hydrostatic and deviatoric (octahedral) stress from .Odb Abaqus file. I add a Pyton Script code to my .py file and run it, but I got this error "IndentationError: unexpected indent". Can anyone help me to fix it?
Pyton Script is:

from abaqusConstants import *
from odbAccess import *

# ******************************************************************************
# Modify the next variables accordingly:
odbPath = "Z:\ABAQUS\mySimulation" # path to output database
k = 0.5 # 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]
allFrames = session.odbData[odbPath].steps[allSteps].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, ' frameNumber = ', allFrames[j]
odb.save()
odb.close()
 
Replies continue below

Recommended for you

Thank you so much for your help.
I have another problem, I know that .rpy (replay file) creates when Abaqus starts up in working directory, but for some reason, I cannot find it anywhere. I have .odb file in working directory but not .rpy!!! do you know why it happens or how can I access it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor