mpc_dependency Module

defines methods to access MPC/rigid element data:
  • get_mpc_node_ids( mpc_id, stop_on_failure=True)

  • get_mpc_node_ids_c1( mpc_id, stop_on_failure=True)

  • get_rigid_elements_with_node_ids(self, node_ids)

  • get_dependent_nid_to_components(self, mpc_id=None, stop_on_failure=True)

  • get_lines_rigid(model: BDF)

  • get_mpcs(model, mpc_id, mpc_id, consider_mpcadd=True,

    stop_on_failure=True)

pyNastran.bdf.mesh_utils.mpc_dependency.add_to_errored_mpcs(nid, component, set_nid_to_components: set[tuple[int, str]], dependent_nid_to_components: dict[int, set[str]], errored_components: set[tuple[int, str]])[source]
pyNastran.bdf.mesh_utils.mpc_dependency.get_dependent_nid_to_components(model: BDF, mpc_id: int = 0, stop_on_failure: bool = True)[source]

Gets a dictionary of the dependent node/components.

Parameters:
mpc_idint; default=0 -> no MPCs are checked

the MPC/MPCADD id

stop_on_failurebool; default=True

errors if parsing something new errors if DOFs are specified on multiple RBEs

Returns:
dependent_nid_to_componentsdict[node_id]components
dependent_nid_to_components = {

1104634: ‘123456’, 1104126: ‘123456’}

node_idint

the node_id

componentsstr

the DOFs that are linked

Nastran can either define a load/motion at a given node.
SPCs define constraints that may not have loads/motions.
MPCs and rigid elements define independent and dependent nodes on
specific DOFs.
  • independent nodes : loads/motions may be defined

  • dependent nodes : loads/motions may not be defined

pyNastran.bdf.mesh_utils.mpc_dependency.get_lines_rigid(model: BDF) Any[source]

GUI helper function

dependent = (lines[:, 0]) independent = np.unique(lines[:, 1])

pyNastran.bdf.mesh_utils.mpc_dependency.get_mpc_node_ids(model: BDF, mpc_id: int, consider_mpcadd: bool = True, stop_on_failure: bool = True) list[list[int]][source]

Get the MPC/MPCADD IDs.

Parameters:
mpc_idint

the MPC id

consider_mpcaddbool

MPCADDs should not be considered when referenced from an MPCADD from a case control, True should be used.

stop_on_failurebool; default=True

errors if parsing something new

Returns:
lineslist[[independent, dependent]]
independentint

the independent node id

dependentint

the dependent node id

I I

/

I—D—I
pyNastran.bdf.mesh_utils.mpc_dependency.get_mpc_node_ids_c1(model: BDF, mpc_id: int, consider_mpcadd: bool = True, stop_on_failure: bool = True) tuple[dict[str, list[int]], dict[str, list[int]]][source]

Get the MPC/MPCADD IDs.

Parameters:
mpc_idint

the MPC id

consider_mpcaddbool

MPCADDs should not be considered when referenced from an MPCADD from a case control, True should be used.

stop_on_failurebool; default=True

errors if parsing something new

Returns:
independent_node_ids_c1dict[component] = node_ids
componentstr

the DOF to constrain

node_idslist[int]

the constrained node ids

dependent_node_ids_c1dict[component] = node_ids
componentstr

the DOF to constrain

node_idslist[int]

the constrained node ids

I I

/

I—D—I
pyNastran.bdf.mesh_utils.mpc_dependency.get_mpcs(model, mpc_id: int, consider_mpcadd: bool = True, stop_on_failure: bool = True) tuple[list[int], list[str]][source]

Gets the MPCs in a semi-usable form.

Parameters:
mpc_idint

the desired MPC ID

stop_on_failurebool; default=True

errors if parsing something new

Returns:
nidslist[int]

the constrained nodes

compslist[str]

the components that are constrained on each node

Considers:
  • MPC

  • MPCADD

pyNastran.bdf.mesh_utils.mpc_dependency.get_rigid_elements_with_node_ids(model: BDF, node_ids)[source]

Gets the series of rigid elements that use specific nodes

Parameters:
node_idslist[int]

the node ids to check

Returns:
rbeslist[int]

the set of self.rigid_elements