Writing model data

To define the geometry of your model, you first create the parts that are used by the model and then you add nodes and elements to the parts. You then define the assembly by creating instances of the parts. If the output database already contains results data, you should not change the geometry of the model. This is to ensure that the results remain synchronized with the model.

Part

If the part was created by Abaqus/CAE, the description of the native Abaqus/CAE geometry is stored in the model database, but it is not stored in the output database. A part is stored in an output database as a collection of nodes, elements, surfaces, and sets. You use the Part constructor to add a part to the Odb object. You can specify the type of the part; however, only DEFORMABLE_BODY is currently supported. For example,

part1 = odb.Part(name='part-1', 
    embeddedSpace=THREE_D, type=DEFORMABLE_BODY)

For a full description of the Part constructor, see OdbPart object. The new Part object is empty and does not contain geometry. After you create the Part object, you add nodes and elements.

You use the addNodes method to add nodes by defining node labels and coordinates. You can also define an optional node set. For example,

nodeData = (  (1, 1,0,0),  (2, 2,0,0),  
              (3, 2,1,0.1),  (4, 1,1,0.1),  
              (5, 2,-1,-0.1),  (6, 1,-1,-0.1), ) 
part1.addNodes(nodeData=nodeData, nodeSetName='nset-1') 

For a full description of the addNodes command, see addNodes(...).

After you have created nodes, you can use the NodeSetFromNodeLabels constructor to create a node set from the node labels. For more information, see NodeSetFromNodeLabels(...).

Similarly, you use the addElements method to add elements to the part using a sequence of element labels, element connectivity, and element type. You can also define an optional element set and an optional section category. For example,

# Set up the section categories

sCat = odb.SectionCategory(name='S5', 
    description='Five-Layered Shell')

spBot = sCat.SectionPoint(number=1, 
    description='Bottom')
spMid = sCat.SectionPoint(number=3, 
    description='Middle')
spTop = sCat.SectionPoint(number=5, 
    description='Top')

elementData = ((1, 1,2,3,4),
               (2, 6,5,2,1),)
part1.addElements(elementData=elementData, type='S4',
    elementSetName='eset-1', sectionCategory=sCat)

For a full description of the addElements command, see addElements(...).

The RootAssembly object

The root assembly is created when you create the output database. You access the RootAssembly object using the same syntax as that used for reading from an output database.

odb.rootAssembly

You can create both instances and regions on the RootAssembly object.

Part instances

You use the Instance constructor to create part instances of the parts you have already defined using the Part constructor. For example,

a = odb.rootAssembly
instance1 = a.Instance(name='part-1-1', object=part1)

You can also supply an optional local coordinate system that specifies the rotation and translation of the part instance. You can add nodes and elements only to a part; you cannot add elements and nodes to a part instance. As a result, you should create the nodes and elements that define the geometry of a part before you instance the part. For a full description of the Instance command, see OdbInstance object.

Regions

Region commands are used to create sets from element labels, node labels, and element faces. You can create a set on a part, part instance, or the root assembly. Node and element labels are unique within an instance but not within the assembly. As a result, a set on the root assembly requires the names of the part instances associated with the nodes and elements. You can also use region commands to create surfaces. For example,

# An element set on an instance
eLabels = [9,99]
elementSet = instance1.ElementSetFromElementLabels(
    name='elsetA',elementLabels=eLabels)
# A node set on the rootAssembly
nodeLabels = (5,11)
instanceName = 'part-1-1'
nodeSet = assembly.NodeSetFromNodeLabels(
    name='nodesetRA',nodeLabels=((instanceName,nodeLabels),))

The region commands are described in Region commands.

Materials

You use the Material object to list material properties.

Materials are stored in the materials repository under the Odb object.

To create an isotropic elastic material, with a Young's modulus of 12000.0 and an effective Poisson's ratio of 0.3 in the output database:

    materialName = "Elastic Material"
    material_1 = odb.Material(name=materialName)
    material_1.Elastic(type=ISOTROPIC,table=((12000,0.3),))

For more information, see Material commands.

Sections

You use the Section object to create sections and profiles.

Sections are stored in the sections repository under the Odb object.

The following code creates a homogeneous solid section object. A Material object must be present before creating a Section object. An exception is thrown if the material does not exist.

    sectionName = 'Homogeneous Solid Section'
    mySection = odb.HomogeneousSolidSection( 
                      name = sectionName, 
                      material = materialName, 
                      thickness = 2.0)       

To create a circular beam profile object in the output database:

    profileName = "Circular Profile"
    radius = 10.00
    odb.CircularProfile(name = profileName, r = radius)       
Section assignments

You use the SectionAssignment object to assign sections and their associated material properties to regions of the model. SectionAssignment objects are members of the Odb object. For a full description of the assignSection method, see assignSection(...).

All Elements in an Abaqus analysis need to be associated with section and material properties. Section assignments provide the relationship between elements in an Instance object and their section properties. The section properties include the associated material name. To create an element set and assign a section:

    elLabels = (1,2)
    elset = instance.ElementSetFromElementLabels(
    name=materialName, elementLabels=elLabels)
    instance.assignSection(region=elset,section=section)