Download Abaqus Scripting User's Manual
Transcript
READING FROM AN OUTPUT DATABASE
Part instances
Part instances are stored in the instance repository under the OdbAssembly object. The
following statements display the repository keys of the part instances in the tutorial output
database:
odb_InstanceRepositoryIT instIter(rootAssy.instances());
for (instIter.first(); !instIter.isDone(); instIter.next())
cout << instIter.currentKey().CStr() << endl;
The output database contains only one part instance, and the resulting output is
PART-1-1
From a part instance or part you can retrieve the node and element information as follows:
{
odb_Instance& instance1 =
rootAssy.instances()["PART-1-1"];
odb_Enum::odb_DimensionEnum instanceType =
instance1.embeddedSpace();
const odb_SequenceNode& nodeList = instance1.nodes();
int nodeListSize = nodeList.size();
if (instanceType == odb_Enum::THREE_D) {
for (int n=0; n<nodeListSize; n++) {
const odb_Node node = nodeList[n];
int nodeLabel = node.label();
const float* const coord = node.coordinates();
cout << "Xcoord: " << coord[0] << " , Ycoord: "
<< coord[1] << " , Zcoord: " << coord[2] << endl;
}
}
else if((instanceType == odb_Enum::TWO_D_PLANAR) ||
(instanceType == odb_Enum::AXISYMMETRIC)) {
for (int n=0; n<nodeListSize; n++) {
const odb_Node node = nodeList[n];
int nodeLabel = node.label();
const float* const coord = node.coordinates();
cout << "Xcoord: " << coord[0] << " , Ycoord: "
<< coord[1] << endl;
}
}
10–21
Abaqus ID:
Printed on: