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
=-5,z_max
=5;
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 // Construct container
21 container
con(-5,5,-5,5,0,10,6,6,6,false,false,false,8);
24 con
.import("../basic/pack_ten_cube");
26 // Loop over all the particles and compute the Voronoi cell for each
33 if(cl
.start()) do if(con
.compute_cell(c
,cl
)) {
35 // Get particle position and ID
36 cl
.pos(x
,y
,z
);id
=cl
.pid();
41 // Output information (additional diagnostics could be done
43 printf("ID %d (%.3f,%.3f,%.3f) :",id
,x
,y
,z
);
44 for(i
=0;i
<vd
.size();i
++) printf(" %.3f",vd
[i
]);