pyyeti.nastran.bulk.rddtipch

pyyeti.nastran.bulk.rddtipch(f, name='TUG1', *, follow_includes=True, include_symbols=None, encoding='utf_8')[source]

Read the 2nd record of specific DTIs from a .pch file.

Parameters:
  • f (string or file_like or None) – Either a name of a file, or is a file_like object as returned by open(). If file_like object, it is rewound first. Can also be the name of a directory or None; in these cases, a GUI is opened for file selection.

  • name (string) – Name of DTI table to read from the .pch file

  • follow_includes (bool; optional) – If True, INCLUDE statements will be followed recursively. Note that if f is a StringIO object, or another object that does not have a name property, this parameter will be set to False.

  • include_symbols (dict; optional) – A dictionary mapping Nastran symbols to an associated path. These can be read from a file using rdsymbols().

  • encoding (string; optional) – Encoding to use when opening text file. This option will be passed to any files read in via the follow_includes option.

Returns:

id_dof (ndarray) – 2-column matrix of the form: [id, dof]. The number of rows in id_dof corresponds to the matching matrix in .op4 file (see Notes).

Notes

This routine is useful for reading data from .pch files written by the EXTSEOUT command. The 2nd record of “TUG1” (for example) contains the DOF that correspond to the rows of the “MUG1” matrix in the .op4 file. That matrix can be read by the pyyeti.nastran.op4 module.

Example usage:

# read mug1 and tug1 (created from EXTSEOUT):
from pyyeti import nastran
from pyyeti.nastran import op4
mug1 = op4.read('data.op4', 'mug1')['mug1']
tug1 = nastran.rddtipch('data.pch')

# form DRM to recovery grid 100, dof 4:
from pyyeti import locate
row = locate.find_rows(tug1, [100, 4])
drm = mug1[row, :]