pyyeti.nastran.op4.OP4.listload

OP4.listload(filename, namelist=None, sparse=False)[source]

Read all matching matrices from op4 file into a list; useful if op4 file has duplicate names.

Parameters:
  • filename (string) – Name of op4 file to read.

  • namelist (list, string, or None; optional) – List of variable names to read in, or string with name of the single variable to read in, or None. If None, all matrices are read in.

  • sparse (bool or None or two-tuple_like; optional) – Specifies whether output matrices will be regular numpy arrays or sparse arrays. If not two-tuple_like:

    sparse

    Action

    None

    Auto setting: each matrix will be sparse if and only if it was written in a sparse format

    True

    Matrices will be returned in sparse format

    False

    Matrices will be returned in regular (dense) numpy arrays

    If sparse is two-tuple_like, the first element is either None, True, or False (see table above) and the second element is a callable, as in: X = callable(X). A common usage of the callable would be to convert from “COO” sparse form (see scipy.sparse.coo_matrix) to a more desirable form. For example, to ensure all matrices are returned in CSC form (see scipy.sparse.csc_matrix) use:

    sparse=(True, scipy.sparse.coo_matrix.tocsc)
    

    The callable is ignored for non-sparse matrices.

Returns:

  • names (list) – Lower-case list of matrix names in order as read.

  • matrices (list) – List of matrices in order as read.

  • forms (list) – List of integers specifying the Nastran form of each matrix.

  • mtypes (list) – List of integers specifying the Nastran type of each matrix.

Notes

The default form for sparse matrices is the “COO” sparse form (see scipy.sparse.coo_matrix). To override, provide a callable in the sparse option (see above).

See also

dctload(), write(), dir()