{"id":22059726,"url":"https://github.com/precise-simulation/fea-solver-benchmark","last_synced_at":"2025-05-12T19:52:50.946Z","repository":{"id":201688142,"uuid":"497519068","full_name":"precise-simulation/fea-solver-benchmark","owner":"precise-simulation","description":"Fortan, Julia, Octave, and MATLAB FEA Solver Benchmark and Comparison","archived":false,"fork":false,"pushed_at":"2022-05-29T07:25:34.000Z","size":1052,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T02:52:50.419Z","etag":null,"topics":["benchmark","fea","finite-element-methods","fortran","julia","matlab","octave","solver"],"latest_commit_sha":null,"homepage":"https://www.featool.com/fortran-julia-and-matlab-fem-benchmark-comparison","language":"Julia","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/precise-simulation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-05-29T07:22:38.000Z","updated_at":"2025-03-19T09:23:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"be3f92d6-cc1e-4d66-970f-f404ce65f583","html_url":"https://github.com/precise-simulation/fea-solver-benchmark","commit_stats":null,"previous_names":["precise-simulation/fea-solver-benchmark"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precise-simulation%2Ffea-solver-benchmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precise-simulation%2Ffea-solver-benchmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precise-simulation%2Ffea-solver-benchmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/precise-simulation%2Ffea-solver-benchmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/precise-simulation","download_url":"https://codeload.github.com/precise-simulation/fea-solver-benchmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253812192,"owners_count":21968240,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","fea","finite-element-methods","fortran","julia","matlab","octave","solver"],"created_at":"2024-11-30T17:31:52.584Z","updated_at":"2025-05-12T19:52:50.924Z","avatar_url":"https://github.com/precise-simulation.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fortan, Julia, Octave, and Matlab FEM Benchmark and Comparison\r\n==============================================================\r\n\r\nBenchmark and comparison of Fortran, Julia, Octave, and Matlab for a\r\nFEA Poisson problem solved on a unit square. The problem is\r\ndiscretized with Q1 bilinear Lagrange finite elements.\r\n\r\nThe Fortran code is using a reference FEM implementation from which\r\nthe Julia code is a direct port. The Octave and Matlab code is derived\r\nfrom the [FEATool](https://www.featool.com)\r\n[Multiphysics](https://www.featool.com/multiphysics) production\r\ncode. The problem setup is identical and the codes are equivalent and\r\nnot tuned to perform better in the benchmark, as they still feature\r\nall relevant code paths to allow different finite element shape\r\nfunctions, variable coefficients, unstructured grids, etc. Thus the\r\nresults are relevant and comparable. The main difference is that\r\nOctave, Matlab, and Julia use the default sparse linear solver\r\n(currently the Umfpack direct solver), while the Fortran code uses a\r\nmore efficient iterative geometric multigrid solver.\r\n\r\nThe results of this benchmark are presented on the FEATool blog:\r\n[https://www.featool.com/fortran-julia-and-matlab-fem-benchmark-comparison](https://www.featool.com/fem/2016/10/13/fortran-julia-and-matlab-fem-benchmark-comparison)\r\n\r\nInstallation and Running\r\n------------------------\r\n\r\n- Download and unzip or clone the repository.\r\n\r\n- Set up and install [Octave](https://www.gnu.org/software/octave),\r\n  Matlab [Julia](http://julialang.org), and a Fortran compiler\r\n  (tested with gfortran and the Intel Fortran compiler).\r\n\r\n- [Download and install the FEATool toolbox](https://www.featool.com/download)\r\n\r\n- Edit the [testrun_param.txt](https://github.com/precise-simulation/fea-solver-benchmark/blob/master/testrun_param.txt#L1)\r\n  file, which contains three parameters\r\n\r\n        N0    - the grid resolution of the coarsest test grid (grid level)\r\n                (the number of cells in x and y-directions)\r\n        NLEV  - The number of grid levels to run tests for\r\n        NRUNS - Number of test runs for each grid level,\r\n                the timings are averaged for all runs\r\n\r\n- On Windows edit the _OCTAVE_, _MATLAB_, and _JULIA_ paths in the\r\n  [run_tests.bat](https://github.com/precise-simulation/fea-solver-benchmark/blob/master/run_tests.bat#L6)\r\n  script and execute the script to automatically run the benchmarks\r\n  and generate the output files. (Note that to run the Fortran code\r\n  under Windows the _Windows Subsystem for Linux (WSL)_ is required)\r\n\r\n- On other systems the **run_matlab.m**, **run_julia.jl**, and\r\n  **run_fortran.sh** shell scripts can be run manually.\r\n\r\n- The Octave/Matlab postprocessing script\r\n  **src_matlab/process_results.m** file can be run manually\r\n  to generate the results and output files.\r\n\r\n- The [NNWORK](https://github.com/precise-simulation/fea-solver-benchmark/blob/master/src_fortran/src/featfem.f#L9)\r\n  parameter in the main Fortran source file\r\n  *src_fortran/src/featfem.f* controls the static memory allocation\r\n  and might have to be increased and recompiled to run \u003e 4 GB runs.\r\n\r\n\r\nResults and Output\r\n------------------\r\n\r\nAfter running the tests the _output_ directory will contain results\r\nfiles, _table.txt_ with tabulated times, and\r\n[_results.html_](http://htmlpreview.github.io/?https://github.com/precise-simulation/fea-solver-benchmark/blob/master/output/results.html)\r\nwhich shows the comparison graphs. Sample output is shown here below\r\n\r\n![Assembly Timings](https://github.com/precise-simulation/fea-solver-benchmark/blob/main/output/fig_assembly.jpg)\r\n\r\n![Solver Timings](https://github.com/precise-simulation/fea-solver-benchmark/blob/main/output/fig_solve.jpg)\r\n\r\n![Total Timings](https://github.com/precise-simulation/fea-solver-benchmark/blob/main/output/fig_total.jpg)\r\n\r\nData for the complete results for all testruns are tabulated below\r\n\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |  Octave |           |           |           |           |           |           |           |           |           |\r\n    |     1/h |    t_grid |     t_ptr |   t_asm_A |   t_asm_f |     t_bdr |  t_sparse |     t_tot |    t_spmv |   t_solve |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |      32 | 2.37e-003 | 1.50e-003 | 1.77e-002 | 1.07e-002 | 1.06e-003 | 4.16e-004 | 3.37e-002 | 4.62e-005 | 5.78e-003 |\r\n    |      64 | 2.76e-003 | 1.95e-003 | 1.99e-002 | 1.15e-002 | 2.76e-003 | 1.84e-003 | 4.07e-002 | 1.55e-004 | 2.28e-002 |\r\n    |     128 | 6.28e-003 | 5.33e-003 | 4.39e-002 | 2.27e-002 | 1.13e-002 | 9.03e-003 | 9.86e-002 | 6.29e-004 | 1.04e-001 |\r\n    |     256 | 1.74e-002 | 2.43e-002 | 1.28e-001 | 7.38e-002 | 4.25e-002 | 3.30e-002 | 3.19e-001 | 2.38e-003 | 5.10e-001 |\r\n    |     512 | 7.38e-002 | 8.25e-002 | 4.92e-001 | 2.73e-001 | 1.57e-001 | 1.35e-001 | 1.21e+000 | 1.07e-002 | 2.66e+000 |\r\n    |    1024 | 2.87e-001 | 3.28e-001 | 1.88e+000 | 1.07e+000 | 6.69e-001 | 5.33e-001 | 4.77e+000 | 4.33e-002 | 1.75e+001 |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |  Matlab |           |           |           |           |           |           |           |           |           |\r\n    |     1/h |    t_grid |     t_ptr |   t_asm_A |   t_asm_f |     t_bdr |  t_sparse |     t_tot |    t_spmv |   t_solve |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |      32 | 1.74e-003 | 1.26e-003 | 2.50e-003 | 1.88e-003 | 2.22e-003 | 2.05e-003 | 1.16e-002 | 1.18e-005 | 4.05e-003 |\r\n    |      64 | 7.09e-004 | 9.97e-004 | 6.51e-003 | 3.00e-003 | 6.13e-003 | 9.71e-003 | 2.71e-002 | 4.62e-005 | 2.17e-002 |\r\n    |     128 | 1.58e-003 | 6.25e-003 | 1.58e-002 | 8.54e-003 | 2.28e-002 | 4.07e-002 | 9.57e-002 | 1.84e-004 | 9.43e-002 |\r\n    |     256 | 5.06e-003 | 2.44e-002 | 5.49e-002 | 4.11e-002 | 9.02e-002 | 1.47e-001 | 3.63e-001 | 8.68e-004 | 4.48e-001 |\r\n    |     512 | 3.06e-002 | 9.75e-002 | 2.05e-001 | 1.57e-001 | 3.74e-001 | 6.11e-001 | 1.47e+000 | 4.90e-003 | 2.54e+000 |\r\n    |    1024 | 1.23e-001 | 3.86e-001 | 8.13e-001 | 6.32e-001 | 1.51e+000 | 2.51e+000 | 5.97e+000 | 1.99e-002 | 1.48e+001 |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |   Julia |           |           |           |           |           |           |           |           |           |\r\n    |     1/h |    t_grid |     t_ptr |   t_asm_A |   t_asm_f |     t_bdr |  t_sparse |     t_tot |    t_spmv |   t_solve |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |      32 | 1.11e-004 | 3.77e-004 | 8.97e-004 | 2.61e-004 | 6.76e-005 | 2.30e-004 | 1.94e-003 | 2.15e-005 | 6.00e-003 |\r\n    |      64 | 2.22e-004 | 1.67e-003 | 3.58e-003 | 1.00e-003 | 9.88e-005 | 1.20e-003 | 7.78e-003 | 8.86e-005 | 2.80e-002 |\r\n    |     128 | 5.66e-004 | 6.76e-003 | 1.45e-002 | 3.92e-003 | 1.41e-004 | 5.96e-003 | 3.19e-002 | 3.65e-004 | 1.20e-001 |\r\n    |     256 | 3.20e-003 | 2.71e-002 | 5.79e-002 | 1.58e-002 | 2.48e-004 | 2.39e-002 | 1.28e-001 | 1.55e-003 | 5.12e-001 |\r\n    |     512 | 1.30e-002 | 1.10e-001 | 2.35e-001 | 6.66e-002 | 4.11e-004 | 1.77e-001 | 6.02e-001 | 7.77e-003 | 2.58e+000 |\r\n    |    1024 | 5.35e-002 | 4.60e-001 | 9.57e-001 | 2.76e-001 | 2.22e-003 | 6.20e-001 | 2.37e+000 | 3.12e-002 | 1.34e+001 |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    | Fortran |           |           |           |           |           |           |           |           |           |\r\n    |     1/h |    t_grid |     t_ptr |   t_asm_A |   t_asm_f |     t_bdr |  t_sparse |     t_tot |    t_spmv |   t_solve |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n    |      32 | 0.00e+000 | 8.68e-004 | 8.68e-004 | 0.00e+000 | 0.00e+000 | 0.00e+000 | 1.74e-003 | 2.60e-005 | 4.34e-003 |\r\n    |      64 | 0.00e+000 | 8.68e-004 | 7.81e-003 | 2.60e-003 | 8.68e-004 | 0.00e+000 | 1.22e-002 | 9.55e-005 | 8.68e-004 |\r\n    |     128 | 4.34e-003 | 4.34e-003 | 1.82e-002 | 1.74e-003 | 0.00e+000 | 0.00e+000 | 2.86e-002 | 2.95e-004 | 1.13e-002 |\r\n    |     256 | 3.47e-003 | 1.91e-002 | 6.94e-002 | 1.13e-002 | 1.74e-003 | 0.00e+000 | 1.05e-001 | 1.12e-003 | 4.08e-002 |\r\n    |     512 | 3.30e-002 | 9.20e-002 | 2.26e-001 | 4.17e-002 | 1.74e-003 | 0.00e+000 | 3.94e-001 | 4.93e-003 | 1.77e-001 |\r\n    |    1024 | 1.35e-001 | 3.86e-001 | 9.05e-001 | 1.67e-001 | 8.68e-004 | 0.00e+000 | 1.59e+000 | 2.35e-002 | 7.65e-001 |\r\n    |---------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------+-----------|\r\n\r\n\r\n\r\nLicense\r\n-------\r\n\r\nCopyright (C) 2013-2022 Precise Simulation Ltd.\r\n\r\nKeywords: Finite Element, FEA, FEM, Fortran,\r\nJulia, Octave, Matlab, Benchmark\r\n\r\nThis program is free software; you can redistribute it and/or modify\r\nit under the terms of version 3 of the GNU Affero General Public\r\nLicense (AGPLv3) as published by the Free Software Foundation.\r\n\r\nThis program is distributed in the hope that it will be useful, but\r\nWITHOUT ANY WARRANTY; without even the implied warranty of\r\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r\nGeneral Public License for more details.\r\n\r\nYou should have received a copy of the GNU Affero General Public\r\nLicense along with this program. If not, see\r\n[http://www.gnu.org/licenses](http://www.gnu.org/licenses).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecise-simulation%2Ffea-solver-benchmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprecise-simulation%2Ffea-solver-benchmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprecise-simulation%2Ffea-solver-benchmark/lists"}