Jukka Aho c90a028456 perf(benchmarks): Add field storage performance comparison script
Create 334-line benchmark validating Dict vs type-stable field performance claims
from zero_allocation_fields.md design document.

Benchmark structure:
- Lines 1-18: Header and expected results summary
- Lines 20-64: Field type definitions and mock element setup
  * AbstractField{T}, ConstantField{T}, NodalField{T}
  * Accessor functions: value(f::ConstantField), value(f::NodalField, node_ids)
  * Mock element with 8-node connectivity

Benchmark suite (5 tests):
1. Constant field access (lines 70-92): Dict["key"] vs value(field)
   Expected: ~50× faster, 0 allocations

2. Nodal field access (lines 97-120): Array slicing vs @view
   Expected: ~50× faster, 0 allocations

3. Interpolation without cache (lines 126-170): Type-unstable vs typed
   Expected: ~16× faster with fewer allocations

4. Interpolation with cache (lines 176-205): Zero-allocation target
   Uses InterpolationCache struct with pre-allocated result buffer
   Expected: 0 allocations, maximum speedup

5. Assembly loop (lines 211-261): 1000 elements, Dict vs NamedTuple
   Expected: 10-100× faster (hoisted constant access)

Validation section (lines 267-328):
- Compares actual results to claimed performance
- /⚠️ status for each benchmark
- 10× speedup threshold (conservative vs claimed ~50×)
- Zero allocation verification for cached operations

Key insights:
- Type stability eliminates runtime dispatch overhead
- @view and caches achieve zero allocations
- Hoisting invariant access provides massive speedup
- Validates NamedTuple + typed fields design for v1.0

Dependencies: BenchmarkTools, LinearAlgebra
Executable: #!/usr/bin/env julia (chmod +x ready)
2025-11-09 11:07:53 +02:00
2018-10-27 19:55:26 +03:00
2018-09-06 13:34:26 +03:00
2025-11-08 11:10:34 +02:00

JuliaFEM.jl - an open source solver for both industrial and academia usage

logo

DOI License Gitter Build Status Coverage Status Stable documentation Latest documentation Issues

The JuliaFEM project develops open-source software for reliable, scalable, distributed Finite Element Method.

The JuliaFEM software library is a framework that allows for the distributed processing of large Finite Element Models across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. The basic design principle is: everything is nonlinear. All physics models are nonlinear from which the linearization are made as a special cases.

At the moment, users can perform the following analyses with JuliaFEM: elasticity, thermal, eigenvalue, contact mechanics, and quasi-static solutions. Typical examples in industrial applications include non-linear solid mechanics, contact mechanics, finite strains, and fluid structure interaction problems. For visualization, JuliaFEM uses ParaView which prefers XDMF file format using XML to store light data and HDF to store large data-sets, which is more or less the open-source standard.

Vision

On one hand, the vision of the JuliaFEM includes the opportunity for massive parallelization using multiple computers with MPI and threading as well as cloud computing resources in Amazon, Azure and Google Cloud services together with a company internal server. And on the other hand, the real application complexity including the simulation model complexity as well as geometric complexity. Not to forget that the reuse of the existing material models as well as the whole simulation models are considered crucial features of the JuliaFEM package.

Recreating the wheel again is definitely not anybody's goal, and thus we try to use and embrace good practices and formats as much as possible. We have implemented Abaqus / CalculiX input-file format support and maybe will in the future extend to other FEM solver formats. Using modern development environments encourages the user towards fast development time and high productivity. For developing and creating new ideas and tutorials, we have used Jupyter notebooks to make easy-to-use handouts.

The user interface for JuliaFEM is Jupyter Notebook, and Julia language itself is a real programming language. This makes it possible to use JuliaFEM as a part of a bigger solution cycle, including for example data mining, automatic geometry modifications, mesh generation, solution, and post-processing and enabling efficient optimization loops.

Installing JuliaFEM

Inside Julia REPL, type:

Pkg.add("JuliaFEM")

Initial road map

JuliaFEM current status: project planning

Version Number of degree of freedom Number of cores
0.1.0 1 000 000 10
0.2.0 10 000 000 100
1.0.0 100 000 000 1 000
2.0.0 1 000 000 000 10 000
3.0.0 10 000 000 000 100 000

We strongly believe in the test driven development as well as building on top of previous work. Thus all the new code in this project should be 100% tested. Also other people have wisdom in style as well:

The Zen of Python:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Errors should never pass silently.

Citing

If you like using our package, please consider citing our article

@article{frondelius2017juliafem,
  title={Julia{FEM} - open source solver for both industrial and academia usage},
  volume={50}, 
  url={https://rakenteidenmekaniikka.journal.fi/article/view/64224},
  DOI={10.23998/rm.64224},
  number={3},
  journal={Rakenteiden Mekaniikka},
  author={Frondelius, Tero and Aho, Jukka},
  year={2017},
  pages={229-233}
}

Contributing

We welcome contributions! JuliaFEM encourages good practices, starting from unit testing and continuing to full integration testing across platforms.

Interested in contributing? Please read:

Key requirements:

  • Type-stable code (performance critical)
  • Tests included with all changes
  • Follow coding standards (use u, v, w not ξ, η, ζ)
  • Clean commit messages

Questions? Open a GitHub Discussion or issue - we're happy to help!

S
Description
Languages
Julia 98%
Python 1.7%
Shell 0.3%