Are you speaking about the minimum distance between 2 meshes (nodes and elements)?
(if so, you can probably reduce the number of calculations by looking if the element normal is well oriented for example; just an idea)
I guess the floor is not flat and that's why you've to calculate the "mutual" distance between each element of each part (ball vs floor); I would say that we may certainly improve your code, but more information's are needed: can you provide some extract of the ball elements and the floor ones (few number of each)?
Paul
(if so, you can probably reduce the number of calculations by looking if the element normal is well oriented for example; just an idea)
I guess the floor is not flat and that's why you've to calculate the "mutual" distance between each element of each part (ball vs floor); I would say that we may certainly improve your code, but more information's are needed: can you provide some extract of the ball elements and the floor ones (few number of each)?
Paul