pyyeti.nastran.bulk.rdeigen

pyyeti.nastran.bulk.rdeigen(f, use_pandas=True, search_strings=None, regex=False, *, encoding='utf_8')[source]

Read real eigenvalue tables from a Nastran F06 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.

  • use_pandas (bool; optional) – If True, the eigenvalue tables will be returned as pandas DataFrames.

  • search_strings (None, string, or list_like of strings; optional) – If a string, this routine will scan the file until the string or regular expression pattern is found before reading the next eigenvalue table. If list_like of multiple strings or patterns, the routine will scan for each string/pattern in the order provided before reading the next table. If None, all eigenvalue tables are read in, but see notes.

    Note

    If search_strings is not None, this routine returns a single eigenvalue table; otherwise, a dictionary is returned.

    Note

    When search_strings is None, later eigenvalue tables will overwrite previous ones if the superelement number is the same.

    Note

    All strings in search_strings must be found on or before the line that contains “EIGENVALUE RADIANS CYCLES”.

  • regex (bool; optional) – If set to True, use regular expression matching instead of literal string matching when searching for the strings in search_strings. The search is case-insensitive when using regular expressions.

  • encoding (string; optional) – Encoding to use when opening Nastran F06 file for reading.

Returns:

dictionary or 2d ndarray or pandas DataFrame or None – If search_strings is not None, this routine returns a single eigenvalue table. In that case, the return value is either a 2d ndarray or a pandas DataFrame depending on use_pandas. If search_strings is None, a dictionary of 2d ndarrays or DataFrames is returned and is indexed by the superelement ID. The columns of the the array or DataFrame are: [mode number, extraction order, eigenvalue, radians, cycles, generalized mass, generalized stiffness].

None is returned if there are no eigenvalues tables found.

Notes

If the pandas output is chosen (the default) the mode number is used as the index and columns is:

c = ['Mode #', 'ext #', 'eigenvalue', 'radians',
     'cycles', 'genmass', 'genstif']