加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Abaqus 利用FindAt函数根据坐标查找面

(2016-05-14 13:58:01)
标签:

abaqus

findat

python

分类: Abaqus技术及二次开发
    在ANSYS中可以通过坐标来选取对象,Abaqus虽说没有ANSYS那么方便,但是也还是可以实现的,主要是通过findAt函数,可以选择cell(体)、face(面)、edge(边)和vertex(顶点)。
    This method returns the object or objects in the FaceArray located at the given coordinates.
findAt initially uses the ACIS tolerance of 1E-6. As a result, findAt returns any face that is at the arbitrary point specified or at a distance of less than 1E-6 from the arbitrary point. If nothing is found, findAt uses the tolerance for imprecise geometry (applicable only for imprecise geometric entities). The arbitrary point must not be shared by a second face. If two faces intersect or coincide at the arbitrary point, findAt chooses the first face that it encounters, and you should not rely on the return value being consistent.
    findAt will always try to find objects among all the faces in the part or assembly instance and will not restrict itself to a subset even if the FaceArray represents such subset.
Required argument
coordinates
    A sequence of Floats specifying the X-, Y-, and Z-coordinates of the object to find.
findAt returns either a Face object or a sequence of Face objects based on the type of input.
If coordinates is a sequence of Floats, findAt returns the Face object at that point.
If you omit the coordinates keyword argument, findAt accepts as arguments a sequence of pairs of sequences describing each face's coordinate and normal, and findAt returns a sequence of Face objects at the given locations. If you omit the coordinates keyword argument, you must also omit the normal argument.

faces = f.findAt(((-16.438578, -41.835673, -24.19804), ),
                 ((25.210364, -35.689868, 1.860314), ),
                 ((26.727683, -38.207055, 4.164759), ))

示例:
a = mdb.models['Model-1'].rootAssembly
s1 = a.instances['Part-1-1'].faces
side1Faces1 = s1.getSequenceFromMask(mask=('[#20 ]', ), )
region = a.Surface(side1Faces=side1Faces1, name='Surf-1')
mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1', 
    region=region, distributionType=UNIFORM, field='', magnitude=10.0, 
    amplitude=UNSET)

######选择一个面加载
a = mdb.models['Model-1'].rootAssembly
s1 = a.instances['Part-1-1'].faces
side1Faces1 = s1.findAt(((0.0,0.0,200.0),))
region = a.Surface(side1Faces=side1Faces1, name='Surf-1')
mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1', 
    region=region, distributionType=UNIFORM, field='', magnitude=10.0, 
    amplitude=UNSET)

######选择两个个面加载
a = mdb.models['Model-1'].rootAssembly
s1 = a.instances['Part-1-1'].faces
side1Faces1 = s1.findAt(((0.0,0.0,200.0),),((0.0,5.0,100.0),))
region = a.Surface(side1Faces=side1Faces1, name='Surf-1')
mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1', 
    region=region, distributionType=UNIFORM, field='', magnitude=10.0, 
    amplitude=UNSET)

######选择一个面施加约束
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Part-1-1'].faces
faces1 = f1.findAt(((0.0,0.0,0.0),))
region = a.Set(faces=faces1, name='Set-1')
mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1', 
    region=region, u1=0.0, u2=0.0, u3=UNSET, ur1=UNSET, ur2=UNSET, ur3=UNSET, 
    amplitude=UNSET, fixed=OFF, distributionType=UNIFORM, fieldName='', 
    localCsys=None)
mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')

######选择两个面施加约束
a = mdb.models['Model-1'].rootAssembly
f1 = a.instances['Part-1-1'].faces
faces1 = f1.findAt(((0.0,0.0,200.0),),((0.0,5.0,100.0),))
region = a.Set(faces=faces1, name='Set-1')
mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1', 
    region=region, u1=0.0, u2=0.0, u3=UNSET, ur1=UNSET, ur2=UNSET, ur3=UNSET, 
    amplitude=UNSET, fixed=OFF, distributionType=UNIFORM, fieldName='', 
    localCsys=None)
mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')
 


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有