+ fputs("The length scale must be positive\n",stderr);
+ } else {
+ fprintf(stderr,"The length scale is smaller than the safe limit of %g. Either\nincrease the particle length scale, or recompile with a different limit.\n",tolerance);
+ }
+ wl.deallocate();
+ return VOROPP_CMD_LINE_ERROR;
+ }
+ ls=0.6/ls;
+ nxf=(bx-ax)*ls+1;
+ nyf=(by-ay)*ls+1;
+ nzf=(bz-az)*ls+1;
+
+ nx=int(nxf);ny=int(nyf);nz=int(nzf);
+ } else {
+ nxf=nx;nyf=ny;nzf=nz;
+ }
+
+ // Compute the number regions based on the length scale
+ // provided. If the total number exceeds a cutoff then bail
+ // out, to prevent making a massive memory allocation. Do this
+ // test using floating point numbers, since huge integers could
+ // potentially wrap around to negative values.
+ if(nxf*nyf*nzf>max_regions) {
+ fprintf(stderr,"voro++: Number of computational blocks exceeds the maximum allowed of %d.\n"
+ "Either increase the particle length scale, or recompile with an increased\nmaximum.",max_regions);
+ wl.deallocate();
+ return VOROPP_MEMORY_ERROR;
+ }
+ }
+
+ // Check that the output filename is a sensible length