#!/user/bin/python
# -* - coding:UTF-8 -*-
# 本脚本的功能是创建输出数据库,添加模型数据和场数据
# 并将场数据作为默认的变形输出变量
from odbAccess import *
from odbMaterial import *
from odbSection import *
from abaqusConstants import *
# 创建输出数据库ODB,同时将创建根装配rootAssembly
odb = Odb(name='simpleModel',analysisTitle='ODB created with API',
description='example illustrating API ',path='odb_Create_ODB.odb')
# 创建材料
materialName = "Elastic Material"
material_1 = odb.Material(name=materialName)
material_1.Elastic(type=ISOTROPIC,temperatureDependency=OFF,
dependencies=0,noCompression=OFF, noTension=OFF,
moduli=LONG_TERM, table=((12000,0.3),))
# 创建截面
sectiOnName= 'Homogeneous Shell Section'
section_1 = odb.HomogeneousShellSection(name=sectionName,
material=materialName, thickness=2.0)
# 下面将定义模型数据
# 设置截面分类(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')
# 创建只包含2个单元的壳模型,包含4个积分点和5个截面点
part1 = odb.Part(name='part-1', embeddedSpace=THREE_D,type=DEFORMABLE_BODY)
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')
......