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, xyz_compare, tol, neq_max=4, msg='')[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

tol : float

the max spherical tolerance

neq_max : int; default=4

the number of close nodes

msg : str; default=’‘

error message

Returns:
kdt : cKDTree()

the kdtree object

ieq : int 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

slots : int 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

msg : str; default=’‘

error message

pyNastran.bdf.mesh_utils.find_closest_nodes.find_closest_nodes(nodes_xyz, nids, xyz_compare, neq_max=1, tol=None, msg='')[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

tol : float; default=None

the max spherical tolerance None : the whole model

neq_max : int; default=1.0

the number of “close” points

msg : str; 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, xyz_compare, neq_max, tol, msg='')[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_max : int

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

tol : float

the max spherical tolerance

msg : str; default=’‘

error message

Returns:
slots : (Ncompare, ) int ndarray

the indices of the close nodes corresponding to nodes_xyz