×
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

Script to Create new ODB with selected results

Script to Create new ODB with selected results

Script to Create new ODB with selected results

(OP)
Hi all,

I've got a rather large abaqus 6.9.1 model with a random response analysis.

I do not have CAE, and the pre/post processor that I do have (NX 7.5 or I-DEAS 6) will not recognize the output variables from the output decks (RS, RE, RU, etc).

I'm wondering if it would be possible to rewrite the RS, RE, RU results from each frame into a new ODB file as S, E, U so that my pre/post processor will read them.

I've got some of the simple Python examples working that are contained in the documentation, but I can't get the results written into the new odb file.  I keep getting errors on the uFile.addData( ) line.

I'm trying to follow the procedures in 9.5, 9.6, and 9.10.2 of the Scripting User's Manual.

Any help wold be appreciated, also, if there's an easier way I'd like to hear your suggestions.

Thanks.

 

RE: Script to Create new ODB with selected results

(OP)
So I wrote the following script to test changing the 'RS' result set to an 'S' result set.

It appears to work when looking at the console window, but my pre/post processor doesn't recognize that an additional step has been added.

Do I need to change something else in the ODB file for this?  I'm not sure why the new step isn't seen when importing the new ODB file.

The "first ODB file" in the code below refers to the file with the random results, the "second ODB file" is the same model, but with just a 1g static load applied.  I'm moving the RMS data to the 1G file just to have a smaller ODB to import when I'm done.

Thanks.


=======================
## Open First ODB File:
print '-'
print '-First ODB File: '
print '----------------'
##odbName=raw_input('Enter ODB File Name: ') ## (uncomment for user input)
##odbRandom=openOdb(path=odbName)            ## (uncomment for user input)
odbRandom=openOdb(path="MDExample.odb")

## Print Step Names:
print '-'
print '-Steps:'
for stepName in odbRandom.steps.keys():
    print ' ', stepName
print '-'

## Set Active Step:
##
##stepName=raw_input('Enter Step Name: ')  ## (uncomment for user input)
##stepRandom=odbRandom.steps[stepName]     ## (uncomment for user input)
stepRandom=odbRandom.steps['RandomDOF2']
print ' Selected Step = ', stepRandom.name

## Print Number of Frames:
numberOfFrames=len(stepRandom.frames)
print ' Number of Frames = ', numberOfFrames-1

## Set Active Frame:
frameRandom=stepRandom.frames[-1] ## automatically select last frame
print ' Selected Frame = ', frameRandom.frameId

## Load Results:
print '-'
print ' Results Found: '
for fieldName in frameRandom.fieldOutputs.keys():
    print ' ', fieldName
##odbSelectResultsName=raw_input('Enter Results Name: ') ## (uncomment for user input)
##odbSelectResults=openOdb(path=odbSelectResultsName)    ## (uncomment for user input)
odbSelectResults=frameRandom.fieldOutputs['RS']
print '-'
print ' Selected Results = ', odbSelectResults.name
##for s in odbSelectResults.values: ## Test to see data entries
##    print s.elementLabel, s.data

## Open Second ODB File:
print '-'
print '-Second ODB File: '
print '-----------------'
##odbName=raw_input('Enter ODB File Name: ') ## (uncomment for user input)
##odbRandom=openOdb(path=odbName)            ## (uncomment for user input)
odbWrite=openOdb(path="MDExample_1G.odb")

## Print Step Names:
print '-'
print '-Steps:'
for stepName in odbWrite.steps.keys():
    print ' ', stepName
print '-'

## Set Active Step:
##
##stepName=raw_input('Enter Step Name: ')  ## (uncomment for user input)
##stepRandom=odbRandom.steps[stepName]     ## (uncomment for user input)
stepWrite=odbWrite.steps['StaticLoad']
print ' Selected Step = ', stepWrite.name

## Print Number of Frames:
numberOfFrames=len(stepWrite.frames)
print ' Number of Frames = ', numberOfFrames-1

## Set Active Frame:
frameWrite=stepWrite.frames[-1] ## automatically select last frame
print ' Selected Frame = ', frameWrite.frameId

## Load Results:
print '-'
print ' Results Found: '
for fieldName in frameWrite.fieldOutputs.keys():
    print ' ', fieldName
##odbSelectResultsName=raw_input('Enter Results Name: ') ## (uncomment for user input)
##odbSelectResults=openOdb(path=odbSelectResultsName)    ## (uncomment for user input)
odbWriteResults=frameWrite.fieldOutputs['S']
print '-'
print ' Selected Results = ', odbWriteResults.name
#for s in odbWriteResults.values: ## test to see data entries
#    print s.elementLabel, s.data

## Combine Results:
newDataSet=odbSelectResults+odbWriteResults

## Save New Field:
newResultsStep=odbWrite.Step(name='Test',
                             description='User Defined Results',
                             domain=TIME,
                             timePeriod=0)
newResultsFrame=newResultsStep.Frame(incrementNumber=0,
                                     frameValue=0.0)
newResultsField=newResultsFrame.FieldOutput(name='S',
                                            description='User Defined Results',
                                            type=TENSOR_3D_PLANAR)
newResultsField.addData(field=newDataSet)
odbWrite.save()
## Verify New Step is Written and Data is Entered:
##print '-'
##print '-Steps:'
##for stepName in odbWrite.steps.keys():
##    print ' ', stepName
##print '-'
##print '-'
##print ' Results Found: '
##for fieldName in odbWrite.steps['Test'].frames[-1].fieldOutputs.keys():
##    print ' ', fieldName
##for s in odbWrite.steps['Test'].frames[-1].fieldOutputs['S'].values:
##    print s.elementLabel, s.data

## Close ODB files:
odbRandom.close()
odbWrite.close()
 

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