SimPEG.utils.closest_points_index#

SimPEG.utils.closest_points_index(mesh, pts, grid_loc='CC', **kwargs)[source]#

Find the indicies for the nearest grid location for a set of points.

Parameters
meshdiscretize.base.BaseMesh

An instance of discretize.base.BaseMesh

pts(n, dim) numpy.ndarray

Points to query.

grid_loc{‘CC’, ‘N’, ‘Fx’, ‘Fy’, ‘Fz’, ‘Ex’, ‘Ex’, ‘Ey’, ‘Ez’}

Specifies the grid on which points are being moved to.

Returns
(n ) numpy.ndarray of int

Vector of length n containing the indicies for the closest respective cell center, node, face or edge.

Examples