1 // File import example code
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : August 30th 2011
13 // Set up constants for the container geometry
14 const double x_min
=-5,x_max
=5;
15 const double y_min
=-5,y_max
=5;
16 const double z_min
=-5,z_max
=5;
18 // Set up the number of blocks that the container is divided into
19 const int n_x
=6,n_y
=6,n_z
=6;
23 // Construct container
24 container
con(-5,5,-5,5,0,10,6,6,6,false,false,false,8);
27 con
.import("../basic/pack_ten_cube");
29 // Loop over all the particles and compute the Voronoi cell for each
36 if(cl
.start()) do if(con
.compute_cell(c
,cl
)) {
38 // Get particle position and ID
39 cl
.pos(x
,y
,z
);id
=cl
.pid();
44 // Output information (additional diagnostics could be done
46 printf("ID %d (%.3f,%.3f,%.3f) :",id
,x
,y
,z
);
47 for(i
=0;i
<vd
.size();i
++) printf(" %.3f",vd
[i
]);