Reset platonic code.
[voro++.git] / trunk / examples / basic / import.cc
blob0f5662686d7a38f06e57278421fe2f0656c5d782
1 // File import example code
2 //
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : August 30th 2011
7 #include "voro++.hh"
8 using namespace voro;
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;
18 int main() {
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,
24 false,false,false,8);
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");