chr1shr / voro

Voro++: a three-dimensional Voronoi cell library in C++
Other
160 stars 47 forks source link

Voro++, a 3D cell-based Voronoi library (http://math.lbl.gov/voro++/) By Chris H. Rycroft (Harvard University / Lawrence Berkeley Laboratory)

Voro++ is a software library for carrying out three-dimensional computations of the Voronoi tessellation. A distinguishing feature of the Voro++ library is that it carries out cell-based calculations, computing the Voronoi cell for each particle individually, rather than computing the Voronoi tessellation as a global network of vertices and edges. It is particularly well-suited for applications that rely on cell-based statistics, where features of Voronoi cells (e.g. volume, centroid, number of faces) can be used to analyze a system of particles.

Voro++ comprises of several C++ classes that can be built as a static library and linked to. A command-line utility is also provided that can analyze text files of particle configurations and use most of the features of the code. Numerous examples are provided to demonstrate the library's features and all of these are discussed in detail on the library website.

Compilation - Linux / Mac OS / Windows with Cygwin

The code is written in ANSI C++, and compiles on many system architectures. The package contains the C++ source code, example files, miscellaneous utilities and documentation. On Linux, Mac OS, and Windows (using Cygwin), the compilation and installed can be carried out using GNU Make.

To begin, the user should review the file "config.mk" in the top level directory, to make sure that the compilation and installation settings are appropriate for their system. Typing "make" will then compile the static library, command-line utility, and examples. The command-line utility and library will appear within the "src" directory.

Following successful compilation, the library, command-line utility, and documentation can be installed by typing "sudo make install". By default, the program files are installed into /usr/local, and it may be necessary to modify your environment variables in order to access the installed files:

The library website contains additional notes on setting environment variables, and many guides are available on the Internet.

The code can later be uninstalled with "sudo make uninstall". It is also possible to use the library and command-line utility without installation by calling the files directly once they have been compiled. On systems where the user does not have root privileges to install into /usr/local, the "config.mk" file can be modified to install into the user's home directory by setting PREFIX=$(HOME). Voro++ supports parallel compilation by using the "make -j " command where n is the number of threads.

Compilation - Windows without Cygwin

On a Windows machine without a terminal environment like Cygwin, it is possible to import and compile the library in many standard C++ development environments. Users have reported success in building the library with Microsoft Visual C++ Express and Code::Blocks.

Related programs

No external dependencies are required to compile and run the code, but several programs may be useful for analyzing the output:

Contents

examples - many documented examples making use of the library html - an HTML-based reference manual (generated by Doxygen) man - contains the man page that is installed with the program scripts - miscellaneous helper scripts src - source code files

Usage

Voro++ is released as free software through the Lawrence Berkeley National Laboratory - a detailed copyright notice is provided below, and the complete terms of the license can be found in the LICENSE file.

I am very interested to hear from users of the software, so if you find this useful, please email me at chr@alum.mit.edu. Also, if you plan to publish an academic paper using this software, please consider citing one of the following publications:

The first reference contains a one-page overview of the library. The second reference contains some of the initial images that were made using a very early version of this code, to track small changes in packing fraction in a large particle simulation. The third reference discusses the use of 3D Voronoi cells, and describes the algorithms that were employed in the early version of this code. Since the publication of the above references, the algorithms in Voro++ have been significantly improved.

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 was supported by the Director, Office of Science, Computational and Technology Research, U.S. Department of Energy under Contract No. DE-AC02-05CH11231.