pyyeti.nastran.n2p.mkusetcoordinfo

pyyeti.nastran.n2p.mkusetcoordinfo(cord, uset=None, coordref=None)[source]

Function for getting coordinfo as needed by the USET table. Called by addgrid.

Parameters:
  • cord (scalar integer or 4x3 array_like) – If scalar, it is a coordinate system id (must be 0 or appear in either uset or coordref). If 4x3 matrix, format is as on a Nastran CORD2* card:

    [ id type reference_id ]
    [ Ax   Ay   Az         ]
    [ Bx   By   Bz         ]
    [ Cx   Cy   Cz         ]
    

    where type is 1 (rectangular), 2 (cylindrical), or 3 (spherical).

  • uset (pandas DataFrame or None; optional) – A DataFrame as output by pyyeti.nastran.op2.OP2.rdn2cop2(). Not used unless needed.

  • coordref (dictionary or None; optional) – Read/write dictionary with the keys being the coordinate system id and the values being the 5x3 matrix returned below. For speed reasons, this routine will look in coordref before uset for a coordinate system. Can be empty or None.

Returns:

cordout (5x3 ndarray) – Coordinate information in a 5x3 matrix:

[id  type 0]  # output coord. sys. id and type
[xo  yo  zo]  # origin of coord. system
[    T     ]  # 3x3 transformation to basic
Note that T is for the coordinate system, not a grid
(unless type = 1 which means rectangular)

Notes

If neither uset nor coordref have a needed coordinate system, this routine will error out.

Examples

>>> from pyyeti.nastran import n2p
>>> n2p.mkusetcoordinfo([[1, 1, 0],
...                      [10, 0, 0],
...                      [11, 0, 0],
...                      [10, 0, 1]], None, {})
array([[  1.,   1.,   0.],
       [ 10.,   0.,   0.],
       [  0.,   0.,   1.],
       [  0.,  -1.,   0.],
       [  1.,   0.,   0.]])