pyyeti.nastran.bulk.rdgpwg

pyyeti.nastran.bulk.rdgpwg(f, search_strings=None, *, encoding='utf_8')[source]

Read a GPWG table 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.

  • search_strings (None, string, or list_like of strings) – If a string, this routine will scan the file until the string is found before reading the GPWG table. If multiple strings in a list or tuple, the routine will scan for each string, in the order provided, before reading the GPWG table. If None, the first GPWG table is read.

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

Returns:

  • mass (2d ndarray) – The 6x6 mass (or weight) matrix.

  • cg (2d ndarray) –

    The 3x4 center-of-gravity table:

    [ mass(x, y, z) x-cg y-cg z-cg ]
    
  • refpt (integer) – The reference point listed just before the mass matrix in the F06 file.

  • Is (2d ndarray) – The I(S) matrix. This is the 3 x 3 mass moment of inertia partition with respect to the center of gravity referred to the principal mass axes (the S system). This is not necessarily a diagonal matrix because the determination of the S system does not involve second moments. The values of inertias at the center of gravity are found from the values at the reference point employing the parallel axis rule.

Notes

The routine will load the first GPWG table it finds after searching for each string in search_strings, if provided. After searching for these strings, the routine will search for the next “W E I G H T” string.

All outputs will be set to None if no GPWG table is found or if a search string is not found.

Example usage:

from pyyeti import nastran
str1 = '           SUPERELEMENT 100'
str2 = '^^^F-SET MASS TABLE'
mass, cg, ref, I = nastran.rdgpwg('modes.f06', (str1, str2))