{"id":32153945,"url":"https://github.com/minfem/minfem.jl","last_synced_at":"2026-02-18T22:01:36.752Z","repository":{"id":50885983,"uuid":"154392799","full_name":"MinFEM/MinFEM.jl","owner":"MinFEM","description":"A minimal finite element tool for demonstration and teaching.","archived":false,"fork":false,"pushed_at":"2025-10-20T15:10:16.000Z","size":8104,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T17:15:22.981Z","etag":null,"topics":["julia"],"latest_commit_sha":null,"homepage":"https://minfem.github.io/MinFEM.jl/","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MinFEM.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-10-23T20:30:47.000Z","updated_at":"2025-10-20T15:05:01.000Z","dependencies_parsed_at":"2022-09-24T22:32:49.173Z","dependency_job_id":"795643c8-ac6c-4c69-8c67-f1513bb46fe0","html_url":"https://github.com/MinFEM/MinFEM.jl","commit_stats":null,"previous_names":["msiebenborn/minfem.jl"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MinFEM/MinFEM.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinFEM%2FMinFEM.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinFEM%2FMinFEM.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinFEM%2FMinFEM.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinFEM%2FMinFEM.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinFEM","download_url":"https://codeload.github.com/MinFEM/MinFEM.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinFEM%2FMinFEM.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29596329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T20:59:56.587Z","status":"ssl_error","status_checked_at":"2026-02-18T20:58:41.434Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["julia"],"created_at":"2025-10-21T11:48:14.794Z","updated_at":"2026-02-18T22:01:36.747Z","avatar_url":"https://github.com/MinFEM.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ccenter\u003e\u003cimg src=\"https://user-images.githubusercontent.com/44394955/58797326-085dd580-8600-11e9-958c-b1698e1d370e.png\" alt=\"fem\" width=\"400\"/\u003e\u003c/center\u003e\n\n## A minimal finite element tool for demonstration and teaching.\n\n[![][license-badge]][license-url]\n[![][docs-badge]][docs-url]\n[![][test-badge]][test-url]\n[![][cov-badge]][cov-url]\n\n* The purpose of this package is to provide an easy and minimalistic introdcution to the finite element method.\n\n* We restrict ourselves to linear finite elements on tetrahedral grids in 1D, 2D and 3D.\n\n* This code imports meshes in GMSH v1, v2 and v4 format and outputs VTK format for Paraview.\n\nFirst we need to add the MinFEM package to our Julia installation.\nThus, open the julia REPL, hit the **]** key and type\n\n```\nadd MinFEM\ntest MinFEM\n```\n\nLets go through a code for the Poisson equation on a unit square with homogeneous Dirichlet boundary conditions.\n\nFirst we have to load the package MinFEM and WriteVTK. The latter is used to write the results in a format suitable for Paraview. We then generate a uniform, triangular 30x30 mesh for the unit square.\n\n```julia\nusing MinFEM\n\nmesh = unit_square(30)\n```\n\nAs an alternative: Download the package from github to obtain the examples and meshes and navigate, within the julia console, to the **examples** folder. Then import one of the mesh files generated with GMSH.\n\n```julia\nmesh = import_mesh(\"../meshes/square.msh\")\n```\n\nThe next step is to assemble the matrices which discretize the weak formulation:\n\n```julia\nL = assemble_laplacian(mesh)\nM = assemble_massmatrix(mesh)\n```\n\nWe now want to set s as an eigenfunction of the Laplacian multiplied with the corresponding eigenvalue:\n\n```julia\nn=3\nm=2\nf(x) = ((n*pi)^2 + (m*pi)^2) *sin(n*x[1]*pi)*sin(m*x[2]*pi)\ns = evaluate_mesh_function(mesh, f)\n```\n\nThe next step is to set up a PDESystem structure, which holds all necessary information for the PDE.\nThese are the stiffness matrix, the load vector, Dirichlet values and indices of the boundary nodes:\n\n\n```julia\nboundary = select_boundaries(mesh, 1001, 1002, 1003, 1004)\nboundaryNodes = extract_nodes(boundary)\n\npde = PDESystem(A=L, b=M*s, bc=zeros(mesh.nnodes), DI=boundaryNodes)\n```\n\nNote that the mesh is designed to have four physical boundaries identified by the indices 1001-1004.\n\nFinally, we solve the PDE and write the solution in a file for visualization with Paraview:\n\n\n```julia\nsolve!(pde)\n\nwrite_to_vtk([pde.state, s], mesh, [\"Y\",\"S\"], \"poisson\")\n```\n\n## Acknowledgment\nThe authors acknowledge the support by the Deutsche Forschungsgemeinschaft (DFG)\nwithin the Research Training Group GRK 2583\n\"Modeling, Simulation and Optimization of Fluid Dynamic Applications”.\n\n[license-url]: https://github.com/MinFEM/MinFEM.jl/blob/master/LICENSE\n[license-badge]: https://img.shields.io/badge/License-MIT-brightgreen.svg\n[docs-url]: https://minfem.github.io/MinFEM.jl/stable/\n[docs-badge]: https://img.shields.io/badge/docs-stable-blue.svg\n[test-url]: https://github.com/MinFEM/MinFEM.jl/actions/workflows/test.yml\n[test-badge]: https://github.com/MinFEM/MinFEM.jl/actions/workflows/test.yml/badge.svg\n[cov-url]: https://codecov.io/gh/MinFEM/MinFEM.jl\n[cov-badge]: https://codecov.io/gh/MinFEM/MinFEM.jl/branch/master/graph/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminfem%2Fminfem.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminfem%2Fminfem.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminfem%2Fminfem.jl/lists"}