pyyeti.nastran.n2p.build_coords

pyyeti.nastran.n2p.build_coords(cords)[source]

Builds the coordinate system dictionary from an array of coordinate card information.

Parameters:

cords (2d array_like) – 2d array, n x 12. Each row has:

[cid, ctype, refcid, a1, a2, a3, b1, b2, b3, c1, c2, c3]
where:
    ctype = 1 for rectangular
    ctype = 2 for cylindrical
    ctype = 3 for spherical

Each row provides the same information as would be provided on a CORD2R, CORD2C, or CORD2S card. The ID of each coordinate system is cid, the type is ctype as shown above, and refcid is the reference coordinate system ID. The points A, B and C are defined by (a1, a2, a3), (b1, b2, b3) and (c1, c2, c3), respectively.

Returns:

coordref (dictionary) – Dictionary with the keys being the coordinate system id (cid) and the values being the 5x3 matrix:

[cid ctype 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 ctype = 1 which means rectangular)

Notes

This routine loops over the coordinate systems according to reference cid order.

Raises:
  • RuntimeError – When a reference cid is not found.

  • RuntimeError – When non-equal duplicate coordinate systems are found. (Equal duplicates are quietly ignored).