pyyeti.nastran.bulk.wtgrids

pyyeti.nastran.bulk.wtgrids(f, grids, cp=0, xyz=array([[0., 0., 0.]]), cd=0, ps='', seid='', form='{:16.8f}')[source]

Writes Nastran GRID cards to a file.

Parameters:
  • f (string or file_like or 1 or None) – Either a name of a file, or is a file_like object as returned by open() or io.StringIO. Input as integer 1 to write to stdout. Can also be the name of a directory or None; in these cases, a GUI is opened for file selection.

  • grids (1d array_like; length N) – Vector of grid ids. The length of grids will be referenced as N in explanations below.

  • cp (integer scalar or vector) – Id of coordinate system(s) grids are defined in; either scalar or vector with N rows.

  • xyz (2d array_like) – 3-column matrix of grid locations; 1 row or N rows.

  • cd (integer scalar or vector) – Id of displacement coordinate system for grids; either scalar or vector with N rows.

  • ps (integer scalar or vector) – Permanent constraints for grids, eg: 123456; either scalar or vector with N rows.

  • seid (integer scalar or vector) – Superelement id; either scalar or vector with N rows.

  • format (string) – String specifying format of XYZ values; must produce 8 or 16 character strings.

Returns:

None

Examples

>>> from pyyeti import nastran
>>> import numpy as np
>>> nastran.wtgrids(1, np.arange(1, 4))
GRID*                  1               0      0.00000000      0.00000000
*             0.00000000               0
GRID*                  2               0      0.00000000      0.00000000
*             0.00000000               0
GRID*                  3               0      0.00000000      0.00000000
*             0.00000000               0
>>> xyz = np.array([[.1, .2, .3], [1.1, 1.2, 1.3]])
>>> nastran.wtgrids(1, [100, 200], xyz=xyz, cd=10,
...                 form='{:8.2f}')
GRID         100       0    0.10    0.20    0.30      10
GRID         200       0    1.10    1.20    1.30      10