pyHarm.DofGrabber

This module gives some functions that allow for grabbing specific dofs from the explicit dof dataFrame built by the system

Functions

sub_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the substructure.

node_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the substructure and node number.

list_node_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the substructure and a list of node numbers.

dof_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the substructure, node number, and dof number.

harm_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the harmonic number.

harm_cs_grabber(→ pandas.Index)

Grab indices from the explicit dof DataFrame based on the harmonic number and cosine or sine part.

gen_NodeToNode_select_matrix(→ tuple[numpy.ndarray, ...)

Generate a selection matrix for NodeToNode type of connectors -- Pslave, Pmaster

_is_connect_type_legacy(→ bool)

_transform_legacy(→ list[dict[str, int]])

_transform_new(→ list[dict[str, int]])

_transform_input_for_grabber(→ list[dict[str, int]])

_recursive_union_of_Index(LI)

Module Contents

pyHarm.DofGrabber.sub_grabber(edf: pandas.DataFrame, sub: str, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the substructure.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • sub (str) – The substructure identifier.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified substructure.

Return type:

pd.Index

pyHarm.DofGrabber.node_grabber(edf: pandas.DataFrame, sub: str | None, node: int | None, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the substructure and node number.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • sub (str | None) – The substructure identifier.

  • node (int | None) – The node number.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified substructure and node number.

Return type:

pd.Index

pyHarm.DofGrabber.list_node_grabber(edf: pandas.DataFrame, sub: str | None, node: list[int] | None, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the substructure and a list of node numbers.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • sub (str | None) – The substructure identifier.

  • node (list[int] | None) – The list of node numbers.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified substructure and list of node numbers.

Return type:

pd.Index

pyHarm.DofGrabber.dof_grabber(edf: pandas.DataFrame, sub: str | None, node: int | None, dof: int | None, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the substructure, node number, and dof number.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • sub (str | None) – The substructure identifier.

  • node (int | None) – The node number.

  • dof (int | None) – The dof number.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified substructure, node number, and dof number.

Return type:

pd.Index

pyHarm.DofGrabber.harm_grabber(edf: pandas.DataFrame, harm: int | None, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the harmonic number.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • harm (int | None) – The harmonic number.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified harmonic number.

Return type:

pd.Index

pyHarm.DofGrabber.harm_cs_grabber(edf: pandas.DataFrame, harm: int | None, cs: str | None, **kwargs) pandas.Index

Grab indices from the explicit dof DataFrame based on the harmonic number and cosine or sine part.

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • harm (int | None) – The harmonic number.

  • cs (str | None) – either cosine or sine part.

  • **kwargs – Additional keyword arguments.

Returns:

The indices corresponding to the specified harmonic number and cosine or sine part.

Return type:

pd.Index

pyHarm.DofGrabber.gen_NodeToNode_select_matrix(edf: pandas.DataFrame, input_dict: dict, **kwargs) tuple[numpy.ndarray, list[numpy.ndarray]]

Generate a selection matrix for NodeToNode type of connectors – Pslave, Pmaster

Parameters:
  • edf (pd.DataFrame) – The explicit dof DataFrame.

  • input_dict (dict) – The input dictionary containing connection information.

  • **kwargs – Additional keyword arguments.

Returns:

indices of the dof conserned from the explicit dof DataFrame. list[np.ndarray]: The selection matrix for NodeToNode transformation.

Return type:

np.ndarray

pyHarm.DofGrabber._is_connect_type_legacy(_connect: dict[str, list] | list[tuple[str, list[int]]]) bool
pyHarm.DofGrabber._transform_legacy(_connect: dict[str, list]) list[dict[str, int]]
pyHarm.DofGrabber._transform_new(_connect: list[tuple[str, list[int]]]) list[dict[str, int]]
pyHarm.DofGrabber._transform_input_for_grabber(input_dict: dict) list[dict[str, int]]
pyHarm.DofGrabber._recursive_union_of_Index(LI: list[pandas.Index])