1 // Voronoi calculation example code
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : October 19th 2007
9 // Set up constants for the container geometry
10 const fpoint x_min
=-3,x_max
=3;
11 const fpoint y_min
=-3,y_max
=3;
12 const fpoint z_min
=0,z_max
=6;
14 // Set up the number of blocks that the container is divided
16 const int n_x
=3,n_y
=3,n_z
=3;
19 // Create a container with the geometry given above, and make it
20 // non-periodic in each of the three coordinates. Allocate space for
21 // eight particles within each computational block. Import
22 // the monodisperse test packing and output the Voronoi
23 // tessellation in gnuplot and POV-Ray formats.
24 container
con(x_min
,x_max
,y_min
,y_max
,z_min
,z_max
,n_x
,n_y
,n_z
,
26 con
.import("pack_six_cube");
27 con
.draw_cells_gnuplot("pack_six_cube.gnu");
28 con
.draw_cells_pov("pack_six_cube_v.pov");
29 con
.draw_particles_pov("pack_six_cube_p.pov");
31 // Create a container for polydisperse particles using the same
32 // geometry as above. Import the polydisperse test packing and
33 // output the Voronoi radical tessellation in gnuplot and POV-Ray
35 container_poly
conp(x_min
,x_max
,y_min
,y_max
,z_min
,z_max
,n_x
,n_y
,n_z
,
37 conp
.import("pack_six_cube_poly");
38 conp
.draw_cells_gnuplot("pack_six_cube_poly.gnu");
39 conp
.draw_cells_pov("pack_six_cube_poly_v.pov");
40 conp
.draw_particles_pov("pack_six_cube_poly_p.pov");