Skip to main content

xdfem2D logo

xdfem2D

Engine on PyPI Python versions Licence: LGPLv3 App release

This repository holds two things, under two licences.

The calculation engine — the source in this tree, xdfem2d, is a Python library for two-dimensional finite element analysis of frames, shells, slabs and grillages, under the GNU Lesser General Public License v3 (LGPLv3). No interface, no dependency on one: it builds a model, solves it, and gives back numbers.

The desktop application — a graphical interface built on that engine, with an assistant that can answer questions about the model you have open. It is free to use, distributed as a compiled application under its own terms, and its source is not published. Download it from Releases; the documentation is at pcachim.github.io/xdfem2D.

The rest of this page is about the library. Releases tagged engine-v* are the engine; those tagged v* are the application.

Install

Python 3.12 or later.

pip install xdfem2d

The core install is NumPy, SciPy and eurocodepy — what solving and design need. Reporting and file exchange are separate extras, because a solver running in a script or a service should not have to install a Word library:

pip install "xdfem2d[report]"   # matplotlib, openpyxl, python-docx
pip install "xdfem2d[dxf]"      # ezdxf
pip install "xdfem2d[ifc]"      # ifcopenshell — IFC (openBIM) import/export
pip install "xdfem2d[all]"      # all of the above

Everything they cover is reached lazily, so the engine imports, assembles, solves and designs without them.

Versioning

The engine and the desktop app are versioned and released independently, on separate cycles — an engine release does not imply a matching app release, and vice versa. Don't expect the two numbers to line up. The app's Help → About dialog lists both, so a bug report can name the right one.


A first model

from xdfem2d import Structure2D

s = Structure2D()
s.add_material('C30/37', elastic_modulus=33e6, unit_weight=25.0)
s.add_section('S', 'C30/37', b=0.3, h=0.5)
s.add_node('N1', 0.0, 0.0)
s.add_node('N2', 6.0, 0.0)
s.add_bar_element('E1', 'N1', 'N2', 'S')
s.add_support('PIN', ux=True, uy=True)
s.add_support('ROLL', uy=True)
s.assign_support('N1', 'PIN')
s.assign_support('N2', 'ROLL')
s.add_load_case('LC')
s.add_distributed_load('E1', 'LC', fye=-20.0, fyd=-20.0)
s.add_analysis_case('LIN', 'Linear', {'LC': 1.0})

results = s.calculate()
print(results['reactions']['LC']['N1'])   # [Rx, Ry, Mz] — 60 kN up at N1

Units are metres, kN, kN·m and kN/m². Angles are in degrees where an angle is named. The full API is in the Engine Reference.

What it does

  • Two analysis domains — a model is either plane (frames and walls in their plane: ux, uy, θz) or plate (slabs and grillages out of plane: w, θx, θy). The DOF machinery is shared; only the meaning of the three components changes, so cases, combinations, envelopes and phasing work identically in both.
  • Bar elements — plane frames and trusses (releases, offsets, springs) and, in the plate domain, grillage beams (bending + St-Venant torsion GJ/L).
  • Triangular and quadrilateral elements — plane stress / plane strain membranes (CST, Allman, ES-FEM; QM6, Q4) and, in the plate domain, plate bending: MITC3 (shear-deformable Mindlin–Reissner, the default — thin and thick slabs) and DKT (thin-plate Kirchhoff), plus MITC4 and DKT4 quads. They report moments mx/my/mxy, principal moments, shears and Wood–Armer design moments.
  • Slab loads — transverse pressure pz, self-weight, a through-thickness thermal gradient, and Winkler area springs (slab on grade). A mesher expands geometric regions into elements.
  • Analysis — linear static, non-linear (unilateral springs), P-Delta, modal, and response spectrum (EC8); in the plate domain the modes are the out-of-plane (vertical) vibration.
  • Load cases and combinations, including nested combinations, envelopes and Eurocode (EN 1990) generation.
  • Design to Eurocodes, via eurocodepy (LGPLv3): reinforced concrete (EC2), steel members (EC3) and timber members (EC5).
  • Construction phasing and model variants.
  • File formats — its own .x2d, plus SAP2000 .s2k, Robot, DXF, IFC and Excel.

Validation and known limits

validation/ holds cases with a closed-form solution, built by the same code that the test suite runs, together with the generated report (Validacao_Programa_MEF_resultados.docx, in Portuguese). They cover bars (N/V/M, settlement, temperature, curved arch), membrane triangles, DKT and MITC3 plates against Navier and Mindlin series, grillages, node and Winkler springs, multi-point constraints, modal analysis (closed-form frequencies, effective masses) and the response-spectrum chain (SRSS, CQC, interpolation), and the plate quads.

What that does and does not establish, so the result is not taken for more:

  • Validated against a formula is not validated for your structure. A case here checks that an element reproduces a textbook solution, not that it suits a given geometry, mesh or load path.
  • The response-spectrum cases check the spectral chain (Sd = Sa/ω², SRSS, CQC); they do not certify the EC8 parameters you choose.
  • Design (EC2/EC3/EC5) is checked on worked examples in validation/; it is an aid to calculation, not a code-compliance certificate.
  • P-Delta, construction phasing and variants have regression tests but no closed-form case in validation/.
  • Mass is lumped and diagonal: concentrated masses give exact frequencies, distributed mass converges as O(h²) from below. Rotary inertia exists only if mtz is given. Mass is taken from the absolute value of Fy, and the percentages of effective mass refer to the mass on the free DOFs.
  • Multi-point constraints are imposed by penalty (relative error ~10⁻⁶, with a tiny spurious reaction).
  • Element springs are lumped (k·L/2 at each end): a uniform state is exact, a varying one converges as O(h²). Unilateral springs are honoured only by NonLinear analysis cases.
  • The CST triangle converges slowly, from below, in bending; the Allman triangle converges faster.

A note on results

xdfem2d computes analysis and design results. It does not verify them, and producing a number is not the same as the number being right for your problem. It is an aid to calculation, not a substitute for engineering judgement: anyone using its output in the design or construction of a real structure is responsible for verifying it independently and remains the engineer of record.

Citing

If xdfem2d contributes to published work, please cite the version you used:

Cachim, P. xdfem2D — 2D finite element analysis of frames, walls, slabs and grillages (engine version X.Y.Z). https://github.com/pcachim/xdfem2D

The version is in xdfem2d.__version__ and on PyPI.

Support and contributing

Bugs and questions, for the library or the application, go to Issues. A report with a model that reproduces the problem is the most useful thing you can send. For anything else, write to eurocodepy@gmail.com. The documentation is at pcachim.github.io/xdfem2D.

This tree is a mirror. Development happens in a private repository and each engine release replaces it wholesale, so a pull request here has nowhere to land — it would be overwritten by the next one.

Licence

The engine — everything in this tree — is under the LGPLv3; see LICENSE.md. It depends on eurocodepy, also LGPLv3, for its Eurocode material databases and design checks.

The desktop application is a separate work, distributed as freeware in compiled form under its own terms (see the Licenses page, and LICENSE.md shipped with the app). Nothing in those terms restricts your rights to the engine: you may use, modify and redistribute it under the LGPLv3, from here or from PyPI.

Metadata

Release files for xdfem2d 2026.10.6

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

Source distribution (sdist)

Source distribution for xdfem2d 2026.10.6
File Size Uploaded
xdfem2d-2026.10.6.tar.gz 2.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for xdfem2d 2026.10.6
File Interpreter ABI Platform
xdfem2d-2026.10.6-py3-none-any.whl Python 3 none any Details

Total release size: 2.7 MB

Release files / xdfem2d-2026.10.6.tar.gz

Download URL xdfem2d-2026.10.6.tar.gz
Size 2.1 MB
Tags Source
SHA-256 checksum
How to use checksums
28155d46f1ef2662d7c85608196b8f8ad18259b57b0f843559b2df71fddd60eb
BLAKE2b-256 checksum
How to use checksums
496785f2bb6bf56978bd6ed81e690f1a352828fa955ff41ae1aaff0057753e79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release files / xdfem2d-2026.10.6-py3-none-any.whl

Download URL xdfem2d-2026.10.6-py3-none-any.whl
Size 604.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b59db313f0d19b40619ca528d03662b7afbe64dd573524c481ec4ad72a760507
BLAKE2b-256 checksum
How to use checksums
90ef742c9ecf8d1421941f9116366c68ff5938a8e810f98f565397142d32c51a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.10.6 This release

2 release files

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