pyyeti.nastran.bulk.wtmpc

pyyeti.nastran.bulk.wtmpc(f, setid, gid_dof_d, coeff_d, gid_dof_i, coeffs_i)[source]

Writes a Nastran MPC card 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.

  • setid (integer) – MPC set ID

  • gid_dof_d (1d array_like) – A length-2 array containing the dependent grid ID and DOF.

  • coeff_d (float) – The coefficient applied to the dependent DOF.

  • gid_dof_i (2d array_like) – 2 column matrix: [grid_ids, DOFs] specifying the independent DOFs

  • coeffs_i (1d array_like) – Array of floats containing the coefficient for each independent DOF. This array much have the same length as the number of rows in gid_dof_i.

Notes

This card will be written in 16 fixed-field format using the wtcard16() function.

Examples

>>> import numpy as np
>>> from pyyeti import nastran
>>> setid = 101
>>> id_dof_d = np.array([21, 1])
>>> coeff_d = -1.0
>>> id_dof_i = np.array([[31, 1], [31, 2], [32, 5]])
>>> coeffs_i = np.array([0.75, 0.25, 1.65])
>>> nastran.wtmpc(1, setid, id_dof_d, coeff_d, id_dof_i, coeffs_i)
MPC*                 101              21               1             -1.
*                     31               1             .75                *
*                                     31               2             .25
*                     32               5            1.65