Mondaic
This API reference is not for the latest stable Salvus version.

salvus.mesh.algorithms.point_sorting

Routines to globally sort points.

Functions

compress_connectivity()

def compress_connectivity(
    points: numpy.ndarray,
    connectivity: numpy.ndarray,
    return_point_map: bool = False,
    assume_unique: bool = False,
    rtol: float = 1e-12,
) -> Tuple[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], ...]: ...

Compress duplicate points and the associated connectivity.

Parameters
  • points numpy.ndarray — The points to compress.
  • connectivity numpy.ndarray — The connectivity to compress.
  • return_point_map bool — Return the point map from the old to new connectivity.
  • assume_unique bool — Assume the points are already unique. Skips a potentially expensive sort.
  • rtol float — The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
Returns Tuple[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], ...] — The compressed points and connectivity, along with the point map if requested.

compute_global_numbering()

def compute_global_numbering(
    points: numpy.ndarray, rtol: float = 1e-12
) -> numpy.ndarray: ...

Compute the global numbering of an array of points.

Duplicated points within rtol will be considered identical and their numbering will be consolidated.

Parameters
  • points numpy.ndarray — The points to compute the numbering of.
  • rtol float — The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
Returns numpy.ndarray — The sorted global indices corresponding to the input points.

find_unique_points()

def find_unique_points(
    points: numpy.ndarray, rtol: float = 1e-12, return_index: bool = False
) -> Tuple[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], ...]: ...

Find the unique points in an array.

Points that differ by less than rtol, when scaled by the range of values within points, will be considered identical.

Parameters
  • points numpy.ndarray — The points to make unique.
  • rtol float — The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
  • return_index bool — Additionally return the original indices of the unique points.
Returns Tuple[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]], ...] — The unique points, the associated global indices, along with any other outputs requested from np.unique via kwargs.