The model data base object (mdb) is the root object, containg sub-objectes, properties and methods that contains sub-objects, properties and methods,... and so the story goes.
You may find the illustration of the tree-structure useful, but please note that it is far from complete. A ton of more items is to be found in the model database...
mdb
|
------------------------------------------------------------------------------
| | | | | | |
models jobs Model() Job() save() close() ...
|
-------------------------------------------
| | | | |
'M1' 'M2' 'M3' 'M4' ...
|
---------------------------------------------------------
| | | | | |
parts steps Part() Step() rootAssembly ...
| |
----------------------- ---------------------------------------------------
| | | | | | | | |
'P1' 'P2' 'P3' ... instances datums ... deleteFeatures() ...
|
------------------------------------------
| | | | |
faces elements ... getVolume() ...
|
-------------------------------
| | |
[FaceArray] findAt() pointsOn
For instance, mdb
contains several Constructors such as Model()
and Job()
. These are methods (functions) that creates new objects and starts with a capital letter. Other methods include save()
and close()
which sounds familiar without further explanation.
Objects such as models and jobs are stored in Repositories. Hence, both models
and jobs
are repositories. Repositories are containers that store a particular type of object; for example, the models repository contains all the models defined in the model database, while the parts repository contains all the parts in a model. An ABAQUS Scripting Interface Repository maps a key to a value. The key is usually a String, and the value is any Python object, usually an ABAQUS object object. A repository is similar to a Python dictionary; however, only a constructor can add an object to a repository. In addition, all of the objects in a repository are of the same base type.
A model have several repositories, such as parts
and steps
created by the respective constructors, i.e. Part()
and Step()
. A model also have a single object called rootAssembly
which again contains many repositories, properties and methods.
A single part may contain for instance faces
, elements
and nodes
. These are Sequences. Lists, tuples, and arrays are sequences in standard Python. In addtion, the Abaqus Scripting Interface defines its own sequences that contain objects of the same type, as well as methods. Geometrical items, elements and nodes are examples of entities found in sequences.
Example A model database contains 3 models. One model is named 'M1' and it has a solid part (brick) with geometrical items:
>>> print mdb.models
{'M1': 'Model object', 'M2': 'Model object', 'M3': 'Model object'}
>>> print mdb.models['M1'].parts
{'P1': 'Part object'}
>>> print mdb.models['M1'].parts['P1'].faces
['Face object', 'Face object', 'Face object', 'Face object',
'Face object', 'Face object']
>>>
The faces
object has several methods, for instance getBoundingBox()
that returns data for extreem coordinates:
>>> mdb.models['M1'].parts['P1'].faces.getBoundingBox()
{'high': (42.5, 25.0, 5.0), 'low': (0.0, 0.0, 0.0)}
or methods that returns a new sequence (FaceArray) of faces, in this case just one face in the array:
>>> somefaces = mdb.models['M1'].parts['P1'].faces.getByBoundingBox( xMin= 40, xMax= 50)
>>> print somefaces
['Face object']
A single face has also methods and properties. The properties for the first face in faces
:
>>> print mdb.models['M1'].parts['P1'].faces[0]
({'featureName': 'Solid extrude-1', 'index': 0, 'instanceName': None, 'isReferenceRep': False,
'pointOn': ((0.0, 8.333333, 3.333333),)})
indicating that a point on the face is
>>> print mdb.models['M1'].parts['P1'].faces[0].pointOn
((0.0, 8.333333, 3.333333),)
All properties and methods of objects can be listed by dir()
such as:
>>> dir(mdb.models['M1'].parts['P1'].faces[0])
['__class__', '__cmp__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__',
'__hash__', '__init__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'featureName', 'getAdjacentFaces', 'getCADAttributes',
'getCells', 'getCentroid', 'getCurvature', 'getEdges', 'getElementFaces', 'getElements', 'getFacesByCurvature',
'getFacesByFaceAngle', 'getNodes', 'getNormal', 'getRadius', 'getSize', 'getVertices', 'index', 'instanceName',
'isNormalFlipped', 'isReferenceRep', 'pointOn']
>>>