00001 // Voro++, a 3D cell-based Voronoi library 00002 // 00003 // Author : Chris H. Rycroft (LBL / UC Berkeley) 00004 // Email : chr@alum.mit.edu 00005 // Date : July 1st 2008 00006 00007 /** \mainpage Voro++ class reference manual 00008 * \section intro Introduction 00009 * Voro++ is a software library for carrying out 3D cell-based calculations of 00010 * the Voronoi tessellation. It is primarily designed for applications in 00011 * physics and materials science, where the Voronoi tessellation can be a 00012 * useful tool in analyzing particle systems. 00013 * 00014 * Voro++ is comprised of several C++ classes, and is designed to be 00015 * incorporated into other programs. This manual provides a reference for every 00016 * function in the class structure. For a general overview of the program, see 00017 * the Voro++ website at http://math.lbl.gov/voro++/ and in particular the 00018 * example programs at http://math.lbl.gov/voro++/examples/ that demonstrate 00019 * many of the library's features. 00020 * 00021 * \section class C++ class structure 00022 * The code is structured around two main C++ classes. The voronoicell class 00023 * contains all of the routines for constructing a single Voronoi cell. It 00024 * represents the cells as a collection of vertices that are connected by 00025 * edges. The command init() can be used to initialize a cell as a large 00026 * rectangular box. The Voronoi cell can then be computed by repeatedly cutting 00027 * it with planes that correspond to the perpendicular bisectors between on 00028 * point and its neighbors. The command plane() will recompute the cell after 00029 * cutting with a single plane. Once the cell is computed, it can be drawn 00030 * using commands such as draw_gnuplot() and draw_pov(), or its volume can be 00031 * computed using the volume() command. 00032 * 00033 * The container class represents a 3D rectangular box of particles. The 00034 * constructor for this class sets up the coordinate ranges, sets whether each 00035 * direction is periodic or not, and divides the box into a rectangular subgrid 00036 * of regions. Particles can be added to the container using the put() command, 00037 * that adds a particle's position and an integer numerical ID label, to the 00038 * container by adding it to the corresponding region. The command import() can 00039 * be used to read in large numbers of particles from a text file. The 00040 * compute_cell() function creates a single Voronoi cell for a particle in the 00041 * container, by making use of the voronoicell class, and constructing the cell 00042 * by making calls to the plane() routine to account for neighboring points. 00043 * Various commands such as store_cell_volumes() and draw_cells_gnuplot() can 00044 * be used to calculate and draw the cells in the entire container or in a 00045 * subregion. 00046 * 00047 * \section templates Extra functionality and the use of templates 00048 * The library also supports the Voronoi radical tessellation, by using the 00049 * container_poly class that is a variant of the container class where the 00050 * put() command accepts an additional argument for the particle radius. To 00051 * create this without repeating large parts of the code, the library makes use 00052 * of templates. The source code is structured around a general template called 00053 * container_base. There are then two small classes called radius_mono and 00054 * radius_poly that handle all of the routines for the regular and radical 00055 * tessellations respectively. The container class is created as the 00056 * instantiation of the container_base template with the radius_mono class, and 00057 * the container_poly class is the instantiation of the container_base template 00058 * with the radius_poly class. Since the different instances are created during 00059 * the program compilation and since all of the functions of radius_mono and 00060 * radius_poly are declared inline, this approach should result in minimal 00061 * overhead with a good compiler. 00062 * 00063 * Similarly, the voronoicell class is constructed around a template called 00064 * voronoicell_base. The voronoicell class is an instantiation of this template 00065 * using the neighbor_none class, that does not compute any neighbor 00066 * information. A variant called voronoicell_neighbor is also available, that 00067 * makes use of the neighbor_track class to additionally carry out neighbor 00068 * tracking during the cell construction. 00069 * 00070 * \section walls Wall computation 00071 * Wall computations are handled by making use of a pure virtual wall class. 00072 * Specific wall types are derived from this class, and have a routine called 00073 * point_inside() that tests to see if a point is inside a wall or not, and a 00074 * routine called cut_cell() that cuts a cell according to the wall's position. 00075 * The walls can be added to the container using the add_wall() command, and 00076 * these are called each time a compute_cell() command is carried out. At 00077 * present, wall types for planes, spheres, cylinders, and cones are provided, 00078 * although custom walls can be added by creating new classes derived from the 00079 * pure virtual class. */ 00080 00081 #ifndef VOROPP_HH 00082 #define VOROPP_HH 00083 00084 #include "cell.hh" 00085 #include "container.hh" 00086 #include "wall.hh" 00087 00088 #endif