cd /news/developer-tools/fortran-cubatures-and-fortran-shapef… · home › topics › developer-tools › article
[ARTICLE · art-150075] src=fortran-lang.discourse.group ↗ pub= topic=developer-tools verified=true sentiment=· neutral

Fortran_cubatures and fortran_shapefuncs: FE quadrature and shape functions of any order

Will Klausler released two companion Fortran Package Manager (fpm) packages, fortran_cubatures and fortran_shapefuncs, providing finite element quadrature and shape functions of arbitrary element order, with shapefuncs at tag v0.2.0 pulling in cubatures as a dependency. Klausler wrote the modules for FEAP research and used Claude Code extensively to generalize them to arbitrary order, add serendipity elements, expand tests, and prepare the GitHub release, noting the code has not been independently reviewed. Each repository includes an AGENTS.md for coding agents and an llms.txt containing the full API in one plain-text file that also serves as the user manual.

read1 min views2 publishedOct 14, 2026

Greetings,

I’d like to share two companion fpm packages for writing finite element codes:

use cubatures
use shapefuncs
type(cubature)  :: q
type(shapefunc) :: s

q = cubature(CUB_HEX, 4)                     ! integration points
s = shapefunc(q, 2)                          ! 27-node hexahedron at those points
print *, s%nnodes, sum(s%func(:,1))          ! 27  1.0
s = shapefunc(q, 2, family=SHP_SERENDIPITY)  ! 20 nodes

Packages’ contents

As far as I could find, nothing else in Fortran covers this: stdlib and quadpack are one-dimensional, triasymq is FORTRAN 77 without line or wedge rules, and solvers like Elmer keep their shape functions internal. Corrections are welcome if I missed something.

How they were made

I originally wrote these modules for use in FEAP for my research. For this release, I used Claude Code extensively to generalize both modules to arbitrary element order, add serendipity elements, expand the tests, and polish them for GitHub release. I’ve started verifying the packages with an FE modal analysis project, also on my page. The code hasn’t been independently reviewed, so I’d especially welcome eyes on the higher order elements.

Each repo also has an AGENTS.md with instructions for coding agents working on the package, and an llms.txt with the whole API in one plain-text file (it’s also the source of the user manual).

Install (shapefuncs pulls in cubatures):

[dependencies]
fortran_shapefuncs = { git = "https://github.com/willklausler/fortran_shapefuncs", tag = "v0.2.0" }

Docs: cubatures · shapefuncs

DOI: 10.5281/zenodo.23300827 · 10.5281/zenodo.23301496

Question: would hierarchical bases, or node numberings that match Gmsh or VTK, be useful to you?

── more in #developer-tools 4 stories · sorted by recency
── more on @will klausler 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/fortran-cubatures-an…] indexed:0 read:1min 2026-10-14 · —