1 // Custom output 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
=-3,x_max
=3;
12 const double y_min
=-3,y_max
=3;
13 const double z_min
=0,z_max
=6;
15 // Set up the number of blocks that the container is divided
17 const int n_x
=3,n_y
=3,n_z
=3;
21 // Create a container with the geometry given above, and make it
22 // non-periodic in each of the three coordinates. Allocate space for
23 // eight particles within each computational block.
24 container
con(x_min
,x_max
,y_min
,y_max
,z_min
,z_max
,n_x
,n_y
,n_z
,
27 // Import the monodisperse test packing and output the Voronoi
28 // tessellation in gnuplot and POV-Ray formats.
29 con
.import("pack_six_cube");
31 // Do a custom output routine to store the number of vertices, edges,
32 // and faces of each Voronoi cell
34 "ID=%i, pos=(%x,%y,%z), vertices=%w, edges=%g, faces=%s",
37 // Do a custom output routine to store a variety of face-based
38 // statistics. Store the particle ID and position, the number of faces
39 // the total face area, the order of each face, the areas of each face,
40 // the vertices making up each face, and the neighboring particle (or
41 // wall) corresponding to each face.
42 con
.print_custom("%i %q %s %F %a %f %t %l %n","packing.custom2");
44 // Do a custom output routine that outputs the particle IDs and
45 // positions, plus the volume and the centroid position relative to the
47 con
.print_custom("%i %q %v %c","packing.custom3");
49 // Also create POV-Ray output of the Voronoi cells for use in the
51 con
.draw_cells_pov("pack_six_cube_v.pov");