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!

Create newfield with the results from the mid-section of beam elements

Status
Not open for further replies.

mellejgr

Materials
Feb 4, 2019
8
0
0
GB
Hi all,
I am working on a script that creates a field output in an odb containing beam elements. I want to do something really simple, to create an element output with the average of the top and bottom section point strain(average of section point 1 and 5)

To extract the 'bottom' data I try the following:

frame = step.frames[j]
field = frame.fieldOutputs['E'] E11=field.getScalarField(componentLabel="E11").getSubset(sectionPoint=odb.SectionCategory(name='SC',description='n/a').SectionPoint(number=1,description='Bottom'))

and similar for the 'top'.

The code runs without error, but does not create a field output. I think there must be an easier / better way to achieve this. Essentially, I would like to retrieve the element data from the middle of the elements (section point 3?) and then write to a new field.

Any ideas of how this can be achieved? Help would be much appreciated.
 
Replies continue below

Recommended for you

Hi, thank you for your reply.

I run the script through the command line, typing something like: 'abaqus cae nogui=Scriptname.py'

The full code is:

from abaqusConstants import *
from odbAccess import *

odbPath = 'C:/Users/UB53/Desktop/WORKFOLDER/EP-SENt/HEX/average/H100_S10_M12.odb/' # path to output database
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]
field = frame.fieldOutputs['E']
E11=field.getScalarField(componentLabel="E11").getSubset(sectionPoint=odb.SectionCategory(name='SC',description='n/a').SectionPoint(number=1,description='Bottom'))

newField = frame.FieldOutput(name='E-test2', description='E-test2', field=E11)

print 'stepName = ', allSteps, ' frameNumber = ', allFrames[j]
odb.save()
odb.close()

Any suggestions?
 
Status
Not open for further replies.
Back
Top