bdf/utils Package

This is the pyNastran.bdf.rst file.

utils Module

Defines various utilities including:
  • parse_patran_syntax

  • parse_patran_syntax_dict

  • Position

  • PositionWRT

  • transform_load

pyNastran.bdf.utils.Position(xyz: NDArray3float, cid: int, model: BDF) → np.ndarray[source]

Gets the point in the global XYZ coordinate system.

Parameters
xyz(3,) ndarray

the position of the GRID in an arbitrary coordinate system

cidint

the coordinate ID for xyz

modelBDF()

the BDF model object

Returns
xyz2(3,) ndarray

the position of the GRID in an arbitrary coordinate system

pyNastran.bdf.utils.PositionWRT(xyz: NDArray3float, cid: int, cid_new: int, model: BDF) → NDArray3float[source]

Gets the location of the GRID which started in some arbitrary system and returns it in the desired coordinate system

Parameters
xyz(3, ) float ndarray

the position of the GRID in an arbitrary coordinate system

cidint

the coordinate ID for xyz

cid_newint

the desired coordinate ID

modelBDF()

the BDF model object

Returns
xyz_local(3, ) float ndarray

the position of the GRID in an arbitrary coordinate system

pyNastran.bdf.utils.TransformLoadWRT(F, M, cid, cid_new, model)[source]
pyNastran.bdf.utils.get_xyz_cid0_dict(model: BDF, xyz_cid0: Dict[int, NDArray3float] = None) → Dict[int, NDArray3float][source]

helper method

Parameters
modelBDF()

a BDF object

xyz_cid0None / Dict[int] = (3, ) ndarray

the nodes in the global coordinate system

Returns
xyz_cid0_dict
pyNastran.bdf.utils.split_eids_along_nids(model: BDF, eids: List[int], nids: List[int]) → None[source]

Disassociate a list of elements along a list of nodes.

The expected use of this function is that you have two bodies that are incorrectly equivalenced and you would like to create duplicate nodes at the same location and associate the new nodes with one half of the elements.

Pick the nodes along the line and the elements along one side of the line.

Parameters
modelBDF()

the BDF model

eidslist/tuple

element ids to disassociate

nidslist/tuple

node ids to disassociate

Implicitly returns model with additional nodes.

Notes

xref should be set to False for this function.

pyNastran.bdf.utils.transform_load(F, M, cid: int, cid_new: int, model: BDF) → Tuple[np.ndarray, np.ndarray][source]

Transforms a force/moment from an arbitrary coordinate system to another coordinate system.

Parameters
Fxyz(3, ) float ndarray

the force in an arbitrary coordinate system

Mxyz(3, ) float ndarray

the moment in an arbitrary coordinate system

cidint

the coordinate ID for xyz

cid_newint

the desired coordinate ID

modelBDF()

the BDF model object

Returns
Fxyz_local(3, ) float ndarray

the force in an arbitrary coordinate system

Mxyz_local(3, ) float ndarray

the force in an arbitrary coordinate system

write_path Module

Defines following useful methods:
  • write_include(filename, is_windows=True)

pyNastran.bdf.write_path._split_path(abspath: str, is_windows: bool) → Tuple[str, ...][source]

Takes a path and splits it into the various components.

This is a helper method for write_include

pyNastran.bdf.write_path.write_include(filename: str, is_windows: bool = None) → str[source]

Writes a bdf INCLUDE file line given an imported filename.

Parameters
filenamestr

the filename to write

is_windowsbool; default=None
True/FalseWindows has a special format for writing INCLUDE

files, so the format for a BDF that will run on Linux and Windows is different.

None : Check the platform

For a model that will run on Linux:
..code-block:: python

fname = r’/opt/NASA/test1/test2/test3/ test4/formats/pynastran_v0.6/pyNastran/bdf/model.inc’ write_include(fname, is_windows=False)

We want:
..code-block:: python
INCLUDE /opt/NASA/test1/test2/test3/test4/formats/pynastran_v0.6/

pyNastran/bdf/model.inc