Strip extra spaces from code.
[voro++.git] / branches / dynamic / examples / basic / import.cc
blobbfa033b8e6d996d8aebf16717a87cd38b6466088
1 // Voronoi calculation example code
2 //
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : July 1st 2008
7 #include "voro++.cc"
9 // Set up constants for the container geometry
10 const fpoint x_min=-5,x_max=5;
11 const fpoint y_min=-5,y_max=5;
12 const fpoint z_min=0,z_max=10;
14 // Set up the number of blocks that the container is divided
15 // into.
16 const int n_x=6,n_y=6,n_z=6;
18 int main() {
19 // Create a container with the geometry given above, and make it
20 // non-periodic in each of the three coordinates. Allocate space for
21 // eight particles within each computational block
22 container con(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z,
23 false,false,false,8);
25 //Randomly add particles into the container
26 con.import("pack_ten_cube");
28 // Save the Voronoi network of all the particles to text files
29 // in gnuplot and POV-Ray formats
30 con.draw_cells_gnuplot("cells_ten_cube.gnu");
31 con.draw_cells_pov("cells_ten_cube.pov");
33 // Output the particles in POV-Ray format
34 con.draw_particles_pov("pack_ten_cube.pov");