Combining GMSH and OpenSeesPy for dynamic finite element analysis of floor structures
![[object Object]](/_next/image?url=%2Fimages%2Fauthors%2Fsean_carroll.png&w=256&q=75)
Welcome to the third and final part of our series exploring modal analysis of floors using OpenSeesPy and GMSH. So far, in this series, we’ve covered:
- Calculating floor slab vibration modes using OpenSeesPy (part 1)
- Using Gmsh to generate finite element meshes for floor structures in Python (part 2).
In this final part, we’ll bring these two workflows together and perform a modal analysis on a concrete floor slab, based on a custom mesh. This should be a relatively short tutorial, as we’ve already completed most of the work in parts 1 and 2. Now we just need to tie those two workflows (meshing and modal analysis) together.
The end result will be a Python script (we'll use a Jupyter Notebook for convenience) that can take in the coordinates of vertices defining the shape of a slab, the locations of any openings in the slab and any columns that support the slab and report back:
- modal frequencies
- modal masses
- mode shapes
This will be a useful tool for engineers who need to perform modal analysis on complex floor plate geometries...and all we need are some freely available open-source tools! If you need a more complete introduction (or a refresher) on modal analysis, take a look at my course, Multi-Degree of Freedom Dynamics, Modal Analysis and Seismic Response Simulation in Python.
Multi-Degree of Freedom Dynamics, Modal Analysis and Seismic Response Simulation in Python
Build the knowledge and tools to decode the dynamic response of real-world structures to real-world loads.
After completing this course...
- You will be able to model the influence of earthquake-induced ground motion.
- You will develop numerical tools to solve the coupled equations of motion for multi-degree of freedom systems.
- You will understand the role of modal decomposition in uncoupling the equations of motion and identifying the underlying dynamic characteristics of MDoF systems.
📍 1.0 Floor slab geometry and meshing
We start by reviewing the case study slab that we’ll be analysing. We’ll define the geometry of the slab, its lift-core openings and column locations. We’ll generate and visualise the mesh using the utility functions we developed in part 2.
📍 2.0 Modal Analysis
The last time we performed modal analysis with OpenSeesPy (in part 1), we were processing a simple rectangular mesh that we procedurally defined. This time, we’re processing the mesh that GMSH has generated. So, we’ll need to slightly modify the code we previously wrote for modal analysis. But the broad strokes will be the same; we’ll extract modal frequencies and mode shapes and then use the mode shape data to calculate modal masses.
📍 3.0 Visualising modal properties
Finally, we’ll build a nice visualisation for the mode shape data. There’s quite a lot we could do in terms of mode shape visualisation, animating them for example would be a great idea. But we’ll stick with static renderings here since this gives us all the information we actually need.
📍 4.0 Review and wrap up
We’ll wrap up by highlighting some additional steps you might like to take to further enhance your analysis pipeline.
📁 Remember to download the complete Jupyter Notebook for this tutorial. It contains all of the code, ready to run.
1.0 Floor slab geometry and meshing
Let’s start by defining the slab that we want to analyse. I’ve mocked up a relatively simple L-shaped slab that contains two openings and 16 columns, Fig 1.

Fig 1. Case-study slab showing overall dimensions and layout of openings and columns.
We’ll assume that the openings are for lift or stair-cores that rise through the building, providing lateral stability. As such, we’ll assume that the slab is restrained against both in-plane and out-of-plane translation at the openings.
We will assume that the slab is only restrained against out-of-plane (vertical) translation at the column locations. And we’ll assume the edge of the slab is completely unrestrained (free to move in all directions).
Since we’re assuming a concrete flat slab construction, we can specify the following generic concrete properties:
All Access Membership
Learn, revise or refresh your knowledge and master engineering analysis and design
Access Every Course and Tool
- Over 1140 lectures & over 234 hours of HD video content
- Access member-only 'deep dive' tutorials
- Access all downloads, pdf guides & Python codes
- Access to the StructureWorks Blender addon + updates
- Packed development roadmap of courses & tutorials
- Price Guarantee – avoid future price rises as we grow
- Priority Q&A support
- Course completion certificates
- Early access to new courses
Featured Tutorials and Guides
If you found this tutorial helpful, you might enjoy some of these other tutorials.
Code, Context, and Calculation - A Modern Framework for Engineering
Building reliable and auditable systems with Python and AI

James O'Reilly






