A Python library for generating (optimal) anisotropic power diagrams
Project description
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 (2024). Anisotropic power diagrams for polycrystal modeling: efficient generation of curved grains via optimal transport. arXiv e-prints 2403.03571, 2024. 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 (preprint version for now).
@misc{pyapd2024,
title={Anisotropic power diagrams for polycrystal modelling: efficient generation of curved grains via optimal transport},
author={Maciej Buze and Jean Feydy and Steven M. Roper and Karo Sedighiani and David P. Bourne},
year={2024},
eprint={2403.03571},
archivePrefix={arXiv},
primaryClass={cond-mat.mtrl-sci}
}
Related projects
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file PyAPD-0.1.1.tar.gz
.
File metadata
- Download URL: PyAPD-0.1.1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e12193b7cd38a21069991a1a5c2b475948206ea5b87d38c4a8300160be18b059 |
|
MD5 | 2ddf6ef5b173554fd3c325a737ced98c |
|
BLAKE2b-256 | bbf4741242da4e41d7a822fed12e2435aa84a7f1a271777f5c7e2868c171108d |