Download ABAQUS Scripting User's Manual

Transcript
EXAMPLE PROGRAMS THAT ACCESS DATA FROM AN OUTPUT DATABASE
//
//
//
//
//
Code to compute a stress range from
all the load cases in a step.
The stress range is saved to a frame with the
description "Stress Range"
// System includes
// Begin Local Includes
#include <odb_API.h>
#include <omi_iostream.h>
// End Local Includes
odb_FieldOutput computeStressRange( odb_Step& step );
int ABQmain(int argc, char **argv)
{
if( argc < 3 ) {
cerr << "Usage: abaqus stressRange.x odb_name"
<<
"step_name"
<<
endl;
return 1;
}
odb_String odbName(argv[1]);
odb_String stepName(argv[2]);
cout << "Computing for odb \"" << odbName << "\"";
cout << " and step \"" << stepName << "\"." << endl;
// compute stress range and save to odb
odb_Odb& odb = openOdb(odbName);
odb_Step& step = odb.steps()[stepName];
odb_FieldOutput range = computeStressRange(step);
// Save the results in the output database.
odb_Frame rangeFrame = step.Frame(0, 0, "Stress Range");
rangeFrame.FieldOutput(range, "S11 Range");
odb.save();
odb.close();
9–87