Stiffness eigenmodes of a single finite element: feigen (German for figs) solves K·φ = λφ, names every mode and plots it. Rigid-body and hourglass modes show up as zero eigenvalues.
fpm run -- -e qua -d 1 # 4-node quad, one cubature point
# cubature points: 1, zero modes: 5
# mode eigenvalue match name
# 1 0.00000E+00 100.% translation x u=(1,0)
# ...
# 4 0.00000E+00 100.% bending x u=(xy,0) <- hourglass
# ...
# wrote qua_p1_lag_d1.png
fpm run -- -e hex -p 2 -f serendipity -o hex20.svg
fpm run -- --helpThe -- separates fpm's options from feigen's; after fpm install, run
feigen -e hex directly. The same steps are a library, module feigen:
q = cubature(CUB_QUA, 1) ! one point: reduced integration
s = shapefunc(q, 1) ! 4-node quadrilateral
K = stiffness(s, q, s%coords, material(2, 1._dp, 0.3_dp))
call modes(K, lambda, phi)
print *, count(lambda == 0) ! 5: 3 rigid-body + 2 hourglass
call name_modes(s%coords, lambda, phi, names, match)
call plot_modes(s, s%coords, lambda, phi, names, 0.2_dp, 'modes.svg')Coding agents: the complete API reference is llms.txt, and contributor instructions are in AGENTS.md.
- Lines, triangles, quadrilaterals, tetrahedra, hexahedra and wedges of any order, and serendipity quadrilaterals and hexahedra (fortran_shapefuncs).
- Any cubature degree, default
2*order, to show the hourglass modes of reduced integration (fortran_cubatures). - Reference or distorted geometry:
--coordsreads one node per line. - Isotropic linear elastic material; plane strain in 2D.
- Mode names (translation, rotation, expansion, tension/compression, shear, bending, torsion, warping, hourglass) with a match percentage; complete for linear line, quad and hex elements.
- One PNG, SVG or PDF with a subplot per mode, named after the element by default
(
qua_p1_lag_d2.png), drawn with fplotlib.
Conventions: degrees of freedom node by node, Voigt order xx, yy, zz, xy, xz, yz, and
eigenvalues below 1e-10*max|λ| are exactly zero.
With fpm 0.13 or later:
git clone https://github.com/willklausler/feigen && cd feigen
fpm install --profile release # puts feigen in ~/.local/binTo use the module in your own fpm project, add to your fpm.toml:
[dependencies]
feigen = { git = "https://github.com/willklausler/feigen", tag = "v0.1.0" }There is no make build: the dependencies stdlib, fplotlib and FLAP are fpm packages.
- User manual and API documentation, generated with FORD (
tools/doc.sh) - llms.txt: the API reference and the program's options as one plain-text file, also the manual's source
man ./man/feigen.3(man/feigen.3)- Example programs in example/ (
fpm run --example --all) and the program in app/ (fpm run)
CI tests every push on:
| Compiler | Linux | macOS | Windows |
|---|---|---|---|
| gfortran 14 | yes | yes | yes |
| gfortran 13 | yes | ||
| ifx 2026 | yes |
nvfortran, LLVM flang 21 and ifx on Windows cannot build the dependencies; see llms.txt.
Checking the eigenvalues of an element stiffness matrix is a standard test of a new element: the number of zero eigenvalues must equal the number of rigid-body modes, and any extra zero is a spurious (hourglass) mode [1, 2]. The test is usually a throwaway script. General finite element codes compute eigenmodes of an assembled model, usually vibration modes with a mass matrix, and do not name them. feigen runs the test for every element of fortran_shapefuncs from one command line, names the modes and draws them.
- R. D. Cook, D. S. Malkus, M. E. Plesha, R. J. Witt, Concepts and Applications of Finite Element Analysis, 4th ed., Wiley, 2002.
- K.-J. Bathe, Finite Element Procedures, Prentice Hall, 1996.
- D. P. Flanagan, T. Belytschko, A uniform strain hexahedron and quadrilateral with orthogonal hourglass control, International Journal for Numerical Methods in Engineering 17(5), 679–706, 1981. doi:10.1002/nme.1620170504
- O. C. Zienkiewicz, R. L. Taylor, J. Z. Zhu, The Finite Element Method: Its Basis and Fundamentals, 6th ed., Butterworth-Heinemann, 2005.
The stiffness matrix and the plane-strain material are standard [2, 4]. The hourglass fields follow Flanagan and Belytschko [3]. The code has not been independently reviewed.
Version 0.1.0. The API may still change before 1.0; changes are recorded in CHANGELOG.md. Bug reports, questions and pull requests are welcome on GitHub; see CONTRIBUTING.md. To cite this package, use CITATION.cff.
MIT. The logo is cropped from a photo by Tijana Drndarski on Unsplash, under the Unsplash License.


