msh2sdfis a Python package for unfitted finite element simulations that provides an implicit geometric description of a mesh using a signed distance function.
It computes a signed distance function (SDF) to a specified surface mesh, on the nodes of a background mesh. This surface mesh defines the boundary of the object to be modelled.
The SDF offers an implicit representation of the surface on a fixed background mesh facilitating unfitted finite element methodologies.
Warning
This package is currently under active development and is not yet stable. The APIs may undergo significant changes in future releases. See ROADMAP for more details.
You can install the package using pip:
pip install -i https://test.pypi.org/simple/ msh2sdfCompute the SDF for a circular boundary of radius 2 having 1000 points.
import msh2sdf as ms
X, T = ms.get_circle_example()
sdf, XB = ms.compute_sdf(X,T,)
ms.plot_sdf(sdf,XB,X)- Clone the repository:
git clone https://github.com/tennets/msh2sdf.git cd msh2sdf - Install development dependencies:
pip install -r requirements.txt
To run the tests, execute:
pytest tests/Ensure all tests pass before submitting changes.
Contributions and feedback are welcome! Please submit a pull request or open an issue for discussion.
This package is licensed under the MIT License. See the LICENSE file for more details.