abaqus-python 利用getByBoundingCylinder(...)创建单元集合

1 命令解释

命令解释:返回包含在指定空间圆柱中的几何元素或者网格元素的对象序列 ,下面是帮助文档中对于这个命令的解释:

getByBoundingCylinder(...)

This method returns an array of element objects that lie within the specified bounding cylinder.

Required arguments

center1

A tuple of the X-, Y-, and Z-coordinates of the center of the first end of the cylinder.

center2

A tuple of the X-, Y-, and Z-coordinates of the center of the second end of the cylinder.

radius

A float specifying the radius of the cylinder.

Optional arguments

None.

Return value

MeshElementArray object, which is a sequence of MeshElement objects.

主要就是指定圆柱体的上下端面的圆心以及半径,返回的是elemets编号序列。

在学习的时候被网上的帖子和帮助文档误导(其实是新新手的缘故),命令老写成这个样子:

elist = e.getByBoundingCylinder(7,6,0,7,6,20,5.8)
# 正确命令:
elist = e.getByBoundingCylinder(center1=(7,6,0),center2=(7,6,20),radius=5.8)
abaqus python 二次开发攻略 P195,P196
abaqus 用户帮助文档

2 简单案例

案例简介:选取多个圆柱体框中的单元并创建为集合。

具体命令:

################################
# 可以运行#######
from abaqus import*
from abaqusConstants import*
p = mdb.models['Model-3'].parts['Part-1']
e = p.elements
elist_I = e.getByBoundingCylinder(center1=(7,6,0),center2=(7,6,20),radius=5.8) 
elist = elist_I
elist_I = e.getByBoundingCylinder(center1=(21,6,0),center2=(21,6,20),radius=5.8)
elist = elist+elist_I
p.Set(elements=elist,name='Set-matrix')
print(type(elist)) # <type 'Sequence'>
abaqus-python 利用getByBoundingCylinder(...)创建单元集合的图1
abaqus-python 利用getByBoundingCylinder(...)创建单元集合的图2

这就是运行结果。

希望可以帮助到各位,若有错误请多多指教!

登录后免费查看全文
立即登录
默认 最新
当前暂无评论,小编等你评论哦!
点赞 2 评论 收藏 1
关注