<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: emptiesvoid-cloud</title>
    <description>The latest articles on DEV Community by emptiesvoid-cloud (@emptiesvoidcloud).</description>
    <link>https://dev.to/emptiesvoidcloud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4112676%2F824feb71-37df-4702-b2e1-3a1bef2fe532.png</url>
      <title>DEV Community: emptiesvoid-cloud</title>
      <link>https://dev.to/emptiesvoidcloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/emptiesvoidcloud"/>
    <language>en</language>
    <item>
      <title>QF Solver 0.2.12: Progress on Dynamics, Nonlinear Mechanics and Numerical Verification</title>
      <dc:creator>emptiesvoid-cloud</dc:creator>
      <pubDate>Mon, 16 Nov 2026 17:11:58 +0000</pubDate>
      <link>https://dev.to/emptiesvoidcloud/qf-solver-0212-progress-on-dynamics-nonlinear-mechanics-and-numerical-verification-2505</link>
      <guid>https://dev.to/emptiesvoidcloud/qf-solver-0212-progress-on-dynamics-nonlinear-mechanics-and-numerical-verification-2505</guid>
      <description>&lt;p&gt;A few months ago, I published my &lt;a href="https://dev.to/emptiesvoidcloud/qf-solver-027-building-an-inspectable-python-fem-solver-with-reproducible-vv-27c2"&gt;first article about QF Solver 0.2.7&lt;/a&gt;. At that time, the project was still quite early in its development.&lt;/p&gt;

&lt;p&gt;Since then, I've spend quite a lot of time working on the solver. Some things were added, other parts needed corrections, and the verification process took more work than I initially expected.&lt;/p&gt;

&lt;p&gt;On November 8, I released &lt;strong&gt;QF Solver 0.2.12&lt;/strong&gt; on PyPI.&lt;/p&gt;

&lt;p&gt;I wanted to share what changed, what is actually supported by numerical evidence, and what still needs more work.&lt;/p&gt;

&lt;p&gt;QF Solver is an open source finite element solver written in Python, mainly focused on structural mechanics. I'm developing it because I want to understand and inspect the equations, implementation and results rather than just running a model and looking at a stress plot.&lt;/p&gt;

&lt;p&gt;I'm not claiming it can replace a mature industrial solver. There is still quite a lot to do before that would be a reasonable comparison.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftlcdxrudo95kue70tpv9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftlcdxrudo95kue70tpv9.png" alt="TET10 finite element deformation in QF Solver" width="800" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An existing TET10 deformation example from the QF Solver repository.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More work on structural dynamics
&lt;/h2&gt;

&lt;p&gt;One of the main areas I worked on is structural dynamics.&lt;/p&gt;

&lt;p&gt;The starting point is the usual semi-discrete equation of motion:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;M a(t) + C v(t) + K u(t) = f(t)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;QF Solver already had dynamic examples, but I wanted to make some of the workflows easier to reuse and easier to check. Version 0.2.12 includes work on prepared systems, modal bases, reduced harmonic response and modal Newmark integration.&lt;/p&gt;

&lt;p&gt;In modal reduction, the displacement can be approximated as &lt;strong&gt;u(t) ≈ Φ q(t)&lt;/strong&gt;, where Φ contains the selected modes. This reduces the dimension of the problem, but it also introduces an approximation that needs to be checked. The selected basis, damping model, loading and neglected modes can all affect the result.&lt;/p&gt;

&lt;p&gt;The reduced dynamic routes are still experimental. A small residual in a reduced system isn't enough to prove that the full structural response is accurate.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4j6hireo7i3gmmy6fng.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4j6hireo7i3gmmy6fng.png" alt="Harmonic response calculated with QF Solver" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An archived harmonic response example. It illustrates the frequency-domain workflow, not a new validation of every reduced harmonic method.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Newmark integration and time histories
&lt;/h2&gt;

&lt;p&gt;I also continued working on transient response. Newmark integration is one of the available methods, including the average acceleration scheme with &lt;strong&gt;β = 1/4&lt;/strong&gt; and &lt;strong&gt;γ = 1/2&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For a suitable undamped linear system, it is possible to compare the numerical history with an analytical response and monitor energy drift and the dynamic residual. Those checks are useful, but their meaning depends on the exact configuration of the test.&lt;/p&gt;

&lt;p&gt;Version 0.2.12 also includes work on modal Newmark, checkpoints and uniform base acceleration in specific routes. This does not mean arbitrary support motion or every transient configuration has been validated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft1ys9q2dgnp893b8h29h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft1ys9q2dgnp893b8h29h.png" alt="Newmark history from QF Solver" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An archived direct Newmark example from the repository. It should not be confused with a complete validation of the newer modal route.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Some progress on nonlinear mechanics
&lt;/h2&gt;

&lt;p&gt;Another area is nonlinear structural mechanics, especially selected J2 plasticity and geometrically nonlinear formulations.&lt;/p&gt;

&lt;p&gt;I've been working on internal force calculations, tangent checks and the difference between trial and accepted states. This last part is quite important. If a nonlinear increment fails, a retry should not silently keep the material history of an increment that was never accepted.&lt;/p&gt;

&lt;p&gt;It may sound like a small implementation detail, but it matters for consistent results and for debugging difficult cases.&lt;/p&gt;

&lt;p&gt;There is still work to do here. Some of these formulations are only supported for specific configurations and the existing checks don't qualify every possible nonlinear coupling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa8so63p54qbgix5ha2do.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fa8so63p54qbgix5ha2do.png" alt="J2 cyclic response in QF Solver" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An existing J2 response example. It is not a general validation of finite strain plasticity.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification is probably where I spent the most time
&lt;/h2&gt;

&lt;p&gt;I don't want QF Solver to become a collection of features that only work on a handful of demonstration models.&lt;/p&gt;

&lt;p&gt;I'm trying to make the verification work more traceable, with documented inputs, numerical tolerances, reference quantities, residual checks and archived results. There are also cases compared against analytical solutions or other finite element implementations.&lt;/p&gt;

&lt;p&gt;Something I've learned is that passing tests and having a validated numerical method are not the same thing. A software test can check that an API behaves correctly without proving the mechanical model is correct.&lt;/p&gt;

&lt;p&gt;This is also why I'm keeping failed and inconclusive verification cases visible. I'd rather show a limitation than make the project look more mature than it actually is.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1bv5hmx6psiwq4pdddxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1bv5hmx6psiwq4pdddxx.png" alt="Convergence of solid finite elements" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;An archived solid element convergence example. Its interpretation depends on the chosen model and reference values.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The first QF Solver technical report on Zenodo
&lt;/h2&gt;

&lt;p&gt;On November 14, I published a &lt;a href="https://doi.org/10.5281/zenodo.24218291" rel="noopener noreferrer"&gt;technical report on Zenodo&lt;/a&gt; for QF Solver 0.2.12.&lt;/p&gt;

&lt;p&gt;It's called &lt;strong&gt;QF Solver 0.2.12: Numerical Verification Report, Discrete Spectral Comparison of a Weak-Bending Beam Model&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The report studies one discrete modal problem using three beam meshes with &lt;strong&gt;115, 230 and 460 elements&lt;/strong&gt;, six selected weak-bending branches, and reference and added-mass configurations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7e1c25oh14hennjqksi1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7e1c25oh14hennjqksi1.png" alt="Figure 1: archived beam model and point-mass locations" width="799" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. Archived beam model and point-mass locations. Source: QF Solver 0.2.12 Technical Report, Zenodo.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The idea was to compare archived QF Solver modal results with a separately implemented reconstruction of the same discrete generalized eigenvalue problem. It is not a comparison to experimental measurements or proof of convergence to the continuous beam solution.&lt;/p&gt;

&lt;p&gt;The paper includes a diagram of the model, frequency plots, error bounds, residual diagnostics and modal shapes. You can look at the original figures directly in the &lt;a href="https://zenodo.org/records/24218291/files/QF_SOLVER_0212_NUMERICAL_VERIFICATION_REPORT_V1_PUBLICATION_LAST.pdf?download=1" rel="noopener noreferrer"&gt;full PDF on Zenodo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zenodo.org/records/24218291/files/QF_SOLVER_0212_NUMERICAL_VERIFICATION_REPORT_V1_PUBLICATION_LAST.pdf?download=1#page=5" rel="noopener noreferrer"&gt;Figure 1, page 5: beam model and mesh configuration&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For the scalar quantities, the results are encouraging. The report evaluates &lt;strong&gt;36 frequency error bounds&lt;/strong&gt; and &lt;strong&gt;18 added-mass frequency-shift error bounds&lt;/strong&gt;. All of them meet the stated scalar thresholds, provided the numerical spectral enclosures are reliable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ftc3e0647ppgm19lla0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ftc3e0647ppgm19lla0.png" alt="Figure 4: upper bounds on frequency errors" width="799" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 4. Upper bounds on frequency errors compared with the selected numerical threshold. The scalar results remain conditional on the spectral enclosures.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F65thrg14kzd32rpw7j0k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F65thrg14kzd32rpw7j0k.png" alt="Figure 5: upper bounds on added-mass frequency-shift errors" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 5. Upper bounds on added-mass frequency-shift errors, expressed in percentage points.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zenodo.org/records/24218291/files/QF_SOLVER_0212_NUMERICAL_VERIFICATION_REPORT_V1_PUBLICATION_LAST.pdf?download=1#page=11" rel="noopener noreferrer"&gt;Figures 4 and 5, pages 11–12: frequency and shift error bounds&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But there is an important limitation. The auxiliary eigenvector residuals do not satisfy their admissibility threshold, and a complete accepted correspondence of the compared modes has not been established for all meshes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkhz1rdb4o1eyquiqw83x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkhz1rdb4o1eyquiqw83x.png" alt="Figure 6: archived QF and independent auxiliary-vector residuals" width="800" height="668"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 6. Comparison of archived QF residuals and independent auxiliary-vector residuals. The auxiliary residuals exceed their acceptance threshold.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://zenodo.org/records/24218291/files/QF_SOLVER_0212_NUMERICAL_VERIFICATION_REPORT_V1_PUBLICATION_LAST.pdf?download=1#page=13" rel="noopener noreferrer"&gt;Figure 6, page 13: archived QF residuals versus auxiliary vector residuals&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because of that, the complete three-mesh verdict remains &lt;strong&gt;inconclusive&lt;/strong&gt;. The scalar results should not be described as a full modal validation. The study also doesn't establish experimental validation or qualify the entire solver.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffm7okye6vcdxcsg0dd1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffm7okye6vcdxcsg0dd1g.png" alt="Figure 9: archived A115 weak-bending mode shapes" width="800" height="639"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 9. Archived weak-bending mode shapes from the A115 reference model. These plots do not establish complete cross-method modal correspondence.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I think it's still worth publishing these results, including the parts that didn't meet the criteria. It gives a much more useful record of what was tested and what needs improvement.&lt;/p&gt;

&lt;p&gt;The report is a technical preprint and &lt;strong&gt;has not been peer reviewed&lt;/strong&gt;. The supplementary archive supports reproducibility of the postprocessing from archived data. It does not demonstrate a full rerun of the FEM assembly and eigenvalue calculations.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figures reproduced from the QF Solver 0.2.12 Technical Report by Quentin Farinazzo, available on &lt;a href="https://doi.org/10.5281/zenodo.24218291" rel="noopener noreferrer"&gt;Zenodo&lt;/a&gt;, CC BY 4.0.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing version 0.2.12
&lt;/h2&gt;

&lt;p&gt;The published package is available on PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python -m pip install &lt;span class="s2"&gt;"qf-solver==0.2.12"&lt;/span&gt;
qf-solver --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are examples and documentation on the &lt;a href="https://qfsolver.org/" rel="noopener noreferrer"&gt;project website&lt;/a&gt; and in the &lt;a href="https://github.com/emptiesvoid-cloud/QF_solver" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;. Before using a calculation route, I recommend checking its documented scope and limitations. An example running without errors doesn't mean it is validated for every engineering use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;I'm now working toward version &lt;strong&gt;0.3.0&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The focus is on improving the numerical formulations, convergence studies, verification coverage and general code quality. I also want the documentation to make it easier for people to reproduce a result and understand where its assumptions come from.&lt;/p&gt;

&lt;p&gt;QF Solver is still a small project, but it has changed quite a lot since I first wrote about it.&lt;/p&gt;

&lt;p&gt;If you work on FEM, computational mechanics or numerical verification, feel free to take a look. I'm especially interested in feedback about difficult numerical cases or good independent benchmarks to investigate.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://qfsolver.org/" rel="noopener noreferrer"&gt;QF Solver website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/emptiesvoid-cloud/QF_solver" rel="noopener noreferrer"&gt;Source code on GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/qf-solver/0.2.12/" rel="noopener noreferrer"&gt;Version 0.2.12 on PyPI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://doi.org/10.5281/zenodo.24218291" rel="noopener noreferrer"&gt;Technical report and supplementary files on Zenodo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/emptiesvoidcloud/qf-solver-027-building-an-inspectable-python-fem-solver-with-reproducible-vv-27c2"&gt;Previous DEV article about 0.2.7&lt;/a&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>QF Solver 0.2.7: Building an Inspectable Python FEM Solver with Reproducible V&amp;V</title>
      <dc:creator>emptiesvoid-cloud</dc:creator>
      <pubDate>Sun, 06 Sep 2026 18:02:32 +0000</pubDate>
      <link>https://dev.to/emptiesvoidcloud/qf-solver-027-building-an-inspectable-python-fem-solver-with-reproducible-vv-27c2</link>
      <guid>https://dev.to/emptiesvoidcloud/qf-solver-027-building-an-inspectable-python-fem-solver-with-reproducible-vv-27c2</guid>
      <description>&lt;h1&gt;
  
  
  I'm Building an Open-Source Python FEM Solver — Here's Where QF Solver 0.2.7 Stands
&lt;/h1&gt;

&lt;p&gt;For some time now, I've been working on a personal project called &lt;strong&gt;QF Solver&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's an open-source finite-element solver written in Python, mainly focused on structural mechanics and dynamics.&lt;/p&gt;

&lt;p&gt;I'm not going to pretend that it is ready to replace Code_Aster, CalculiX, Abaqus, or every other FEM solver out there.&lt;/p&gt;

&lt;p&gt;It isn't.&lt;/p&gt;

&lt;p&gt;But the project has reached a point where I think it's interesting enough to start showing it publicly, explaining what I'm trying to build, what already works, and also what still needs a lot of work.&lt;/p&gt;

&lt;p&gt;So... here it is.&lt;/p&gt;

&lt;p&gt;Please keep in mind that this is still a relatively young solver. I'm trying to make it serious and reproducible, but I'm also learning a lot while building it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why am I building another FEM solver?
&lt;/h2&gt;

&lt;p&gt;The short answer is: because I like understanding what actually happens inside a solver.&lt;/p&gt;

&lt;p&gt;A lot of engineering software gives you something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;solve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then you get displacements, stresses, eigenfrequencies, etc.&lt;/p&gt;

&lt;p&gt;That's obviously useful.&lt;/p&gt;

&lt;p&gt;But personally, I wanted something where it was easier to answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which formulation is actually being used?&lt;/li&gt;
&lt;li&gt;Which solver backend solved the system?&lt;/li&gt;
&lt;li&gt;What tolerance was used?&lt;/li&gt;
&lt;li&gt;What was the final residual?&lt;/li&gt;
&lt;li&gt;Was equilibrium checked?&lt;/li&gt;
&lt;li&gt;Can I reproduce the same result?&lt;/li&gt;
&lt;li&gt;Which parts of the solver are actually validated?&lt;/li&gt;
&lt;li&gt;Which parts are still experimental?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is basically the philosophy behind QF Solver.&lt;/p&gt;

&lt;p&gt;I'm trying to keep the numerical methods relatively visible instead of hiding everything behind a black box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;QF Solver is available on PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;qf-solver
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/emptiesvoid-cloud/QF_solver" rel="noopener noreferrer"&gt;https://github.com/emptiesvoid-cloud/QF_solver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Documentation:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PyPI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/qf-solver/" rel="noopener noreferrer"&gt;https://pypi.org/project/qf-solver/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Where the project currently stands
&lt;/h2&gt;

&lt;p&gt;The current version is &lt;strong&gt;QF Solver 0.2.7&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;At the moment, the solver covers several areas of structural finite-element analysis, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;linear static analysis;&lt;/li&gt;
&lt;li&gt;TET4, TET10, HEX8 and HEX20 solid elements;&lt;/li&gt;
&lt;li&gt;small-strain J2 plasticity for selected elements;&lt;/li&gt;
&lt;li&gt;modal analysis;&lt;/li&gt;
&lt;li&gt;Newmark time integration;&lt;/li&gt;
&lt;li&gt;harmonic analysis;&lt;/li&gt;
&lt;li&gt;linear buckling;&lt;/li&gt;
&lt;li&gt;selected frictionless contact capabilities;&lt;/li&gt;
&lt;li&gt;experimental WEDGE6 support;&lt;/li&gt;
&lt;li&gt;PETSc/MPI routes for selected large models.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One thing I'm trying to be careful about is not treating every implemented feature as equally mature.&lt;/p&gt;

&lt;p&gt;Some routes are much better tested than others.&lt;/p&gt;

&lt;p&gt;Some are intentionally labelled as experimental or supported with limitations.&lt;/p&gt;

&lt;p&gt;I'd rather write:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this works within this tested scope&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;than:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;this solver supports everything&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;when that isn't actually true.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification is probably the part I care about the most
&lt;/h2&gt;

&lt;p&gt;Writing an FEM element is one thing.&lt;/p&gt;

&lt;p&gt;Trusting it is another.&lt;/p&gt;

&lt;p&gt;So a fairly large part of the project is now dedicated to verification and validation.&lt;/p&gt;

&lt;p&gt;I try to keep records of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;numerical residuals;&lt;/li&gt;
&lt;li&gt;equilibrium errors;&lt;/li&gt;
&lt;li&gt;energy checks;&lt;/li&gt;
&lt;li&gt;deterministic replays;&lt;/li&gt;
&lt;li&gt;reference cases;&lt;/li&gt;
&lt;li&gt;solver configuration;&lt;/li&gt;
&lt;li&gt;execution environment;&lt;/li&gt;
&lt;li&gt;limitations;&lt;/li&gt;
&lt;li&gt;resource failures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are also machine-readable qualification records in the repository.&lt;/p&gt;

&lt;p&gt;It probably looks a little excessive for a personal open-source project, but I actually enjoy this part.&lt;/p&gt;

&lt;p&gt;And in my opinion, numerical software becomes much more interesting once you can start answering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why should I trust this result?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;instead of only:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Did the code run?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Trying larger model
&lt;/h2&gt;

&lt;p&gt;Another area I've been experimenting with is larger finite-element systems using &lt;strong&gt;PETSc and MPI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Again, I want to be careful with the wording here.&lt;/p&gt;

&lt;p&gt;These are not claims that QF Solver can magicallie solve every multi-million-DOF FEM problem.&lt;/p&gt;

&lt;p&gt;They are recorded results for specific structured TET4 linear-static workloads, using specific solver configurations.&lt;/p&gt;

&lt;p&gt;The current public evidence includes approximately:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model size&lt;/th&gt;
&lt;th&gt;Recorded result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1,029,000 DOF&lt;/td&gt;
&lt;td&gt;Two stable PETSc replays&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3,000,000 DOF&lt;/td&gt;
&lt;td&gt;Two Silver replays plus bounded Gold Compute evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5,012,640 DOF&lt;/td&gt;
&lt;td&gt;Two Silver replays&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;10M scale&lt;/td&gt;
&lt;td&gt;Bounded evidence only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The 10M case especially should not be interpreted as:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;QF Solver fully supports arbitrary 10-million-DOF models.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's not what I'm claiming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 5 million DOF case
&lt;/h2&gt;

&lt;p&gt;The largest result I currently feel comfortable describing in more detail is the &lt;strong&gt;5M Silver workload&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I don't know why, but I really like the terms "Silver" and "Gold" 😅 I guess I'll probably replace them with better metrics in the future.&lt;/p&gt;

&lt;p&gt;The recorded model contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;5,012,640 degrees of freedom&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;9,773,946 TET4 elements&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1,243 solver iterations&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;free residual around &lt;code&gt;9.85e-11&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;equilibrium error around &lt;code&gt;1.39e-9&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;energy error below &lt;code&gt;2e-14&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two recorded runs took approximately:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;4,428 seconds&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;4,379 seconds&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This was a PETSc/MPI workload under a recorded environment and solver configuration.&lt;/p&gt;

&lt;p&gt;I really want to emphasize this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;these numbers are not a universal QF Solver performance benchmark.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Change the mesh topology, element type, conditioning, preconditioner, hardware, material model or solver configuration and the behaviour can change completely.&lt;/p&gt;

&lt;p&gt;For now, I'm mostly using these cases to answer a simpler question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Can I reproduce a stable solution of this particular problem at this scale?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  I also keep the failures
&lt;/h2&gt;

&lt;p&gt;One thing I've tried not to do is quietly delete results that are inconvenient.&lt;/p&gt;

&lt;p&gt;For example, an earlier matrix-free campaign successfully solved structured models up to roughly &lt;strong&gt;750k DOF&lt;/strong&gt;, while an attempt around 1M DOF reached its resource/time limit.&lt;/p&gt;

&lt;p&gt;Later PETSc work managed to go significantly further.&lt;/p&gt;

&lt;p&gt;But that doesn't mean the older 1M experiment suddenly becomes a successful result.&lt;/p&gt;

&lt;p&gt;It stays recorded as a limited attempt.&lt;/p&gt;

&lt;p&gt;Maybe this sounds obvious, but I think it matters.&lt;/p&gt;

&lt;p&gt;Especially in performance work, it's very easy to only keep the nice numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is QF Solver better than SfePy, scikit-fem, CalculiX or Code_Aster?
&lt;/h2&gt;

&lt;p&gt;I don't think that's really the right question.&lt;/p&gt;

&lt;p&gt;They are different tools.&lt;/p&gt;

&lt;p&gt;SfePy and scikit-fem have their own philosophies and ecosystems.&lt;/p&gt;

&lt;p&gt;CalculiX and Code_Aster are much more mature projects with years of development behind them.&lt;/p&gt;

&lt;p&gt;QF Solver is much younger.&lt;/p&gt;

&lt;p&gt;What I'm currently trying to build is something that is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;easy to inspect;&lt;/li&gt;
&lt;li&gt;Python-friendly;&lt;/li&gt;
&lt;li&gt;useful for experimenting with FEM methods;&lt;/li&gt;
&lt;li&gt;explicit about numerical limitations;&lt;/li&gt;
&lt;li&gt;backed by reproducible verification records.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've started writing some comparison pages here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/comparisons/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/comparisons/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The goal isn't to write:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;QF Solver wins.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's more:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you have this type of problem, which tool makes the most sense?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  The benchmark and reproducibility page
&lt;/h2&gt;

&lt;p&gt;I recently created a more readable public summary of the current performance and verification evidence:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/benchmarks/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/benchmarks/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The much more detailed verification records are also available directly in the repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/emptiesvoid-cloud/QF_solver/tree/main/docs/verification/0_2_7" rel="noopener noreferrer"&gt;https://github.com/emptiesvoid-cloud/QF_solver/tree/main/docs/verification/0_2_7&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the machine-readable qualification data is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/emptiesvoid-cloud/QF_solver/tree/main/qualification/0_2_7" rel="noopener noreferrer"&gt;https://github.com/emptiesvoid-cloud/QF_solver/tree/main/qualification/0_2_7&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;I'm now starting to think about &lt;strong&gt;QF Solver 0.2.8&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There is still a lot I want to improve.&lt;/p&gt;

&lt;p&gt;Some capabilities need to become more mature.&lt;/p&gt;

&lt;p&gt;Some solver routes need better performance.&lt;/p&gt;

&lt;p&gt;Some parts of the API still need cleanup.&lt;/p&gt;

&lt;p&gt;And there are definitely still things in the codebase that I will probably look at in six months and wonder why I wrote them that way.&lt;/p&gt;

&lt;p&gt;That's part of the process.&lt;/p&gt;

&lt;p&gt;For now, I'm mostly trying to build each release on top of the previous one without pretending the project is more mature than it actually is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why am I posting this now?
&lt;/h2&gt;

&lt;p&gt;Mostly because I've been working on the project for a while without really talking about it publicly.&lt;/p&gt;

&lt;p&gt;I figured it was probably time to stop keeping everything inside the repository.&lt;/p&gt;

&lt;p&gt;I'm interested in FEM, numerical methods, solver architecture and scientific computing, so if anyone working in those areas happens to look at the project, feedback is welcome.&lt;/p&gt;

&lt;p&gt;And yes, if you open the code and immediately find something questionable... be little kind 😄&lt;/p&gt;

&lt;p&gt;It's still a work in progress.&lt;/p&gt;

&lt;p&gt;But constructive criticism is exactly the kind of thing that can make the solver better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/emptiesvoid-cloud/QF_solver" rel="noopener noreferrer"&gt;https://github.com/emptiesvoid-cloud/QF_solver&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benchmarks and reproducibility&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/benchmarks/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/benchmarks/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;FEM solver comparisons&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://emptiesvoid-cloud.github.io/QF_solver/comparisons/" rel="noopener noreferrer"&gt;https://emptiesvoid-cloud.github.io/QF_solver/comparisons/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PyPI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pypi.org/project/qf-solver/" rel="noopener noreferrer"&gt;https://pypi.org/project/qf-solver/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;I'll probably write another update once QF Solver 0.2.8 is in a state worth showing.&lt;/p&gt;

&lt;p&gt;Small AI disclosure: I used AI to help me with the English and wording of this article because English isn't my strongest language. The project, technical work, results, and ideas are my own.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>science</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
