Application of Python language in Abaqus---2.3.1.1 Overview of Abaqus object model

Based on the Python language, the Abaqus script interface adds many new object models.
The hierarchy and relationship between these objects are called the Abaqus object model.
This article will introduce the relevant knowledge of the Abaqus object model in detail. , including: overview, import module, abstract basic model, query object model, [Tab] key auto-completion function, etc.

1. Overview
The Abaqus object model describes the relationship between various objects
1) Define the methods (methods) and data members (data members)
of the object 2) Define the mutual relationship between objects : these relationships constitute the structure or hierarchy of the object model

The relationship between objects includes:
1) Ownership : Ownership defines the path to access objects. For example, Part objects are composed of geometric objects such as bodies, faces, edges, and points; Model objects own Part objects. The ownership relationship indicates: if an object is copied or deleted, everything owned by the object is copied or deleted
2) Association : Association describes the relationship between objects, mainly including: whether an object is referenced (referred to) Another object; whether an object is an instance of another object, etc. For example: Material is one of the members of the Section object, or the Section object refers to the Material object. Based on the Python language, the Abaqus script interface extends more than 500 objects, and there are associations between objects.
The Abaqus object model contains three root (root) objects, namely
1) session object
2) Mdb object
3) Odb object

Most of the Abaqus script interfaces start with these three root objects, such as:

session.viewports['Viewport-1'].bringToFront()
mdb.models['wheel'].rootAssembly.regenerate()
stress = odb.steps['Step-1'].frames[3].fieldOutputs['S']

The objects in the Abaqus object model can be divided into two cases:
1) container : the container is composed of objects of the same type, such as jobs in the mdb model is a container containing multiple analysis jobs, and the container can be a repository (repository ), can also be a sequence (sequence).
2) Single object (singular object) : If the object does not belong to the container, it must be a single object. For example: Session object and Mdb object are separate objects.

1. Session object
Use the following statements to import Session objects

from abaqus import *
from abaqus import session

The Session object defines the viewport (viewports) object , the remote queue (queues) object and the view (views) object , etc.

2. Mdb object
Mdb object refers to the object saved in the model database (mdb), which is composed of Model object and Job object . Use the following statement to import:

from abaqus import *
from abaqus import mdb

The Model object is composed of Part object, Section object, Material object, Step object, etc. The Model object separates the Job object separately. The object model of the Job object is relatively simple and direct, and does not belong to any object. The Job object refers to the Model object, but the Model object does not own the Job object.

3. Odb object
Use the following statement to import Odb object

from abaqus import *
from abaqus import openOdb, Odb

Odb objects are stored in the output database (odb), which consists of model data (model data) and result data (result data).

When scripting, use commands to step through objects. For example, use the following command to access the 4th (5th) element in the cells library through the path of the Cell object:

cell4 = mdb.models['block'].parts['crankcase'].cells[4]

This line of code stores the fifth element named crankcase in the model database block in the variable cell4, reflecting that the Part object owns the Cell object, the Model object owns the Part object, and the Mdb object owns the Model object. When viewing the ownership of objects in a command, it is recommended to read from right to left.

Guess you like

Origin blog.csdn.net/qq_35412059/article/details/106247096