https://github.com/eleftherioszisis/multivoro
Python bindings for creating Voronoi & Laguerre diagrams using multithreaded Voro++
https://github.com/eleftherioszisis/multivoro
laguerre-tessellation power-diagram voronoi-diagram voronoi-tessellation
Last synced: 5 months ago
JSON representation
Python bindings for creating Voronoi & Laguerre diagrams using multithreaded Voro++
- Host: GitHub
- URL: https://github.com/eleftherioszisis/multivoro
- Owner: eleftherioszisis
- License: other
- Created: 2024-03-02T16:35:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-09T12:02:28.000Z (about 1 year ago)
- Last Synced: 2025-04-26T21:48:47.128Z (6 months ago)
- Topics: laguerre-tessellation, power-diagram, voronoi-diagram, voronoi-tessellation
- Language: Python
- Homepage:
- Size: 375 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://github.com/eleftherioszisis/multivoro/blob/main/logo.png
Parallel cell-based 3D voronoi tessellations
--------------------------------------------multivoro is a python library that allows building 3D Voronoi/Laguerre tessellations with `voro++ `_ exposed in python via the nanobind_ library.
It leverages the latest `multi-threaded extension of Voro++ `_ to allow computing the voronoi cells in parallel.Codebases
---------
* `Voro++ `_
* nanobind_Installation
------------Wheels
~~~~~~
There are available pre-compiled wheels to pip install for Linux and macOS.
However, note that these wheels are compiled without multithreading support.To install them in your system:
.. code-block:: bash
pip install multivoro
Source
~~~~~~
To build multivoro from source in Ubuntu:Setup a python virtual environment:
.. code-block:: bash
# python versions to choose from: [python3.8-python3.12]
sudo apt install python3.10-dev python3.10-venv
python3.10 -mvenv venv
source ./venv/bin/activateInstall openmp runtime and compile the wheel:
.. code-block:: bash
sudo apt install libomp-dev
git clone --recurse-submodules https://github.com/eleftherioszisis/multivoro.git
cd multivoro
USE_OpenMP=ON pip install .USE_OpenMP environment variable is used as an option in multivoro cmake. By default it is set to 'OFF'.
Usage
-----.. code-block:: python
from multivoro import compute_voronoi
cells = compute_voronoi(
points=[[-1.0, 0.0, 0.0], [1.0, 0.0, 0.0]],
radii=[1.0, 1.0],
limits=[[-2.0, -1.0, -1.0], [2.0, 1.0, 1.0]],
n_threads=6,
)for cell in cells:
print(cell.get_vertices())
print(cell.get_neighbors())
print(cell.get_face_vertices())Voro++ Copyright And Acknowledgments
------------------------------------Copyright Notice
~~~~~~~~~~~~~~~~Voro++ Copyright (c) 2008, The Regents of the University of California, through
Lawrence Berkeley National Laboratory (subject to receipt of any required
approvals from the U.S. Dept. of Energy). All rights reserved.If you have questions about your rights to use or distribute this software,
please contact Berkeley Lab's Technology Transfer Department at TTD@lbl.gov.NOTICE. This software was developed under partial funding from the U.S.
Department of Energy. As such, the U.S. Government has been granted for itself
and others acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide
license in the Software to reproduce, prepare derivative works, and perform
publicly and display publicly. Beginning five (5) years after the date
permission to assert copyright is obtained from the U.S. Department of Energy,
and subject to any subsequent five (5) year renewals, the U.S. Government is
granted for itself and others acting on its behalf a paid-up, nonexclusive,
irrevocable, worldwide license in the Software to reproduce, prepare derivative
works, distribute copies to the public, perform publicly and display publicly,
and to permit others to do so.Acknowledgments
~~~~~~~~~~~~~~~
This work (voro++) was supported by the Director, Office of Science, Computational and
Technology Research, U.S. Department of Energy under Contract No.
DE-AC02-05CH11231... _voro_repo: https://github.com/chr1shr/voro
.. _voro_site: http://math.lbl.gov/voro++/
.. _voro_mthread: https://doi.org/10.1016/j.cpc.2023.108832
.. _nanobind: https://github.com/wjakob/nanobind