Skip to main content
Ctrl+K

femorph-solver

  • Getting started
  • User guide
  • Reference
  • Cross-vendor interop
  • Best practices and troubleshooting
    • Verification
    • Examples
    • API reference
    • Changelog
    • Developer documentation
  • GitHub
  • Issues
  • Getting started
  • User guide
  • Reference
  • Cross-vendor interop
  • Best practices and troubleshooting
  • Verification
  • Examples
  • API reference
  • Changelog
  • Developer documentation
  • GitHub
  • Issues

Section Navigation

  • Quickstart
    • Static cantilever — first example
    • Modal cantilever — first modal example
  • Tutorials
    • Tutorial 6 — End-to-end deliverable workflow
    • Tutorial 2 — Modal survey of a cantilever bracket
    • Tutorial 4 — Harmonic frequency response of a cantilever bracket
    • Tutorial 5 — Cyclic-symmetry rotor design check
    • Tutorial 3 — Pressure-vessel design-by-analysis (Lamé thick cylinder)
    • Tutorial 1 — Cantilever beam under combined loading
  • Pre-processing
    • Loading a CDB input deck
    • Building a model from a pyvista grid
  • Analyses
  • Post-processing
    • Exporting results to VTK / ParaView
    • Plotting mode shapes
    • HEX8 — elastic-strain post-processing
    • Mode-shape animation — cantilever bending modes
    • Modal participation factors + effective modal mass
    • Reaction forces — global equilibrium and root moment from a tip load
    • Nodal stress recovery + invariants — Lamé thick-walled cylinder
    • Principal stresses + principal directions on a thick cylinder
  • Elements
  • Verification gallery
    • Irons constant-strain patch test
    • Single-hex uniaxial tension — Hooke’s law + Poisson check
    • Cantilever tip deflection — Euler-Bernoulli closed form
    • NAFEMS LE1 — elliptic membrane (plane stress)
    • Clamped square plate under uniform pressure (NAFEMS LE5)
    • Cantilever under uniformly distributed load — Euler–Bernoulli closed form
    • Free-free axial rod — natural frequencies
    • Cantilever natural frequency — Rao 2017 Table 8.1
    • Simply-supported beam — uniformly-distributed load
    • Fixed-free axial rod — natural frequencies
    • Clamped-clamped beam — first three bending natural frequencies
    • Pinched ring — Castigliano diametrical deflection
    • Cantilever Saint-Venant torsion — rectangular cross-section
    • Simply-supported plate — first transverse bending mode
    • Simply-supported beam — first three bending natural frequencies
    • Plate with a circular hole — Kirsch stress concentration
    • Simply-supported plate under uniform pressure (Navier series)
    • Shear-locking demonstration — HEX8 integration variants
    • Cantilever beam — first four bending modes
    • Cantilever beam under a tip moment
    • Clamped-clamped beam under a central point load
    • Simply-supported beam under a central point load
    • Propped cantilever under uniformly-distributed load
    • Mesh-refinement convergence — cantilever Euler-Bernoulli
    • Mesh-refinement convergence — Lamé thick cylinder
    • L-shaped frame under tip load — Castigliano on a two-member portal
    • Propped cantilever with central point load
    • Lamé thick-walled cylinder under internal pressure
    • Cantilever with off-tip point load — load-position shape function
    • Continuous beam over three supports — Clapeyron’s three-moment theorem
    • Cantilever under linearly-varying distributed load (triangular)
    • Simply-supported beam with off-center point load
    • Cook’s membrane — mesh-distortion benchmark (1974)
  • Examples
  • Quickstart
  • Modal cantilever — first modal example

Note

Go to the end to download the full example code.

Modal cantilever — first modal example#

A 60-second introduction to free-vibration analysis in femorph-solver: build a steel plate, clamp one edge, extract the first 5 modes, render the lowest mode shape.

from __future__ import annotations

import numpy as np
import pyvista as pv

import femorph_solver as fs

Build a 20 × 20 × 2 hex plate#

LX, LY, LZ = 1.0, 1.0, 0.01

grid = pv.StructuredGrid(
    *np.meshgrid(
        np.linspace(0.0, LX, 21),
        np.linspace(0.0, LY, 21),
        np.linspace(0.0, LZ, 3),
        indexing="ij",
    )
).cast_to_unstructured_grid()

Wrap, stamp steel, clamp the x=0 edge#

m = fs.Model.from_grid(grid)
m.assign(fs.ELEMENTS.HEX8, material={"EX": 2.0e11, "PRXY": 0.30, "DENS": 7850.0})
m.fix(where=np.asarray(grid.points)[:, 0] < 1e-9)

Extract 5 modes#

res = m.solve_modal(n_modes=5)

print("Mode     f [Hz]")
for i, f in enumerate(res.frequency, start=1):
    print(f"{i:>3}   {f:>10.3f}")
Mode     f [Hz]
  1       26.507
  2       33.751
  3      166.483
  4      175.654
  5      175.890

Visualise mode 1#

grid_plot = fs.io.modal_result_to_grid(m, res)
phi1 = grid_plot.point_data["mode_1_disp"]
factor = 0.15 / (np.max(np.abs(phi1)) + 1e-30)

plotter = pv.Plotter(off_screen=True)
plotter.add_mesh(grid_plot, style="wireframe", color="gray", opacity=0.3)
plotter.add_mesh(
    grid_plot.warp_by_vector("mode_1_disp", factor=factor),
    scalars="mode_1_magnitude",
    show_scalar_bar=True,
    scalar_bar_args={"title": f"mode 1 ({res.frequency[0]:.1f} Hz)"},
)
plotter.add_axes()
plotter.show()
example quickstart modal

Total running time of the script: (0 minutes 1.298 seconds)

Download Jupyter notebook: example_quickstart_modal.ipynb

Download Python source code: example_quickstart_modal.py

Download zipped: example_quickstart_modal.zip

Gallery generated by Sphinx-Gallery

On this page
  • Build a 20 × 20 × 2 hex plate
  • Wrap, stamp steel, clamp the x=0 edge
  • Extract 5 modes
  • Visualise mode 1
Edit on GitHub
Show Source

© Copyright 2026, K-Matrix Engineering LLC.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.17.1.