Repository navigation
Why the engineering solvers are original code
ThreeMojo has solvers that follow well known engineering programs. The EPANET and MODFLOW solvers are translations of their source, because their licenses allow it. Each other solver is new code that implements a published method. This page says which program each solver follows, how far it goes, and why the code is original or a translation.
| Program | What it does | ThreeMojo module | Page |
|---|---|---|---|
| OpenSees | Newmark time history with Rayleigh damping and ground motion | extensions/structure/dynamic.mojo |
Frame analysis |
| OpenSees | Geometric stiffness and P-Delta | extensions/structure/buckling.mojo |
Frame analysis |
| OpenSees | Uniaxial steel, truss elements, Newton iteration, load control and displacement control | extensions/structure/nonlinear.mojo |
Frame analysis |
| OpenSees | Corotational truss | extensions/structure/nonlinear.mojo |
Frame analysis |
| OpenSees | Nonlinear time history | extensions/structure/transient.mojo |
Frame analysis |
| OpenSees | Fiber sections with Concrete01 and Steel01 | extensions/structure/section.mojo |
Frame analysis |
| OpenSees | Response spectrum analysis | extensions/structure/spectrum.mojo |
Frame analysis |
| CalculiX | Input decks of C3D4 and C3D10 elements |
extensions/fem/deck.mojo |
Tetrahedral FEM |
| CalculiX | The *BUCKLE procedure, for frames |
extensions/structure/buckling.mojo |
Frame analysis |
| OpenFOAM | icoFoam: laminar incompressible flow by PISO | extensions/cfd/flow.mojo |
Finite-volume flow |
| OpenFOAM | buoyantBoussinesqPimpleFoam: heat and buoyancy | extensions/cfd/heat.mojo |
Finite-volume flow |
| EPANET | The engine of EPANET 2.3.6: input files, hydraulics over time and water quality. This is a translation. | extensions/epanet/ |
Pipe networks |
| HEC-RAS | Steady profiles by the standard step method | extensions/hydraulics/channel.mojo |
Open channels |
| MODFLOW | The groundwater flow model and the IMS solver of MODFLOW 6: input files, steady and transient flow, and the Newton formulation. This is a translation. | extensions/groundwater/ |
Groundwater flow |
The project already had the base of these solvers. Tetrahedral FEM has static, modal and thermal analysis of solids. Frame analysis and Shell analysis have linear frames and shells. Numerics has the sparse matrices and the factorizations.
A translation of source code is a derived work. It keeps the license of its source.
| Program | License | What it means here |
|---|---|---|
| OpenFOAM | GNU GPL, version 3 | A translation must have the GPL. |
| CalculiX | GNU GPL, version 2 or later | A translation must have the GPL. |
| OpenSees | A license of the Regents of the University of California | Read its terms before any use of its source. |
| EPANET | Public domain for version 2.0, and the MIT license from version 2.2 | A translation is allowed. extensions/epanet/ translates version 2.3.6 and keeps its notice. |
| HEC-RAS | Free software of the US Army Corps of Engineers | Its source is not published. Its manuals give its methods. |
| MODFLOW | Public domain, from the US Geological Survey, and CC0 1.0 worldwide | A translation is allowed. extensions/groundwater/ translates MODFLOW 6 and keeps its notice. Libraries that it bundles under the LGPL are not translated. |
ThreeMojo has the PolyForm Noncommercial license, with a commercial license beside it. Code under the GPL cannot have those terms. So a translation of OpenFOAM or of CalculiX cannot be part of this project.
A method is not source code. An algorithm in a paper or a textbook is free to implement. Each solver here, except EPANET and MODFLOW, implements a method from its first publication or from a textbook. Each module names that reference in its docstring. The names of some options follow the program, because users know them: average_acceleration, *CLOAD, PISO.
EPANET and MODFLOW are the exceptions. The MIT license of EPANET allows a translation into a project with other terms, if the translation keeps the notice. MODFLOW 6 is in the public domain. A translation gives the same numbers as the program, and a test can check each of them.
So extensions/epanet/ translates the C source of EPANET 2.3.6, and extensions/groundwater/ translates the Fortran source of MODFLOW 6. THIRD-PARTY-NOTICES.md has their notices. The other solvers stay original code.
A page that says that a solver follows a program makes three claims:
- The solver solves the same equations with the same method, within the limits that the page lists.
- The tests compare the solver with closed forms and with published benchmarks. Examples are the tables of Chopra, the cavity of Ghia, Ghia and Shin, the cavity of de Vahl Davis and the worked channel of Chow.
- The code shares no source with the program. This claim does not apply to EPANET and MODFLOW, which are translations.
The page does not claim these things:
- It does not claim the same numbers as the program in every case. Some tests compare a solver with the outputs of the real program, which a script in
assets/makes. Where a formula differs, the page says so. The Open channels page has a section on the differences. EPANET and MODFLOW are the exceptions. Their tests compare each translation with the real program. Pipe networks and Groundwater flow list them. - It does not claim the scope of the program. Each solver covers a small part. The Limits section of each page says what is missing.
- It does not claim engineering validity. A checked box in the README records implemented scope. A design needs the review of an engineer.
The scripts run each program on the models of the tests and store the results. The tests do not run the programs.
| Program | Script | Test | Result |
|---|---|---|---|
| EPANET 2.3.6 |
assets/epanet/make_epanet_cases.py and others |
tests/test_epanet_*.mojo |
The same doubles |
| MODFLOW 6 | assets/modflow/make_modflow_cases.py |
tests/test_modflow.mojo |
The same doubles |
| CalculiX 2.21 | assets/calculix/make_calculix_reference.py |
tests/test_fem_calculix.mojo |
The seven printed digits |
| OpenSees 3.8 | assets/opensees/make_opensees_reference.py |
tests/test_structure_opensees.mojo |
Ten digits for trusses, time histories and steel sections. 0.1% for concrete after the steel yields, because Concrete01 unloads along a line |
| OpenFOAM 2406 |
assets/cfd/make_cavity_reference.py and make_convection_reference.py
|
tests/test_cfd_flow.mojo and tests/test_cfd_heat.mojo
|
1% of the lid speed, and 0.2% of the temperature difference |
No test uses HEC-RAS, which has no steady-flow program for Linux. The frame elements of OpenSees have a consistent mass with no rotary inertia, so the modal and the spectrum tests use closed forms.
deck_text writes a StaticProblem as a CalculiX input deck. Run that deck in CalculiX to compare a result. The other solvers take the same physical inputs as their programs, so a small case can be entered in both by hand.
A difference that a comparison finds is a useful issue. Give the input of both programs and the two results.
- McKenna, Scott and Fenves, "Nonlinear finite-element analysis software architecture using object composition", Journal of Computing in Civil Engineering, 2010: OpenSees.
- Dhondt, "The Finite Element Method for Three-Dimensional Thermomechanical Applications", Wiley, 2004: CalculiX.
- Weller, Tabor, Jasak and Fureby, "A tensorial approach to computational continuum mechanics using object-oriented techniques", Computers in Physics, 1998: OpenFOAM.
- Rossman, "EPANET 2 Users Manual", EPA/600/R-00/057, US Environmental Protection Agency, 2000.
- Brunner, "HEC-RAS River Analysis System Hydraulic Reference Manual", US Army Corps of Engineers, 2016.
- McDonald and Harbaugh, "A modular three-dimensional finite-difference ground-water flow model", US Geological Survey, 1988: MODFLOW.
Tutorials
How-to
- Install
- Run the checks
- GPU backend
- Coverage
- Measure examples
- Add a feature
- Add a scanned building
- Write documentation
Reference
- Scene graph
- Rotations
- Cameras
- Geometry
- Geometry addons
- Lofts and clipping groups
- Sculptor
- Procedural generators
- Meshes and assets
- Lines
- Points and sprites
- Helpers
- Scene objects
- Animated objects
- Raycasting
- Curves and paths
- Animation
- Skinning
- Materials
- Node materials
- TSL functions
- Lights
- Lighting addons
- Fog
- Textures
- Renderer
- Renderer hooks and material flags
- Rasterization
- GPU backend
- Render target
- Post-processing
- GPU computation
- Compute nodes
- Progressive light map
- Gaussian splats
- Voxel global illumination
- SVG renderer
- Image files
- Image decode queue
- Model files
- More model files
- Exporters
- Scene JSON
- Windowing and controls
- C ABI and hosts
- Math
- Norm consumers
- Math addons
- Units
- Coverage tool
- Commands
- Examples
- Benchmarks
- Extensions
- Shared physics
- Physics query snapshots
- Continuous collision
- Tick force restoration
- Water
- Warp drives
- Vegetation
- Village
- Streamline
- Animals
-
Buildings
- Numerics
- Building topology
- Building model
- IFC exchange
- Procedural towers
- Floor plans and interiors
- Frame analysis
- Shell analysis
- Building energy
- Construction kits
- Bearing walls
- Scanned buildings
- SOG files
- Compressed PLY files
- Scan parts
- Cleaning and orienting scans
- Walking through a scan
- Virtual scans
- Castle
- CARLA
- Femur
- Tibia
- Fibula
- Patella
- Knee
- Muscles
- Vessels
- Lymph
- Nerves
- Integument
- Leg
- Foot
- Pelvis
- Torso
- Arm
- Hand
- Head
- Genome
- Game humanoid
- Humanoid fidelity
- Mixamo animations
- Audio-aligned game faces
- Converted assets
- Mesh quality
- Garments
- Outfits and armor
- Cloth and spring bones
- Attire estimates
- Segment inertia
- Process chemistry
- Thermochemical data
- Chemical equilibrium
- Process maps
- Rates and transport
- Electrolysis and film color
- Binary solutions
- Flowsheets and routes
- Materials and coatings
- Crystals and figures
- Diamond growth
- Medical imaging
- Molecular structures
- Tetrahedral FEM
- Finite-volume flow
- Pipe networks
- Open channels
- Groundwater flow
- Survival analysis
- Diagnostic tests
- Meta-analysis
- Epidemic models
- Sample size and power
- Group comparisons
- Observational studies
Explanation
- Software rasterizer
- Engineering solvers are original code
- Scene graph as an array
- Linear color
- Normals are not colors
- Perspective correction
- Fixed-point coverage
- Per-fragment shading
- Mipmaps
- Sorted transparency
- Types and checks
- Render hooks as a trait
- Shared CPU and GPU code
- Bands and threads
- PNG structure
- Extensions beside the port
- Process temperatures
- Scans as building models
- CUDA teardown hang
- Mojo compiler hang