find_closest_nodes Module

defines:
  • nids_close = find_closest_nodes(nodes_xyz, nids, xyz_compare, neq_max, tol)

  • ieq = find_closest_nodes_index(nodes_xyz, xyz_compare, neq_max, tol)

pyNastran.bdf.mesh_utils.find_closest_nodes._not_equal_nodes_build_tree(nodes_xyz: ndarray[Any, dtype[float64]], xyz_compare: ndarray[Any, dtype[float64]], tol: float, neq_max: int = 4, msg: str = '') tuple[Any, ndarray, ndarray][source]

helper function for bdf_equivalence_nodes

Parameters:
nodes_xyz(Nnodes, 3) float ndarray

the source points

xyz_compare(Ncompare, 3) float ndarray

the xyz points to compare to

tolfloat

the max spherical tolerance

neq_maxint; default=4

the number of close nodes

msgstr; default=’’

error message

Returns:
kdtKDTree()

the kdtree object

ieqint ndarray

The indices of nodes_xyz where the nodes in xyz_compare are close??? neq_max = 1:

(N, ) int ndarray

neq_max > 1:

(N, N) int ndarray

slotsint ndarray

The indices of nodes_xyz where the nodes in xyz_compare are close??? neq_max = 1:

(N, ) int ndarray

neq_max > 1:

(N, N) int ndarray

msgstr; default=’’

error message

pyNastran.bdf.mesh_utils.find_closest_nodes.find_closest_nodes(nodes_xyz: ndarray[Any, dtype[float64]], nids: ndarray[Any, dtype[int64]], xyz_compare: ndarray[Any, dtype[float64]], neq_max: int = 1, tol: float | None = None, msg: str = '') ndarray[Any, dtype[int64]][source]

Finds the closest nodes to an arbitrary set of xyz points

Parameters:
nodes_xyz(Nnodes, 3) float ndarray

the source points (e.g., xyz_cid0)

nids(Nnodes, ) int ndarray

the source node ids (e.g.; nid_cp_cid[:, 0])

xyz_compare(Ncompare, 3) float ndarray

the xyz points to compare to; xyz_to_find

tolfloat; default=None

the max spherical tolerance None : the whole model

neq_maxint; default=1

the number of “close” points

msgstr; default=’’

custom message used for errors

Returns:
nids_close: (Ncompare, ) int ndarray

the close node ids

pyNastran.bdf.mesh_utils.find_closest_nodes.find_closest_nodes_index(nodes_xyz: ndarray[Any, dtype[float64]], xyz_compare: ndarray[Any, dtype[float64]], neq_max: int, tol: float, msg: str = '')[source]

Finds the closest nodes to an arbitrary set of xyz points

Parameters:
nodes_xyz(Nnodes, 3) float ndarray

the source points

xyz_compare(Ncompare, 3) float ndarray

the xyz points to compare to

neq_maxint

the number of “close” points (default=4)

tolfloat

the max spherical tolerance

msgstr; default=’’

error message

Returns:
slots(Ncompare, ) int ndarray

the indices of the close nodes corresponding to nodes_xyz