pyyeti.nastran.n2p.mkusetmask

pyyeti.nastran.n2p.mkusetmask(nasset=None)[source]

Get bit-masks for use with the Nastran USET table.

Parameters:

nasset (None or string; optional) – Specifies Nastran set or sets. If a string, can be a single set (eg, ‘a’) or multiple sets combined with the ‘+’ (eg, ‘a+o+m’).

Returns:

mask (integer or dict) – If nasset is None, returns a dictionary of bit-masks that is indexed by the lowercase set letter(s). Otherwise, mask is the bit mask for the specific set(s).

Notes

Note that the analyst rarely needs to use this function directly; other routines will call this routine automatically and use the resulting vector or mask internally.

The sets (and supersets) currently accounted for are:

Sets              Supersets

 m  -------------------------------------\
 s  ------------------------------\       > g --\
 o  -----------------------\       > n --/       \
 q  ----------------\       > f --/       \       \
 r  ---------\       > a --/       \       \       > p
 c  --\       > t --/       \       > fe    > ne  /
 b  ---> l --/               > d   /       /     /
 e  ------------------------/-----/-------/-----/

User-defined sets: u1, u2, u3, u4, u5, and u6.

Note: MSC.Nastran apparently changes the b-set bitmask not only between different versions but also between different machines. Sometimes the 2nd bit goes to the b-set and sometimes it goes to the s-set. However, so far, the s-set always has other bits set that can be (and are) checked. Therefore, to work around this difficulty, the pyyeti.nastran.op2.OP2.rdn2cop2() routine clears the 2nd bit for all s-set DOF. Because of that, this routine can safely assume that the 2nd bit belongs to the b-set and no manual changes are required.

Examples

>>> from pyyeti import nastran
>>> nastran.mkusetmask('q')
4194304
>>> nastran.mkusetmask('b')
2097154
>>> nastran.mkusetmask('q+b')
6291458