PyAPD
Computing (optimal) anisotropic power diagrams using GPU acceleration
Install / Use
/learn @mbuze/PyAPDREADME

PyAPD
A Python library for computing (optimal) anisotropic power diagrams using GPU acceleration. Current main application concerns geometric modelling of polycrystalline materials with curved boundaries with grains of prescribed volumes and fine control over aspect ratio and location of the grains.
Installation
Install with pip:
pip install PyAPD
Example usage
See /notebooks/tutorials/example_usage.ipynb
Google Colab
To quickly test the speed of the GPU-acceleration, you can play around with the notebook example_usage.ipynb in Google Colab .
Note that by default the Google Colab runtime is CPU-only. To change to a GPU runtime, go to Runtime > Change runtime type and click on T4 GPU. Note that T4 GPU is considered pretty slow and is provided by Google Colab free of charge. To access the gold standard A100 GPU via Google Colab, a subscription is required.
For local use, if you do not have a GPU, you should expect a warning
[KeOps] Warning : Cuda libraries were not detected on the system ; using cpu only mode
but the library is fully functional.
Paper examples
This library is accompanied by the paper
- M. Buze, J. Feydy, S.M. Roper, K. Sedighiani, D.P. Bourne, Anisotropic power diagrams for polycrystal modelling: Efficient generation of curved grains via optimal transport, Computational Materials Science, Volume 245, 2024, DOI, LINK.
The examples presented in the paper can be found in /notebooks/paper_examples, which includes all the Jupyter notebooks as they were run, the data that was generated and the plots from the paper. For the ease of access, here we list them with links to view them statically in NBViewer and also a link to an interactive version in Google Colab. Note that the notebooks relying the loading of data will not work out of the box in Google Colab -- the relevant data will have to be loaded manually.
- Runtime tests
Citing this work
If you use PyAPD for academic research, you may cite the paper to which our library is tied as follows.
@article{PyAPD,
title = {Anisotropic power diagrams for polycrystal modelling: Efficient generation of curved grains via optimal transport},
journal = {Computational Materials Science},
volume = {245},
pages = {113317},
year = {2024},
issn = {0927-0256},
doi = {https://doi.org/10.1016/j.commatsci.2024.113317},
url = {https://www.sciencedirect.com/science/article/pii/S092702562400538X},
author = {M. Buze and J. Feydy and S.M. Roper and K. Sedighiani and D.P. Bourne},
keywords = {Anisotropic power diagrams, Polycrystalline materials, Microstructure generation, Optimal transport},
}
Related projects
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
