{"id":16440212,"url":"https://github.com/soypat/go-fem","last_synced_at":"2026-06-11T18:31:20.981Z","repository":{"id":37074540,"uuid":"502533736","full_name":"soypat/go-fem","owner":"soypat","description":"Go packages for finite element analysis/methods.","archived":false,"fork":false,"pushed_at":"2023-07-09T19:28:01.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-25T23:44:45.469Z","etag":null,"topics":["fem","finite-element-analysis","finite-element-methods","go","golang","matrix-assembly","rigidity-matrix","stiffness-matrix","stiffness-matrix-assembly"],"latest_commit_sha":null,"homepage":"","language":"Go","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/soypat.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}},"created_at":"2022-06-12T06:08:21.000Z","updated_at":"2023-08-11T20:45:16.000Z","dependencies_parsed_at":"2024-06-21T19:04:44.420Z","dependency_job_id":"e3ca79d2-e3b1-4e0b-b626-310834940e82","html_url":"https://github.com/soypat/go-fem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/soypat/go-fem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Fgo-fem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Fgo-fem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Fgo-fem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Fgo-fem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soypat","download_url":"https://codeload.github.com/soypat/go-fem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soypat%2Fgo-fem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34213180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fem","finite-element-analysis","finite-element-methods","go","golang","matrix-assembly","rigidity-matrix","stiffness-matrix","stiffness-matrix-assembly"],"created_at":"2024-10-11T09:11:29.961Z","updated_at":"2026-06-11T18:31:20.959Z","avatar_url":"https://github.com/soypat.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fem\nExtremely clean API toolkit for finite element analysis/methods.\n\n#### Roadmap\n* ~~3D Isoparametric element assembly.~~\n* ~~Better sparse assembler~~ As fast as high performance libraries.\n* ~~2D Isoparametric element assembly.~~\n* ~~Arbitrary Isoparametric element assembly.~~\n* Stress extraction from displacements.\n* Shell and plate element assembly.\n* Better define Element3 API.\n* Add constraints assembly.\n  - Lagrange Multipliers or Penalty method.\n* Stiffness matrix utility functions for better conditioning and troubleshooting.\n\n\n\n#### Axisymmetric assembly example\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/soypat/go-fem\"\n\t\"github.com/soypat/go-fem/constitution/solids\"\n\t\"github.com/soypat/go-fem/elements\"\n\t\"github.com/soypat/lap\"\n\t\"gonum.org/v1/gonum/spatial/r3\"\n)\n\nfunc main() {\n\t// We assemble a single 2D axisymmetric element.\n\t// With a young modulus of 1000 and a poisson ratio of 0.33.\n\t// The units are undefined. If using SI, E would be 1kPa and node positions\n\t// would be in meters.\n\tmaterial := solids.Isotropic{E: 1000, Poisson: 0.33}\n\tnodes := []r3.Vec{\n\t\t{X: 20, Y: 0},\n\t\t{X: 30, Y: 0},\n\t\t{X: 30, Y: 1},\n\t\t{X: 20, Y: 1},\n\t}\n\telems := [][4]int{\n\t\t{0, 1, 2, 3},\n\t}\n\telemType := elements.Quad4{}\n\n\tga := fem.NewGeneralAssembler(nodes, elemType.Dofs())\n\terr := ga.AddIsoparametric(elemType, material.Axisymmetric(), 1, func(i int) (elem []int, xC, yC r3.Vec) {\n\t\treturn elems[i][:], r3.Vec{}, r3.Vec{}\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Printf(\"K=\\n%.3g\\n\", lap.Formatted(ga.Ksolid()))\n}\n```\n\n**Output:**\n```\nK=\n⎡ 2.93e+04   5.23e+03   1.45e+04   2.06e+03  -1.63e+04  -6.45e+03  -2.77e+04       -848⎤\n⎢ 5.23e+03   1.11e+05  -2.36e+03   6.14e+04  -7.37e+03  -6.19e+04        848  -1.11e+05⎥\n⎢ 1.45e+04  -2.36e+03    3.6e+04  -8.59e+03  -3.37e+04   3.58e+03  -1.63e+04   7.37e+03⎥\n⎢ 2.06e+03   6.14e+04  -8.59e+03   1.36e+05  -3.58e+03  -1.36e+05   6.45e+03  -6.19e+04⎥\n⎢-1.63e+04  -7.37e+03  -3.37e+04  -3.58e+03    3.6e+04   8.59e+03   1.45e+04   2.36e+03⎥\n⎢-6.45e+03  -6.19e+04   3.58e+03  -1.36e+05   8.59e+03   1.36e+05  -2.06e+03   6.14e+04⎥\n⎢-2.77e+04        848  -1.63e+04   6.45e+03   1.45e+04  -2.06e+03   2.93e+04  -5.23e+03⎥\n⎣     -848  -1.11e+05   7.37e+03  -6.19e+04   2.36e+03   6.14e+04  -5.23e+03   1.11e+05⎦\n```\n\n#### Benchmarks\nTakes ~33s to assemble 680k dofs for 1.3 million 4 node 3D tetrahedrons on a low end AMD Zen2 CPU:\n```\n$ go test -bench=. -benchmem .\ngoos: linux\ngoarch: amd64\npkg: github.com/soypat/go-fem\ncpu: AMD Ryzen 5 3400G with Radeon Vega Graphics    \nBenchmarkTetra4Assembly/105_dofs,_48_elems-8                1218            932708 ns/op          155646 B/op        744 allocs/op\nBenchmarkTetra4Assembly/3723_dofs,_5376_elems-8               10         109067373 ns/op        10928022 B/op      74500 allocs/op\nBenchmarkTetra4Assembly/27027_dofs,_46080_elems-8              1        1023632489 ns/op        88685256 B/op     634443 allocs/op\nBenchmarkTetra4Assembly/206115_dofs,_380928_elems-8            1        8849933029 ns/op        717490648 B/op   5229747 allocs/op\nBenchmarkTetra4Assembly/684723_dofs,_1299456_elems-8           1        32997698741 ns/op       2742313160 B/op 17888792 allocs/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoypat%2Fgo-fem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoypat%2Fgo-fem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoypat%2Fgo-fem/lists"}