Bugfix in search_for_outside_edge routine.
[voro++.git] / trunk / examples / walls / cylinder.cc
blob0e82d78345fe92aae8799aa67bdcf118cedca4a3
1 // Cylindrical wall 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=-6.5,x_max=6.5;
12 const double y_min=-6.5,y_max=6.5;
13 const double z_min=0,z_max=18.5;
15 // Set the computational grid size
16 const int n_x=7,n_y=7,n_z=14;
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 // Add a cylindrical wall to the container
26 wall_cylinder cyl(0,0,0,0,0,1,6);
27 con.add_wall(cyl);
29 // Import the particles from a file
30 con.import("pack_cylinder");
32 // Output the particle positions in POV-Ray format
33 con.draw_particles_pov("cylinder_p.pov");
35 // Output the Voronoi cells in POV-Ray format
36 con.draw_cells_pov("cylinder_v.pov");