closest_point_in_mesh

nrv.fmod.FEM.fenics_utils.closest_point_in_mesh(mesh, point, tree, tdim, midpoint_tree)[source]

Find the closest point on a mesh entity when a query point lies outside the mesh.

Parameters:
  • mesh (Any) – Mesh object.

  • point (array-like) – Query point coordinates.

  • tree (Any) – Bounding-box tree for the mesh.

  • tdim (int) – Topological dimension.

  • midpoint_tree (Any) – Midpoint tree used by the nearest-entity search.

Returns:

Closest entity identifier and closest point coordinates.

Return type:

tuple