Quickly apply gravity loads and obtain mass and stiffness matrices¤
This live script is written as a guided walkthrough for a post-processing workflow. It focuses on retrieving, organizing, and visualizing model or response data after an OpenSees analysis. Read the text cells first, then run each code cell in order so that the variables, model state, and recorded results are available for the later sections.
This demonstrates how to quickly create gravity loads based on the mass matrix.
It also demonstrates how to obtain the model's stiffness, mass, and damping matrices.
1 2 3 4 | |
FE Model¤
This section creates the finite-element idealization used by the rest of the example. Check the dimensions, tags, and connectivity here before moving on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Apply the gravity load¤
The opstool utility provides a function pre.createGravityLoad to quickly apply gravity loads. This function internally retrieves all masses in the model, including those defined at nodes, in elements, and in materials. You only need to provide the multiplier (gravitational acceleration) and the direction of load application.
1 2 3 4 | |
1 2 3 4 | |
Therefore, you can easily create gravity loads directly through the above commands. The way you specify the mass when modeling is arbitrary. opstool can help you do all the internal conversions!
Get Model Mass¤
pre.getNodeMass returns a dictionary containing all masses defined in the model, both at nodes and elements.
1 2 3 4 5 6 7 8 9 10 11 | |
Get system matrix¤
Get Matrix from Penalty-constraint method¤
1 2 3 4 5 6 7 | |
1 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
It can be observed that all degrees of freedom are preserved in the system matrix, and a large penalty number is added.
Get Matrix from Transformation-constraint approach¤
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
It can be observed that the constrained degrees of freedom are eliminated from the system matrix (only nodes 4 and 6 are retained), thus reducing the dimension of the system matrix.