{"id":31718394,"url":"https://github.com/jorgensd/dolfinx_mpc","last_synced_at":"2025-10-09T02:38:45.600Z","repository":{"id":41121156,"uuid":"253560803","full_name":"jorgensd/dolfinx_mpc","owner":"jorgensd","description":"Extension for dolfinx to handle multi-point constraints.","archived":false,"fork":false,"pushed_at":"2025-09-28T19:03:59.000Z","size":4311,"stargazers_count":44,"open_issues_count":14,"forks_count":19,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-28T20:35:08.516Z","etag":null,"topics":["fenicsx","finite-element-methods","multi-point-constraints"],"latest_commit_sha":null,"homepage":"https://jorgensd.github.io/dolfinx_mpc/","language":"Python","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/jorgensd.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","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":"2020-04-06T16:52:54.000Z","updated_at":"2025-09-28T19:04:02.000Z","dependencies_parsed_at":"2024-01-08T09:35:18.374Z","dependency_job_id":"731e8fa6-b18e-4bbd-b379-45b24c0e6ee5","html_url":"https://github.com/jorgensd/dolfinx_mpc","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/jorgensd/dolfinx_mpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgensd%2Fdolfinx_mpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgensd%2Fdolfinx_mpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgensd%2Fdolfinx_mpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgensd%2Fdolfinx_mpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jorgensd","download_url":"https://codeload.github.com/jorgensd/dolfinx_mpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jorgensd%2Fdolfinx_mpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000775,"owners_count":26082906,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"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":["fenicsx","finite-element-methods","multi-point-constraints"],"created_at":"2025-10-09T02:38:44.506Z","updated_at":"2025-10-09T02:38:45.594Z","avatar_url":"https://github.com/jorgensd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-point constraints with FEniCS-X\n[![Github Pages](https://github.com/jorgensd/dolfinx_mpc/actions/workflows/deploy-pages.yml/badge.svg?branch=main)](https://github.com/jorgensd/dolfinx_mpc/actions/workflows/deploy-pages.yml)\n[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-orange.svg)](https://sonarcloud.io/summary/new_code?id=jorgensd_dolfinx_mpc)\n\n[Code Coverage Report](https://jsdokken.com/dolfinx_mpc/code-coverage-report/index.html)\n\nAuthor: Jørgen S. Dokken\n\nThis library contains an add-on to FEniCSx enabling the possibilities\nof enforce multi-point constraints, such as \n\n$$u_i =\\sum_{j=0,i \\neq j}^n \\alpha_j u_j, i\\in I_N,$$\n\nwhere $I_N$ is the set of degrees of freedom to constrain.\n\nThis can be used to for instance enforce slip conditions strongly.\n\nConsider a linear system of the form \n$Au=b$, with the additional constraints written on the form ${K\\hat{u}=u}$, where $K$ is a prolongation matrix, $\\hat{u}$ is the vector of unknowns excluding the $I_N$ entries. \n\nWe then solve the system \n${K^T A K \\hat{u} = K^T b}$, where $K^T A K$ is symmetric if $A$ was symmetric.\nFor complex numbers, we use the Hermitian transpose and solve the system ${\\overline{K^T} A K \\hat{u} = \\overline{K^T} b}$, where $\\overline{K^T}$ is the complex conjugate of $K^T$, and $\\overline{K^T} A K$ is Hermitian if $A$ was Hermitian.\n\nIf we include boundary conditions on the form $u=g$, we \nassemble the system\n${K^TAK\\hat{u} = K^T(b-A\\hat{g})}$ where ${A\\hat{g}}$ is an extension of the boundary condition $g$ to all degrees of freedom.\n\nThe library performs custom matrix and vector assembly adding the extra constraints to the set of linear equations.\nAll assemblies are local to the process, and no MPI communication except when setting up the multi point constraints.\n\nThese assemblers are written in C++, but have a Python interface.\nThere are also pure Python-based assemblers in the optional {py:mod}`dolfinx_mpc.numba` module.\n\n# Documentation\nDocumentation at [https://jorgensd.github.io/dolfinx_mpc](https://jorgensd.github.io/dolfinx_mpc)\n\n# Installation\n\n## Spack\nDOLFINx MPC is on spack as both a [C++ package](https://packages.spack.io/package.html?name=dolfinx-mpc) (dolfinx-mpc) and a [Python package](https://packages.spack.io/package.html?name=py-dolfinx-mpc) (py-dolfinx-mpc).\nFirst, clone the spack repository and enable spack\n\n```bash\ngit clone --depth=2 https://github.com/spack/spack.git\n# For bash/zsh/sh\n. spack/share/spack/setup-env.sh\n\n# For tcsh/csh\nsource spack/share/spack/setup-env.csh\n\n# For fish\n. spack/share/spack/setup-env.fish\n```\n\nNext create an environment:\n\n```bash\nspack env create mpc_env\nspack env activate mpc_env\n```\nFind the compilers on the system\n```bash\nspack compiler find\n```\n\nand install the relevant package\n\n### C++\n```bash\nspack add dolfinx-mpc@v0.9.3 ^mpich ^petsc+mumps+hypre\nspack concretize\nspack install\n```\n\n### Python\n```bash\nspack add py-dolfinx-mpc@v0.9.3 ^mpich ^petsc+mumps+hypre ^py-fenics-dolfinx+petsc4py\nspack add py-scipy py-pytest py-gmsh\nspack concretize\nspack install\n```\n\nFinally, note that spack needs some packages already installed on your system. On a clean ubuntu container for example one need to install the following packages before running spack\n```bash\napt update \u0026\u0026 apt install gcc unzip git python3-dev g++ gfortran xz-utils libzip2 -y\n```\n\n## Conda\nThe DOLFINx MPC package is now on Conda.\nThe C++ library can be found under [libdolfinx_mpc](https://anaconda.org/conda-forge/libdolfinx_mpc) and the Python library under\n[dolfinx_mpc](https://anaconda.org/conda-forge/dolfinx_mpc). If you have any issues with these installations, add an issue at [dolfinx_mpc feedstock](https://github.com/conda-forge/dolfinx_mpc-feedstock).\n\n## Docker\n\nVersion 0.9.0 is available as an docker image at [Github Packages](https://github.com/jorgensd/dolfinx_mpc/pkgs/container/dolfinx_mpc)\nand can be ran using\n```bash\ndocker run -ti -v $(pwd):/root/shared -w /root/shared ghcr.io/jorgensd/dolfinx_mpc:v0.9.0\n```\nTo change to complex mode run `source dolfinx-complex-mode`.\nSimilarly, to change back to real mode, call `source dolfinx-real-mode`.\n\n## Source\n\nTo install the latest version (main branch), you need to install the latest release of [DOLFINx](https://github.com/FEniCS/dolfinx).\nEasiest way to install DOLFINx is to use docker. The DOLFINx docker images goes under the name [dolfinx/dolfinx](https://hub.docker.com/r/dolfinx/dolfinx).\nRemember to use an appropriate tag to get the correct version of DOLFINx, i.e. (`:nightly` or `:vx.y.z`).\n\nTo install the `dolfinx_mpc`-library run the following code from this directory:\n```bash\ncmake -G Ninja -DCMAKE_BUILD_TYPE=Release -B build-dir cpp/\nninja -j3 install -C build-dir\npython3 -m pip -v install --config-settings=cmake.build-type=\"Release\" --no-build-isolation ./python -U\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgensd%2Fdolfinx_mpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjorgensd%2Fdolfinx_mpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjorgensd%2Fdolfinx_mpc/lists"}