get_mck¶
- opstool.pre.get_mck(matrix_type, constraints_args, system_args=('FullGeneral',), numberer_args=('Plain',))[source]¶
Get the mass, stiffness, or damping matrix from the OpenSees model. Added in v0.1.15.
- Return type:
DataArray
Parameters:¶
- matrix_typestr
Type of matrix to extract, must be one of ‘m’, ‘k’, ‘ki’, or ‘c’.
- constraints_argsUnion[list, tuple]
Arguments for the constraints type, e.g., (“Penalty”, 1e10, 1e10).
- system_argsUnion[list, tuple], optional
Arguments for the system type, default is (“FullGeneral”,).
- numberer_argsUnion[list, tuple], optional
Arguments for numberer to use, default is (“Plain”,).
Returns:¶
- matrixxarray.DataArray
The extracted matrix, either mass, stiffness, or damping. The coordinates of the DataArray will be the node tags and degrees of freedom–“{ntag}-{dof}”.
Examples:¶
>>> K = get_mck("k", ["Penalty", 1e10, 1e10], ["FullGeneral"], ["Plain"]) >>> print(K.to_numpy()) [[1.0 0.0 0.0] [0.0 1.0 0.0] [0.0 0.0 1.0]]