Version:

salvus.mesh.algorithms.point_sorting

salvus.mesh.algorithms.point_sorting salvus mesh algorithms point_sorting
Routines to globally sort points.

Functions

compress_connectivity()

Compress duplicate points and the associated connectivity.
SIGNATURE
def compress_connectivity(
    points: npt.NDArray,
    connectivity: npt.NDArray,
    return_point_map: bool = False,
    assume_unique: bool = False,
    rtol: float = 1e-12,
) -> tuple[npt.NDArray, ...]: ...
ARGUMENTS
Required
points
Type:npt.NDArray
Description:
The points to compress.
Required
connectivity
Type:npt.NDArray
Description:
The connectivity to compress.
Optional
return_point_map
Type:bool
Default value:False
Description:
Return the point map from the old to new connectivity.
Optional
assume_unique
Type:bool
Default value:False
Description:
Assume the points are already unique. Skips a potentially expensive sort.
Optional
rtol
Type:float
Default value:1e-12
Description:
The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
RETURNS
Return type: tuple[npt.NDArray, ...]
The compressed points and connectivity, along with the point map if requested.

compute_global_numbering()

Compute the global numbering of an array of points.
Duplicated points within rtol will be considered identical and their numbering will be consolidated.
SIGNATURE
def compute_global_numbering(
    points: npt.NDArray, rtol: float = 1e-12
) -> npt.NDArray: ...
ARGUMENTS
Required
points
Type:npt.NDArray
Description:
The points to compute the numbering of.
Optional
rtol
Type:float
Default value:1e-12
Description:
The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
RETURNS
Return type: npt.NDArray
The sorted global indices corresponding to the input points.

find_unique_points()

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.
SIGNATURE
def find_unique_points(
    points: npt.NDArray, rtol: float = 1e-12, return_index: bool = False
) -> tuple[npt.NDArray, ...]: ...
ARGUMENTS
Required
points
Type:npt.NDArray
Description:
The points to make unique.
Optional
rtol
Type:float
Default value:1e-12
Description:
The relative tolerance below which points are considered equal. Will be scaled by the range of values in points.
Optional
return_index
Type:bool
Default value:False
Description:
Additionally return the original indices of the unique points.
RETURNS
Return type: tuple[npt.NDArray, ...]
The unique points, the associated global indices, along with any other outputs requested from np.unique via kwargs.
PAGE CONTENTS