更改find​​At()函数的容差

时间:2019-05-10 12:51:40

标签: python abaqus

我在findAt()中使用了Abaqus函数,但是很多时候它都找不到元素,甚至认为参考位置很近。这是因为默认情况下,它用于查找对象的公差为1e-6

https://abaqus-docs.mit.edu/2017/English/SIMACAECMDRefMap/simacmd-c-intaclregions.htm

我想放松/改变这个容忍度。有人知道这是否可能吗?

mdb.models['Model-1'].parts['x'].Set(faces=/mdb.models['Model1'].parts['x'].faces.findAt(.....

1 个答案:

答案 0 :(得分:2)

如果要以更大的容忍度查找人脸,则应使用getByBoundingBox。您可以在那里指定公差范围。例如

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingBox(xMin = point[0]-tol, xMax = point[0]+tol,yMin = point[1]-tol, yMax = point[1]+tol,zMin = point[2]-tol, zMax = point[2]+tol,) # faces on the coordinates within your tolerance

进一步,您可以通过创建函数来进行此操作,以便对坐标列表应用与findAt方法相同的过程。

编辑:

甚至更好的getByBoundingSphere。在这种情况下,它甚至更容易:

point = (x,y,z) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getByBoundingSphere(center = point, radius=tol) # faces on the coordinates within your tolerance

EDIT2: 忘记上面的。使用getClosest。您可以在其中指定坐标列表和公差,以便行为就像findAt,只是具有自定义公差。

point = (x,y,z) # your coordinates
point2 = (x2,y2,z2) # your coordinates
tol = 1e-5 # your tolerance
faces = mdb.models['Model1'].parts['x'].faces.getClosest(coordinates =(point,point2), searchTolerance=tol) # faces on the coordinates within your tolerance