bdf_equivalence Module

model = bdf_equivalence_nodes(bdf_filename, bdf_filename_out, tol,

renumber_nodes=False, neq_max=4, xref=True, node_set=None, size=8, is_double=False, remove_collapsed_elements=False, avoid_collapsed_elements=False, crash_on_collapse=False, log=None, debug=True)

pyNastran.bdf.mesh_utils.bdf_equivalence._bdf_equivalence_nodes(bdf_filename: str, tol: float, renumber_nodes: bool = False, neq_max: int = 4, xref: bool = True, node_set: Optional[List[NDArrayNint]] = None, log: Optional[SimpleLogger] = None, debug: bool = True, method: str = 'new', idtype: str = 'int32', fdtype: str = 'float64') → Tuple[BDF, List[Tuple[int, int]]][source]

helper for bdf_equivalence_nodes

pyNastran.bdf.mesh_utils.bdf_equivalence._check_for_referenced_nodes(model: pyNastran.bdf.bdf.BDF, node_set: Optional[Any], nids: Any, all_nids: Any, nodes_xyz: Any) → Optional[Any][source]

helper function for _eq_nodes_setup

pyNastran.bdf.mesh_utils.bdf_equivalence._eq_nodes_build_tree_new(kdt: scipy.spatial.cKDTree, nodes_xyz: NDArrayN3float, nids: NDArrayNint, all_node_set: NDArrayNint, nnodes: int, is_not_node_set: bool, tol: float, log: SimpleLogger, inew=None, node_set=None, neq_max: int = 4, msg: str = '', debug: float = False) → Tuple[Any, List[Tuple[int, int]]][source]
pyNastran.bdf.mesh_utils.bdf_equivalence._eq_nodes_final(nid_pairs, model: pyNastran.bdf.bdf.BDF, tol: float, all_node_set: Any, debug: bool = False) → None[source]

apply nodal equivalencing to model

pyNastran.bdf.mesh_utils.bdf_equivalence._eq_nodes_setup_node(model: pyNastran.bdf.bdf.BDF, renumber_nodes: bool = False, idtype: str = 'int32') → Tuple[Any, Any][source]

helper function for _eq_nodes_setup that doesn’t handle node sets

pyNastran.bdf.mesh_utils.bdf_equivalence._eq_nodes_setup_node_set(model: pyNastran.bdf.bdf.BDF, node_set: List[Any], all_node_set: Any, renumber_nodes: bool = False, idtype: str = 'int32') → Tuple[Any, Any][source]

helper function for _eq_nodes_setup that handles node_sets

pyNastran.bdf.mesh_utils.bdf_equivalence._get_tree(nodes_xyz: Any, msg: str = '') → scipy.spatial.ckdtree.cKDTree[source]

gets the kdtree

pyNastran.bdf.mesh_utils.bdf_equivalence._get_xyz_cid0(model: pyNastran.bdf.bdf.BDF, nids: Any, fdtype: str = 'float32') → Any[source]

gets xyz_cid0

pyNastran.bdf.mesh_utils.bdf_equivalence._nodes_xyz_nids_to_nid_pairs(nodes_xyz: NDArrayN3float, nids: NDArrayNint, all_node_set: NDArrayNint, tol: float, log: SimpleLogger, inew: NDArrayNint, node_set: Optional[NDArrayNint] = None, neq_max: int = 4, method: str = 'new', debug: bool = False) → List[Tuple[int, int]][source]

Helper for equivalencing

nid_pairsList[Tuple[int, int]]

a series of (nid1, nid2) pairs

pyNastran.bdf.mesh_utils.bdf_equivalence._nodes_xyz_nids_to_nid_pairs_new(kdt: scipy.spatial.ckdtree.cKDTree, nids: Any, all_node_set: Any, node_set: Optional[Any], tol: float)[source]

helper function for bdf_equivalence_nodes

pyNastran.bdf.mesh_utils.bdf_equivalence._simplify_node_set(node_set: Union[List[int], Set[int], List[Any], None], idtype: str = 'int32') → Optional[List[Any]][source]
accepts multiple forms of the node_set parameter
  • list[int]

  • set[int]

  • list[int ndarray]

  • int ndarray

pyNastran.bdf.mesh_utils.bdf_equivalence._update_grid(node1: GRID, node2: GRID)[source]

helper method for _eq_nodes_final

pyNastran.bdf.mesh_utils.bdf_equivalence.bdf_equivalence_nodes(bdf_filename: str, bdf_filename_out: str, tol: float, renumber_nodes: bool = False, neq_max: int = 4, xref: bool = True, node_set: Optional[Union[List[int], NDArrayNint]] = None, size: int = 8, is_double: bool = False, remove_collapsed_elements: bool = False, avoid_collapsed_elements: bool = False, crash_on_collapse: bool = False, log: Optional[SimpleLogger] = None, debug: bool = True, method: str = 'new') → BDF[source]

Equivalences nodes; keeps the lower node id; creates two nodes with the same

bdf_filenamestr / BDF

str : bdf file path BDF : a BDF model that is fully valid (see xref)


a bdf_filename to write


the spherical tolerance


should the nodes be renumbered (default=False)


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


does the model need to be cross_referenced (default=True; only applies to model option)

node_setList[int] / (n, ) ndarray; default=None

the list/array of nodes to consider (not supported with renumber_nodes=True)

sizeint; {8, 16}; default=8

the bdf write precision

is_doublebool; default=False

the field precision to write

remove_collapsed_elementsbool; default=False (unsupported)
True1D/2D/3D elements will not be collapsed;

CELASx/CDAMP/MPC/etc. are not considered

False : no elements will be removed

avoid_collapsed_elementsbool; default=False (unsupported)
Trueonly collapses that don’t break 1D/2D/3D elements will be considered;

CELASx/CDAMP/MPC/etc. are considered

False : element can be collapsed

crash_on_collapsebool; default=False
stop if nodes have been collapsed

False: blindly move on True: rereads the BDF which catches doubled nodes (temporary);

in the future collapse=True won’t need to double read; an alternative is to do Patran’s method of avoiding collapse)


bdf debugging

method: str; default=’new’

‘new’: doesn’t require neq_max; new in v1.3 ‘old’: use neq_max; used in v1.2

loglogger(); default=None

bdf logging


The BDF model corresponding to bdf_filename_out


I doubt SPOINTs/EPOINTs work correctly ..


xref not fully implemented (assumes cid=0) ..


node_set still does work on the all the nodes in the big kdtree loop, which is very inefficient


remove_collapsed_elements is not supported ..


avoid_collapsed_elements is not supported ..

pyNastran.bdf.mesh_utils.bdf_equivalence.get_all_node_set(node_set: Optional[List[Any]]) → Any[source]