pyyeti.nastran.n2p.formrbe3¶
- pyyeti.nastran.n2p.formrbe3(uset, GRID_dep, DOF_dep, Ind_List, UM_List=None)[source]¶
Form a least squares interpolation matrix, like RBE3 in Nastran.
- Parameters:
uset (pandas DataFrame) – A DataFrame as output by
pyyeti.nastran.op2.OP2.rdn2cop2()GRID_dep (integer) – Id of dependent grid.
DOF_dep (integer) – Contains all or a subset of the digits 123456 giving the dependent component DOF.
Ind_List (list) – List of independent grids and DOF’s: [DOF_Ind1, GRIDS_Ind1, DOF_Ind2, GRIDS_Ind2, …], where:
DOF_Ind1 : 1 or 2 element 1d array_like containing the component DOF (ie, 123456) of the nodes in GRIDS_Ind1 and, optionally, the weighting factor for these DOF. If not input, the weighting factor defaults to 1.0. GRIDS_Ind1 : 1d array_like of node ids corresponding to DOF_Ind1 ...
For example:
[[123, 1.2], [95, 195, 1000], 123456, 95]
follows the pattern:
[[dof_ind1, scale], [grids_ind1], dof_ind2, grids_ind2]
UM_List (None or array_like; optional) – List of m-set grids and DOF’s: [GRID_MSET1, DOF_MSET1, GRID_MSET2, DOF_MSET2, …] where:
GRID_MSET1 : first grid in the m-set DOF_MSET1 : DOF of first grid in m-set (integer subset of 123456). No weighting factors are allowed here. GRID_MSET2 : second grid in the m-set DOF_MSET2 : DOF of second grid in m-set ...
The UM_List option changes what is dependent (m-set) and what is independent. The m-set DOF will become the dependent DOF instead of GRID_dep, DOF_dep (though it can include these DOF). The total number of m-set DOF must equal the original amount defined in GRID_dep, DOF_dep (max of 6). All m-set DOF must be within the the set of previously entered DOF (either dependent or independent).
- Returns:
rbe3 (ndarray) – The interpolation matrix. Size is # dependent DOF rows by # independent DOF columns. The order of rows and columns corresponds to the order the DOF occur in the USET table uset.
Notes
- The approach used is:
Use
rbgeom_uset()to form the rigid-body modes based on geometry and relative to GRID_dep.Partition the rows of the rigid-body modes down to the independent DOF.
Use least squares approach to ‘invert’ the rigid-body modes.
Transform the result to global coordinates.
Partition the rows to the desired dependent DOF.
If the UM_List option is used, these additional steps are done:
Partition current rbe3 matrix into four parts to separate:
dependent DOF into m-set and non-m-set
independent DOF into m-set and non-m-set
Solve for both parts of the m-set and merge.
Reorder if necessary.
Simplifications are made if the m-set is completely contained within either the dependent or independent set.
When the UM_List option is used, there will be a matrix inversion, unless the m-set is equal to the dependent set (which would be the same as not including the UM_List input). This matrix must be non-singular. If it is close to singular (or singular), this routine will print a warning message and, if singular, scipy.linalg will raise the LinAlgError exception. In this case, choose a different, non-singular set for the m-set. This is similar to choosing DOF for the SUPORT card in Nastran.
- Raises:
ValueError – When the UM_List input is used but the size does not match the GRID_dep and DOF_dep size.
See also
Examples
>>> import numpy as np >>> from pyyeti import nastran >>> # First, make a uset table using all basic coords to simplify >>> # visual inspection: >>> locs = [[ 1, 0, 0], # node 100 in basic ... [ 0, 1, 0], # node 200 in basic ... [-1, 0, 0], # node 300 in basic ... [ 0, -1, 0], # node 400 in basic ... [ 0, 0, 0]] # node 500 in basic >>> uset = nastran.addgrid(None, np.arange(100, 600, 100), 'b', 0, ... locs, 0) >>> # >>> # Define the motion of grid 500 to be average of translational >>> # motion of grids: 100, 200, 300, and 400. >>> rbe3 = nastran.formrbe3( ... uset, 500, 123456, [123, [100, 200, 300, 400]]) >>> np.set_printoptions(linewidth=75) >>> print(rbe3+0) [[ 0.25 0. 0. 0.25 0. 0. 0.25 0. 0. 0.25 0. 0. ] [ 0. 0.25 0. 0. 0.25 0. 0. 0.25 0. 0. 0.25 0. ] [ 0. 0. 0.25 0. 0. 0.25 0. 0. 0.25 0. 0. 0.25] [ 0. 0. 0. 0. 0. 0.5 0. 0. 0. 0. 0. -0.5 ] [ 0. 0. -0.5 0. 0. 0. 0. 0. 0.5 0. 0. 0. ] [ 0. 0.25 0. -0.25 0. 0. 0. -0.25 0. 0.25 0. 0. ]] >>> # >>> # Example showing UM_List option: >>> rbe3um = nastran.formrbe3( ... uset, 500, 123456, [123, [100, 200, 300, 400]], ... [100, 12, 200, 3, 300, 23, 400, 3]) >>> print(rbe3um+0) [[ 0. -1. 0. -1. -1. 0. 4. 0. 0. 0. 0. 0. ] [ 0. 0.5 -0.5 0. -0.5 -0.5 0. 2. 0. 0. 0. 2. ] [-1. 0. 0. 0. 0. 0. 0. 0. 2. 1. -1. 0. ] [ 0. -0.5 -0.5 0. 0.5 -0.5 0. 2. 0. 0. 0. -2. ] [ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 2. 0. ] [-1. 0. 0. 0. 0. 0. 0. 0. 2. -1. -1. 0. ]] >>> # >>> # Example showing UM_List option including some dependent dof: >>> rbe3um2 = nastran.formrbe3( ... uset, 500, 123456, [123, [100, 200, 300, 400]], ... [100, 12, 200, 3, 300, 3, 500, 23]) >>> print(rbe3um2+0) [[ 0. -1. 0. -1. 0. -1. 0. 0. 4. 0. 0. 0. ] [ 0. 1. 0. 0. 1. -1. 0. 0. 0. 0. 0. 4. ] [ 0. 0. 0. 0. 0. 0. 0. 1. 0. 2. 0. 0. ] [ 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 2. 0. ] [ 0. 0.25 0.25 0. 0.5 -0.25 0.25 0. 0. 0. 0. 1. ] [ 0.5 0. 0. 0. 0. 0. 0. 0.5 0. 0.5 0.5 0. ]]