声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2486|回复: 0

Abaqus 利用FindAt函数根据坐标查找线(弧线)

[复制链接]
发表于 2016-5-20 11:22 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
  在ANSYS中可以通过坐标来选取对象,Abaqus虽说没有ANSYS那么方便,但是也还是可以实现的,主要是通过findAt函数,可以选择cell(体)、face(面)、edge(边)和vertex(顶点)。
  This method returns the object or objects in the EdgeArray located at the given coordinates.
  findAt initially uses the ACIS tolerance of 1E-6. As a result, findAt returns any edge 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 edge. If two edges intersect or coincide at the arbitrary point, findAt chooses the first edge that it encounters, and you should not rely on the return value being consistent.
  findAt will always try to find objects among all the edges in the part or assembly instance and will not restrict itself to a subset even if the EdgeArray 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 an Edge object or a sequence of Edge objects based on the type of input.
  If coordinates is a sequence of Floats, findAt returns the Edge object at that point.
  If you omit the coordinates keyword argument, findAt accepts as arguments a sequence of sequence of floats in the following format:

  edges = e.findAt(((20.19686, -169.513997, 27.798593), ),
  ((19.657627, -167.295749, 27.056402), ),
  ((18.274129, -157.144741, 25.15218), ))

  Return value
  An Edge object or a sequence of Edge objects.

  示例:
  #加载
  #一次选择一条边进行加载
  a = mdb.models['Model-1'].rootAssembly
  s1 = a.instances['Part-1-1'].edges

  #这个点的坐标只需要在这条线上即可,这个坐标位置处不一定得有关键点存在
  side1Edges1 =s1.findAt(((20.0,5.0,0.0),))

  region = a.Surface(side1Edges=side1Edges1, name='Surf-1')
  mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1',
  region=region, distributionType=UNIFORM, field='', magnitude=-pp,
  amplitude=UNSET)

  #####一次选择两条边进行加载
  #这个点的坐标只需要在这条线上即可,这个坐标位置处不一定得有关键点存在
  side1Edges2 =s1.findAt(((10.0,10.0,0.0),),((-10.0,10.0,0),))

  region2 = a.Surface(side1Edges=side1Edges2, name='Surf-1')
  mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1',
  region=region2, distributionType=UNIFORM, field='', magnitude=-pp,
  amplitude=UNSET)

  #选择一条弧线进行加载
  import math
  cood_x=5.0*math.sin(45.0/180.0*math.pi)
  cood_y=5.0*math.cos(45.0/180.0*math.pi)

  side1Edges3 =s1.findAt(((cood_x,cood_y,0.0),))

  region3 = a.Surface(side1Edges=side1Edges3, name='Surf-1')
  mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1',
  region=region3, distributionType=UNIFORM, field='', magnitude=-pp,
  amplitude=UNSET)

  #选择一个院的四条弧线进行加载
  cood_x=5.0*math.sin(45.0/180.0*math.pi)
  cood_y=5.0*math.cos(45.0/180.0*math.pi)

  side1Edges4 =s1.findAt(((cood_x,cood_y,0.0),),((-cood_x,cood_y,0.0),),((-cood_x,-cood_y,0.0),),((cood_x,-cood_y,0.0),))

  region4 = a.Surface(side1Edges=side1Edges4, name='Surf-1')
  mdb.models['Model-1'].Pressure(name='Load-1', createStepName='Step-1',
  region=region4, distributionType=UNIFORM, field='', magnitude=-pp,
  amplitude=UNSET)

  #######选择一条边施加约束
  a = mdb.models['Model-1'].rootAssembly
  e1 = a.instances['Part-1-1'].edges
  edges1 = e1.findAt(((-20.0,5.0,0.0),))
  region = a.Set(edges=edges1, name='Set-1')
  mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1',
  region=region, u1=0.0, u2=0.0, ur3=UNSET, amplitude=UNSET, fixed=OFF,
  distributionType=UNIFORM, fieldName='', localCsys=None)
  mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')

  #######选择两条边施加约束
  edges1 = e1.findAt(((-20.0,5.0,0.0),),((-20.0,-5.0,0.0),))
  region = a.Set(edges=edges1, name='Set-1')
  mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1',
  region=region, u1=0.0, u2=0.0, ur3=UNSET, amplitude=UNSET, fixed=OFF,
  distributionType=UNIFORM, fieldName='', localCsys=None)
  mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')

  #######选择一条弧线施加约束
  import math
  cood_x=5.0*math.sin(45.0/180.0*math.pi)
  cood_y=5.0*math.cos(45.0/180.0*math.pi)
  edges1 = e1.findAt(((cood_x,cood_y,0.0),))
  region = a.Set(edges=edges1, name='Set-1')
  mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1',
  region=region, u1=0.0, u2=0.0, ur3=UNSET, amplitude=UNSET, fixed=OFF,
  distributionType=UNIFORM, fieldName='', localCsys=None)
  mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')

  #######选择圆的四条弧线施加约束
  edges1 = e1.findAt(((cood_x,cood_y,0.0),),((-cood_x,cood_y,0.0),),((-cood_x,-cood_y,0.0),),((cood_x,-cood_y,0.0),))
  region = a.Set(edges=edges1, name='Set-1')
  mdb.models['Model-1'].DisplacementBC(name='BC-1', createStepName='Step-1',
  region=region, u1=0.0, u2=0.0, ur3=UNSET, amplitude=UNSET, fixed=OFF,
  distributionType=UNIFORM, fieldName='', localCsys=None)
  mdb.models['Model-1'].boundaryConditions['BC-1'].move('Step-1', 'Initial')


转自:http://blog.sina.com.cn/s/blog_6465f2ed0102x50o.html

回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-26 05:42 , Processed in 0.106712 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表