Skip to main content

FEM Core

NGSolve/Netgen finite-element model-building core — no PySide6 or Qt dependency. Runs headlessly (no display required).

Python Version License

Features

  • 🧱 Layered FEM pipeline — mesh → function space → weak-form assembly, each stage a swappable service
  • 🧩 Typed, serializable models — FemModel, FemFormulation, BoundaryCondition, ... with to_dict()/from_dict()
  • 🌊 Physics formulations — linear elasticity, (complex) Helmholtz, Reissner-Mindlin plates, Naghdi shells, steady heat conduction, and CUSTOM symbolic weak forms
  • 🎯 Domain facades — AcousticModel, PlateModel, ShellModel builders in physics vocabulary
  • 🧮 Studies — static, modal and frequency-sweep analyses through one StudyManager
  • 📐 Stress — stresses, membrane forces, moments and shear forces as CoefficientFunctions
  • 🗂️ Geometry import — STEP/IGES/BREP with deterministic, geometry-sorted region indices
  • 📈 Aggregated results — integrals, means, maxima and minima of any field expression over solids, faces or edges, per frequency of a sweep
  • 💾 Results and projects — HDF5 result files and shared FemProject documents, with the fem-core-run / fem-core-view CLIs
  • 🔒 Safe expressions — boundary and custom-form expressions parsed by a restricted AST walker, never eval()
  • 🧪 Dependency-injectable services — every service behind a Protocol, so tests can mock NGSolve/Netgen
  • 📊 Visualization — VTK post-processing (.vtu, .png, interactive) via the companion package fem-post

Scope

fem-core builds the mesh, function space and forms, and solves them with static, modal or frequency-sweep studies. Transient (time-stepping) analysis is out of scope for now.

Installation

pip install fem-core            # from PyPI
pip install "fem-core[viz]"     # plus fem-post (VTK post-processing)
pip install "fem-core[pardiso]" # plus MKL, for the PARDISO solver (x86-64 Linux/Windows)

fem-core is proprietary software (see License below). The optional pardiso extra installs Intel's MKL (with tbb and intel-openmp), which is governed by Intel's own licences, not fem-core's; fem-core works without it.

For development, from the repo root:

uv sync
source .venv/bin/activate

Quick Start

from netgen.occ import Box, OCCGeometry, Pnt

from fem_core.enums import BoundaryConditionType, FemDimension, FunctionSpaceType, StudyType
from fem_core.managers.fem_model_manager import FemModelManager
from fem_core.managers.study_manager import StudyManager
from fem_core.models.boundary_condition import BoundaryCondition
from fem_core.models.fem_formulation import FemFormulation
from fem_core.models.fem_model import FemModel
from fem_core.models.function_space_config import FunctionSpaceConfig
from fem_core.models.mesh_config import MeshConfig
from fem_core.models.study import Study
from fem_core.models.study_parameters import ModalStudyParameters, StaticStudyParameters
from fem_core.physics import LINEAR_ELASTICITY, LinearElasticityParameters

geo = OCCGeometry(Box(Pnt(0, 0, 0), Pnt(100, 20, 10)))

model = FemModel(
    name="Bracket",
    dimension=FemDimension.DIM_3D,
    formulation=FemFormulation(
        formulation_type=LINEAR_ELASTICITY.id,
        parameters=LinearElasticityParameters(E=210e9, nu=0.3, body_force_y=-9.81),
    ),
    function_space=FunctionSpaceConfig(space_type=FunctionSpaceType.VECTOR_H1, order=2),
    mesh_config=MeshConfig(maxh=5.0),
    boundary_conditions=[BoundaryCondition(bc_type=BoundaryConditionType.DIRICHLET, region="fixed_face")],
)

manager = FemModelManager()
managed = manager.build_model(model, geo=geo.shape)  # mesh -> function space -> forms

studies = StudyManager(manager)
static = studies.create_study(managed.model_id, Study(parameters=StaticStudyParameters()))
studies.run_study(static.study_id)
static.result.gridfunction

modal = studies.create_study(
    managed.model_id, Study(study_type=StudyType.MODAL, parameters=ModalStudyParameters(num_modes=6))
)
studies.run_study(modal.study_id)
modal.result.eigenvalues  # omega^2, ascending

Facades build the same FemModel from domain vocabulary:

from fem_core.facades.acoustic_model import AcousticModel

fem_model = (
    AcousticModel(name="Cabin Acoustics", speed_of_sound=343.0, density=1.225)
    .add_sound_hard_wall("rigid_walls")
    .add_impedance_boundary("absorber_panel", impedance=415.0 + 50.0j)
    .to_fem_model()
)

Saved projects and results can be solved or viewed from the command line:

fem-core-run beam.femp
fem-core-view beam.results.h5 --study Modes --png modes.png

Documentation

  • User Guide — studies, undo/redo, result storage, projects, geometry import, 2D/shell/plate models, stress, subdomains, visualization
  • Architecture — layers, services, managers, facades and key design decisions
  • Development — testing and releasing
  • fem-post — VTK post-processing
  • Examples and validations

License

Proprietary — see LICENSE. Third-party libraries keep their own licences, listed in NOTICE.

Metadata

Release files for fem-core 0.1.42

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for fem-core 0.1.42
File Interpreter ABI Platform Actions
fem_core-0.1.42-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for fem_core-0.1.42-cp312-cp312-win_amd64.whl
fem_core-0.1.42-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for fem_core-0.1.42-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Total release size: 27.6 MB

Release files / fem_core-0.1.42-cp312-cp312-win_amd64.whl

Download URL fem_core-0.1.42-cp312-cp312-win_amd64.whl
Size 3.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
25f4b7a32871aee3e824711668a7dc9fb3e874cb8310bbd35fed60fb71435f41
BLAKE2b-256 checksum
How to use checksums
8e1e43b96bcb8ea99f3d1c5fcb872929493fbb7ae708bd58d854ae35c8ab5c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / fem_core-0.1.42-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL fem_core-0.1.42-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 24.4 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f836d17669b8d5432f004215808c6f86f9cb2571efac4cdc44312511f312ef17
BLAKE2b-256 checksum
How to use checksums
3a12a6e442a1fb521ca5a1d857420d65e543c3ac8056e5bd181d3f5d6381817c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for fem-core 0.1.42

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fem_core-0.1.42-cp312-cp312-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.42 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page