1 // File import example code
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : August 30th 2011
10 // Set up constants for the container geometry
11 const double x_min
=-5,x_max
=5;
12 const double y_min
=-5,y_max
=5;
13 const double z_min
=0,z_max
=10;
15 // Set up the number of blocks that the container is divided into
16 const int n_x
=6,n_y
=6,n_z
=6;
20 // Create a container with the geometry given above, and make it
21 // non-periodic in each of the three coordinates. Allocate space for
22 // eight particles within each computational block
23 container
con(x_min
,x_max
,y_min
,y_max
,z_min
,z_max
,n_x
,n_y
,n_z
,
26 //Randomly add particles into the container
27 con
.import("pack_ten_cube");
29 // Save the Voronoi network of all the particles to text files
30 // in gnuplot and POV-Ray formats
31 con
.draw_cells_gnuplot("pack_ten_cube.gnu");
32 con
.draw_cells_pov("pack_ten_cube_v.pov");
34 // Output the particles in POV-Ray format
35 con
.draw_particles_pov("pack_ten_cube_p.pov");