pyyeti.nastran.bulk.rdspoints

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

Read Nastran SPOINT cards from a Nastran bulk 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.

  • 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:

spoints (1d ndarray) – Array of SPOINT ids. Will be empty if no SPOINT cards found.

Notes

This routine uses rdcards() to load the data.

Examples

>>> from pyyeti import nastran
>>> from io import StringIO
>>> bulkdata = (
...     "SPOINT,1,2,100\n"
...     "SPOINT,200,THRU,202\n"
...     "SPOINT,5\n"
... )
>>> with StringIO(bulkdata) as f:
...     spoints = nastran.rdspoints(f)
>>> spoints
array([  1,   2, 100, 200, 201, 202,   5]...)
>>> with StringIO("no data") as f:
...     spoints = nastran.rdspoints(f)
>>> spoints
array([]...)