pyyeti.nastran.n2p.mksetpv¶
- pyyeti.nastran.n2p.mksetpv(uset, major, minor)[source]¶
Make a set partition vector from a Nastran USET table.
- Parameters:
uset (pandas DataFrame) – A DataFrame as output by
pyyeti.nastran.op2.OP2.rdn2cop2()major (integer or string) – An integer bitmask or a set letter or letters (see below).
minor (integer or string) – An integer bitmask or a set letter or letters.
- Returns:
pv (1d ndarray) – A True/False vector for partitioning minor from major. Length = number of DOF in major.
Notes
The inputs major and minor can be specified as a combination of sets by using the ‘+’ sign. See help in
mkusetmask()for more information on how to specify the sets.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.
See also
mkdofpv(),pyyeti.nastran.op2.rdnas2cam(),formulvs(),usetprt(),rbgeom_uset(),mkusetmask(),pyyeti.nastran.op2.OP2.rdn2cop2()- Raises:
ValueError – When minor is not completely contained in major.
Examples
>>> import numpy as np >>> from pyyeti import nastran >>> # First, make a uset table >>> # node 100 in basic is @ [5, 10, 15] >>> # node 200 in cylindrical is @ [r, th, z] = [32, 90, 10] >>> # z_cyl = x-basic; r_cyl = y-basic >>> # Also, put 100 in b-set and 200 in m-set. >>> cylcoord = np.array([[1, 2, 0], [0, 0, 0], [1, 0, 0], ... [0, 1, 0]]) >>> uset = nastran.addgrid( ... None, [100, 200], ['b', 'm'], [0, cylcoord], ... [[5, 10, 15], [32, 90, 10]], [0, cylcoord]) >>> bset = nastran.mksetpv(uset, 'p', 'b') # 1:6 are true >>> np.set_printoptions(linewidth=75) >>> bset array([ True, True, True, True, True, True, False, False, False, False, False, False], dtype=bool) >>> mset = nastran.mksetpv(uset, 'p', 'm') # 7:12 are true >>> mset array([False, False, False, False, False, False, True, True, True, True, True, True], dtype=bool) >>> rcqset = nastran.mksetpv(uset, 'p', 'r+c+q') # all false >>> rcqset array([False, False, False, False, False, False, False, False, False, False, False, False], dtype=bool)