1 // Voronoi calculation example code
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : July 1st 2008
9 // Set up constants for the container geometry
10 const fpoint x_min
=-6.5,x_max
=6.5;
11 const fpoint y_min
=-6.5,y_max
=6.5;
12 const fpoint z_min
=0,z_max
=18.5;
14 // Set the computational grid size
15 const int n_x
=7,n_y
=7,n_z
=14;
18 // Create a container with the geometry given above, and make it
19 // non-periodic in each of the three coordinates. Allocate space for
20 // eight particles within each computational block.
21 container
con(x_min
,x_max
,y_min
,y_max
,z_min
,z_max
,n_x
,n_y
,n_z
,
24 // Add a cylindrical wall to the container
25 wall_cylinder
cyl(0,0,0,0,0,1,6);
28 // Import the particles from a file
29 con
.import("pack_cylinder");
31 // Output the particle positions in POV-Ray format
32 con
.draw_particles_pov("cylinder_p.pov");
34 // Output the Voronoi cells in POV-Ray format
35 con
.draw_cells_pov("cylinder_v.pov");