// Example code demonstrating find_voronoi_cell function // // Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 #include "voro++.hh" using namespace voro; // The sampling distance for the grids of find_voronoi_cell calls const double h=0.05; // The cube of the sampling distance, corresponding the amount of volume // associated with a sample point const double hcube=h*h*h; // Set the number of particles that are going to be randomly introduced const int particles=20; // This function returns a random double between 0 and 1 double rnd() {return double(rand())/RAND_MAX;} int main() { int i; double x,y,z,r,rx,ry,rz; // Create a container with the geometry given above, and make it // non-periodic in each of the three coordinates. Allocate space for // eight particles within each computational block container con(0,1,0,1,0,1,5,5,5,false,false,false,8); // Randomly add particles into the container for(i=0;i