Search code examples
pythonabaqus

Changing the tolerance of findAt() function


I am using the findAt() function in Abaqus but quite often it doesn't find the element, even thought the reference location is quite close. This is because the tolerance it uses to find objects is 1e-6 on default.

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

I would like to relax/change this tolerance. Does anybody know if this is possible?

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

Solution

  • If you want to find faces by larger tolerance you should use getByBoundingBox. There you can specify the range with your tolerance. e.g.

    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
    

    Further you could advance this by making a function so you can apply the same procedure on list of coordinates as in findAt method.

    EDIT:

    Or even better getByBoundingSphere. In this case it's even easier:

    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: Forget the above. use getClosest. there you can specify list of coordinates and a tolerance so behavior is like a findAt just with custom tolerance.

    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