diff -Nru voro++-0.5/2d/examples/basic/doe_diagram.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/doe_diagram.cc --- voro++-0.5/2d/examples/basic/doe_diagram.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/doe_diagram.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -int main() { - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_2d con(0,1,0,1,6,6,false,false,16); - - // Import the spiral data set - con.import("particles_spiral"); - - // Do a custom computation on the Voronoi cells, printing the IDs, - // positions, and Voronoi cell areas to a file - con.print_custom("%i %x %y %a","particles_spiral.out"); -} diff -Nru voro++-0.5/2d/examples/basic/doe_diagram.pov voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/doe_diagram.pov --- voro++-0.5/2d/examples/basic/doe_diagram.pov 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/doe_diagram.pov 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -#version 3.6; - -// Right-handed coordinate system in which the z-axis points upwards -camera { - orthographic - location <8,11,-50> - right 25*x*image_width/image_height - up 25*y - look_at <8,11,0> -} - -// White background -background{rgb 1} - -// Two lights with slightly different colors -light_source{<-8,30,-20> color rgb <0.79,0.75,0.75>} -light_source{<25,12,-12> color rgb <0.36,0.40,0.40>} - -// Radius of the Voronoi cell network -#declare r=0.2; - -// Radius of the particles -#declare s=2.8; - -union { - sphere{<0,0,0>,1.4} - pigment{rgbft <0.9,0.82,0.4>} finish{reflection 0.1 specular 0.3 ambient 0.42} -} - - -// Particles -/*#declare s=2.8; -union{ -#include "doe_diagram_p.pov" - pigment{rgbft <0.9,0.82,0.4,0,0.5>} finish{reflection 0.1 specular 0.3 ambient 0.42} -} - - -#declare s=1.4; -union{ -#include "doe_diagram_p.pov" - pigment{rgbft <0.4,0.6,0.3>} finish{reflection 0.1 specular 0.3 ambient 0.42} -}*/ - -// Voronoi cells -/*intersection{ - union{ - #include "doe_diagram_v.pov" - } - box{<-2,-1,-4>,<18,23,4>} - pigment{rgb <0.8,0.59,0.9>} finish{specular 0.5 ambient 0.42} -}*/ diff -Nru voro++-0.5/2d/examples/basic/import_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/import_2d.cc --- voro++-0.5/2d/examples/basic/import_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/import_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -int main() { - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_2d con(0,1,0,1,6,6,false,false,16); - - // Import the spiral data set - con.import("particles_spiral"); - - // Do a custom computation on the Voronoi cells, printing the IDs, - // positions, and Voronoi cell areas to a file - con.print_custom("%i %x %y %a","particles_spiral.out"); -} diff -Nru voro++-0.5/2d/examples/basic/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/Makefile --- voro++-0.5/2d/examples/basic/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (LBL / UC Berkeley) -# Email : chr@alum.mit.edu -# Date : May 18th 2011 - -# Load the common configuration file -include ../../config.mk - -# List of executables -EXECUTABLES=single_cell_2d random_points_2d import_2d doe_diagram - -# Makefile rules -all: $(EXECUTABLES) - -single_cell_2d: single_cell_2d.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -random_points_2d: random_points_2d.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -import_2d: import_2d.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -doe_diagram: doe_diagram.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -clean: - rm -f $(EXECUTABLES) - -.PHONY: all clean diff -Nru voro++-0.5/2d/examples/basic/random_points_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/random_points_2d.cc --- voro++-0.5/2d/examples/basic/random_points_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/random_points_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i;double x,y; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 10 by 10 grid, - // with an initial memory allocation of 16 particles per grid square. - container_2d con(0,1,0,1,10,10,false,false,16); - - // Add 1000 random points to the container - for(i=0;i<1000;i++) { - x=rnd(); - y=rnd(); - con.put(i,x,y); - } - - // Output the particle positions to a file - con.draw_particles("random_points_2d.par"); - - // Output the Voronoi cells to a file, in the gnuplot format - con.draw_cells_gnuplot("random_points_2d.gnu"); - - // Sum the Voronoi cell areas and compare to the container area - double carea=1,varea=con.sum_cell_areas(); - printf("Total container area : %g\n" - "Total Voronoi cell area : %g\n" - "Difference : %g\n",carea,varea,varea-carea); -} diff -Nru voro++-0.5/2d/examples/basic/single_cell_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/single_cell_2d.cc --- voro++-0.5/2d/examples/basic/single_cell_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/basic/single_cell_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - double x,y,rsq,r; - voronoicell_2d v; - - // Initialize the Voronoi cell to be a cube of side length 2, centered - // on the origin - v.init(-1,1,-1,1); - - // Cut the cell by 100 random planes which are all a distance 1 away - // from the origin, to make an approximation to a sphere - for(int i=0;i<100;i++) { - x=2*rnd()-1; - y=2*rnd()-1; - rsq=x*x+y*y; - if(rsq>0.01&&rsq<1) { - r=1/sqrt(rsq);x*=r;y*=r; - v.plane(x,y,1); - } - } - - // Print out several statistics about the computed cell - v.centroid(x,y); - printf("Perimeter is %g\n" - "Area is %g\n" - "Centroid is (%g,%g)\n",v.perimeter(),v.area(),x,y); - - // Output the Voronoi cell to a file, in the gnuplot format - v.draw_gnuplot(0,0,"single_cell_2d.gnu"); -} diff -Nru voro++-0.5/2d/examples/boundary/annulus.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/annulus.cc --- voro++-0.5/2d/examples/boundary/annulus.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/annulus.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -#include "voro++_2d.hh" -#include -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -const double tpi=8*atan(1.0); - -int main() { - int i=0; - double x,y,t; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_boundary_2d con(-1,1,-1,1,6,6,false,false,8); - - // Create outer circle, tracing in the positive sense (i.e. anticlockwise) - con.start_boundary(); - for(t=0.01*tpi;t-0.9;x-=0.2) { - con.put(i,x,-0.7);i++; - con.put(i,x-0.1,0.9);i++; - } - con.end_boundary(); - - // Add random points - while(i<200) { - x=-1+2*rnd(); - y=-1+2*rnd(); - if(con.point_inside(x,y)) {con.put(i,x,y);i++;} - } - - con.draw_boundary_gnuplot("comb.bd"); - con.draw_particles("comb.par"); - - con.setup(); - con.draw_cells_gnuplot("comb.gnu"); - - // Sum the Voronoi cell areas and compare to the container area -// double carea=1,varea=con.sum_cell_areas(); -// printf("Total container area : %g\n" -// "Total Voronoi cell area : %g\n" -// "Difference : %g\n",carea,varea,varea-carea); -} diff -Nru voro++-0.5/2d/examples/boundary/container_bd.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/container_bd.cc --- voro++-0.5/2d/examples/boundary/container_bd.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/container_bd.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i; - double x,y; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_boundary_2d con(-1,1,-1,1,6,6,false,false,8); - - // Add 1000 random points to the container - con.start_boundary(); - con.put(0,-0.8,-0.8); - con.put(1,0.8,-0.8); - con.put(2,0.8,0.8); - con.put(3,0.1,0.75); - con.put(4,0,-0.3); - con.put(5,-0.1,0.95); - con.put(6,-0.8,0.8); - con.put(7,-0.799,-0.6); - con.end_boundary(); - - for(i=0;i<100;i++) { - x=-1+2*rnd(); - y=-1+2*rnd(); - if(con.point_inside(x,y)) con.put(i+8,x,y); - } - - con.draw_boundary_gnuplot("container_bd.gnu"); - con.draw_particles("container_bd.par"); - - con.setup(); - con.draw_cells_gnuplot("container_bd_v.gnu"); - - // Sum the Voronoi cell areas and compare to the container area -// double carea=1,varea=con.sum_cell_areas(); -// printf("Total container area : %g\n" -// "Total Voronoi cell area : %g\n" -// "Difference : %g\n",carea,varea,varea-carea); -} diff -Nru voro++-0.5/2d/examples/boundary/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/Makefile --- voro++-0.5/2d/examples/boundary/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (LBL / UC Berkeley) -# Email : chr@alum.mit.edu -# Date : May 18th 2011 - -# Load the common configuration file -include ../../config.mk - -# List of executables -EXECUTABLES=nonconvex_cell container_bd comb annulus - -# Makefile rules -all: $(EXECUTABLES) - -nonconvex_cell: nonconvex_cell.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -container_bd: container_bd.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -comb: comb.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -annulus: annulus.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -clean: - rm -f $(EXECUTABLES) - -.PHONY: all clean diff -Nru voro++-0.5/2d/examples/boundary/nonconvex_cell.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/nonconvex_cell.cc --- voro++-0.5/2d/examples/boundary/nonconvex_cell.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/boundary/nonconvex_cell.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - double x,y; - voronoicell_nonconvex_2d v; - - // Initialize the Voronoi cell to be a cube of side length 2, centered - // on the origin - v.init_nonconvex(-1,0.8,-1,0.4,4,5,5,4); - v.draw_gnuplot(0,0,"nonconvex_cell.gnu"); - v.plane(0.3,0); - v.plane(0.4,0); - - // Cut the cell by 100 random planes which are all a distance 1 away - // from the origin, to make an approximation to a sphere - /*for(int i=0;i<100;i++) { - x=2*rnd()-1; - y=2*rnd()-1; - rsq=x*x+y*y; - if(rsq>0.01&&rsq<1) { - r=1/sqrt(rsq);x*=r;y*=r; - v.plane(x,y,1); - } - }*/ - - // Print out several statistics about the computed cell - v.centroid(x,y); - printf("Perimeter is %g\n" - "Area is %g\n" - "Centroid is (%g,%g)\n",v.perimeter(),v.area(),x,y); - - // Output the Voronoi cell to a file, in the gnuplot format - v.draw_gnuplot(0,0,"nonconvex_cell2.gnu"); -} diff -Nru voro++-0.5/2d/examples/extra/intersect.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/intersect.cc --- voro++-0.5/2d/examples/extra/intersect.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/intersect.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -// Cell cutting region example code -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++_2d.hh" -using namespace voro; - -const double pi=3.1415926535897932384626433832795; - -// This constant sets the tolerance in the bisection search algorithm -const double tolwidth=1e-7; - -// This constant determines the density of points to test -const double phi_step=pi/400; - -int main() { - double x,y,r,rmin,rmax; - double phi; - voronoicell_2d v; - FILE *fp=safe_fopen("intersect_region.gnu","w"); - - // Initialize the Voronoi cell to be an octahedron and make a single - // plane cut to add some variation - v.init(-1,1,-1,1); - v.plane(1,1,1); - - // Output the cell in gnuplot format - v.draw_gnuplot(0,0,"intersect_cell.gnu"); - - // Now test over direction vectors from the center of the sphere. For - // each vector, carry out a search to find the maximum distance along - // that vector that a plane will intersect with cell, and save it to - // the output file. - for(phi=phi_step*0.5;phi<2*pi;phi+=phi_step) { - - // Calculate a direction to look along - x=cos(phi); - y=sin(phi); - - // Now carry out a bisection search. Here, we initialize a - // minimum and a maximum guess for the distance along this - // vector. Keep multiplying rmax by two until the plane no - // longer makes a cut. - rmin=0;rmax=1; - while (v.plane_intersects(x,y,rmax)) rmax*=2; - - // We now know that the distance is somewhere between rmin and - // rmax. Test the point halfway in-between these two. If it - // intersects, then move rmin to this point; otherwise, move - // rmax there. At each stage the bounding interval is divided - // by two. Exit when the width of the interval is smaller than - // the tolerance. - while (rmax-rmin>tolwidth) { - r=(rmax+rmin)*0.5; - if (v.plane_intersects(x,y,r)) rmin=r; - else rmax=r; - } - - // Output this point to file - r=(rmax+rmin)*0.5; - x*=r;y*=r; - fprintf(fp,"%g %g\n",x,y); - } - - fclose(fp); -} diff -Nru voro++-0.5/2d/examples/extra/lloyd.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/lloyd.cc --- voro++-0.5/2d/examples/extra/lloyd.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/lloyd.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -#include "voro++_2d.hh" -using namespace voro; - -int main() { - int i; - char buffer[64]; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_2d con(0,1,0,1,6,6,false,false,16); - - // Import the spiral data set, and only save those particles that are - // within the container bounds - con.import("particles_spiral"); - sprintf(buffer,"lloyd_output/lloyd_p.%d",0); - con.draw_particles(buffer); - - // Carry out sixty four iterations of Lloyd's algorithm - for(i=0;i<256;i++) { - con.clear(); - con.import(buffer); - sprintf(buffer,"lloyd_output/lloyd_v.%d",i); - con.draw_cells_gnuplot(buffer); - sprintf(buffer,"lloyd_output/lloyd_p.%d",i+1); - con.print_custom("%i %C",buffer); - } - - // Draw the final Voronoi cells - con.draw_cells_gnuplot("lloyd_output/lloyd_v.256"); -} diff -Nru voro++-0.5/2d/examples/extra/lloyd_movie.pl voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/lloyd_movie.pl --- voro++-0.5/2d/examples/extra/lloyd_movie.pl 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/lloyd_movie.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#!/usr/bin/perl - -# Loop over the frames -foreach $f (0..256) { - - # Create the filename - $fn=sprintf "lloyd_output/fr_%04d.png",$f; - - # Create a temporary gnuplot file to render the frame - open A,"lloyd_movie.gnuplot"; - open B,">temp.gnuplot"; - while() { - s/FILENAME/$fn/; - s/N/$f/g; - print B; - } - close A; - close B; - - # Render the frame using Gnuplot - `gnuplot temp.gnuplot`; -} - -# Remove temporary file -unlink "temp.gnuplot"; diff -Nru voro++-0.5/2d/examples/extra/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/Makefile --- voro++-0.5/2d/examples/extra/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/extra/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (LBL / UC Berkeley) -# Email : chr@alum.mit.edu -# Date : May 18th 2011 - -# Load the common configuration file -include ../../config.mk - -# List of executables -EXECUTABLES=intersect lloyd - -# Makefile rules -all: $(EXECUTABLES) - -intersect: intersect.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -lloyd: lloyd.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++_2d - -clean: - rm -f $(EXECUTABLES) - -.PHONY: all clean diff -Nru voro++-0.5/2d/examples/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/Makefile --- voro++-0.5/2d/examples/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (LBL / UC Berkeley) -# Email : chr@alum.mit.edu -# Date : August 30th 2011 - -# Makefile rules -all: ex_basic ex_walls ex_boundary ex_extra - -ex_basic: - $(MAKE) -C basic - -ex_walls: - $(MAKE) -C walls - -ex_boundary: - $(MAKE) -C boundary - -ex_extra: - $(MAKE) -C extra - -clean: - $(MAKE) -C basic clean - $(MAKE) -C walls clean - $(MAKE) -C boundary clean - $(MAKE) -C extra clean - -.PHONY: all ex_basic ex_walls ex_boundary ex_extra clean diff -Nru voro++-0.5/2d/examples/timing/timing_test_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/timing/timing_test_2d.cc --- voro++-0.5/2d/examples/timing/timing_test_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/examples/timing/timing_test_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -#include - -#include "voro++_2d.hh" -using namespace voro; - -// Set up the number of blocks that the container is divided into. If the -// preprocessor variable NNN hasn't been passed to the code, then initialize it -// to a good value. Otherwise, use the value that has been passed. -#ifndef NNN -#define NNN 26 -#endif - -// Set the number of particles that are going to be randomly introduced -const int particles=100000; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - clock_t start,end; - int i;double x,y; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 6 by 6 grid, with - // an initial memory allocation of 16 particles per grid square. - container_2d con(0,1,0,1,NNN,NNN,false,false,16); - - //Randomly add particles into the container - for(i=0;i -using namespace std; - -#include "voro++_2d.hh" -using namespace voro; - -const double pi=3.1415926535897932384626433832795; -const double radius=0.5; -const int n=5; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i=0;double x,y,arg; - - // Initialize the container class to be the unit square, with - // non-periodic boundary conditions. Divide it into a 10 by 10 grid, with - // an initial memory allocation of 8 particles per grid square. - container_2d con(-1,1,-1,1,10,10,false,false,8); - - // Add circular wall object - wall_plane_2d *wc[n]; - for(i=0,arg=0;i@ARGV[0].net" or die "Can't open output file"; - -$maxn=0; - -while() { - @A=split; - $n=@A[0]; - $x[$n]=@A[1]; - $y[$n]=@A[2]; - $c[$n]=$#A-4; - $l[$n][$_-4]=@A[$_] foreach 4..$#A; - $maxn=$n if $n>$maxn; -} - -foreach $n (1..$maxn) { - foreach (0..$c[$n]) { - $j=$l[$n][$_]; - print B "$x[$j] $y[$j]\n$x[$n] $y[$n]\n\n\n" if $j>=$n; - } -} diff -Nru voro++-0.5/2d/scripts/sum.pl voro++-0.5+revert-to-0.4.6+dfsg1/2d/scripts/sum.pl --- voro++-0.5/2d/scripts/sum.pl 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/scripts/sum.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -#!/usr/bin/perl -# This script will take a .vol file created by voro++, and it will sum up the -# volumes of all the Voronoi cells. In many cases, this will equal the volume -# of the container, and it can be a useful check. -# -# It assumes that the volume is stored in the final column, so it works with -# both regular and polydisperse calculations. - -open A,"@ARGV[0]" or die "Can't open input file"; -while() { - @A=split; - $c+=pop @A; -} -print "$c\n"; diff -Nru voro++-0.5/2d/src/cell_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cell_2d.cc --- voro++-0.5/2d/src/cell_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cell_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,523 +0,0 @@ -/** \file cell_2d.cc - * \brief Function implementations for the voronoicell_2d class. */ - -#include "cell_2d.hh" -#include "cell_nc_2d.hh" - -namespace voro { - -/** Constructs a 2D Voronoi cell and sets up the initial memory. */ -voronoicell_base_2d::voronoicell_base_2d() : - current_vertices(init_vertices), current_delete_size(init_delete_size), - ed(new int[2*current_vertices]), pts(new double[2*current_vertices]), - ds(new int[current_delete_size]), stacke(ds+current_delete_size) { -} - -/** The voronoicell_2d destructor deallocates all of the dynamic memory. */ -voronoicell_base_2d::~voronoicell_base_2d() { - delete [] ds; - delete [] pts; - delete [] ed; -} - -/** Initializes a Voronoi cell as a rectangle with the given dimensions. - * \param[in] (xmin,xmax) the minimum and maximum x coordinates. - * \param[in] (ymin,ymax) the minimum and maximum y coordinates. */ -void voronoicell_base_2d::init_base(double xmin,double xmax,double ymin,double ymax) { - p=4;xmin*=2;xmax*=2;ymin*=2;ymax*=2; - *pts=xmin;pts[1]=ymin; - pts[2]=xmax;pts[3]=ymin; - pts[4]=xmax;pts[5]=ymax; - pts[6]=xmin;pts[7]=ymax; - int *q=ed; - *q=1;q[1]=3;q[2]=2;q[3]=0;q[4]=3;q[5]=1;q[6]=0;q[7]=2; -} - -/** Outputs the edges of the Voronoi cell in gnuplot format to an output - * stream. - * \param[in] (x,y) a displacement vector to be added to the cell's position. - * \param[in] fp the file handle to write to. */ -void voronoicell_base_2d::draw_gnuplot(double x,double y,FILE *fp) { - if(p==0) return; - int k=0; - do { - fprintf(fp,"%g %g\n",x+0.5*pts[2*k],y+0.5*pts[2*k+1]); - k=ed[2*k]; - } while (k!=0); - fprintf(fp,"%g %g\n\n",x+0.5*pts[0],y+0.5*pts[1]); -} - -/** Outputs the edges of the Voronoi cell in POV-Ray format to an open file - * stream, displacing the cell by given vector. - * \param[in] (x,y) a displacement vector to be added to the cell's position. - * \param[in] fp the file handle to write to. */ -void voronoicell_base_2d::draw_pov(double x,double y,FILE *fp) { - if(p==0) return; - int k=0; - do { - fprintf(fp,"sphere{<%g,%g,0>,r}\ncylinder{<%g,%g,0>,<" - ,x+0.5*pts[2*k],y+0.5*pts[2*k+1] - ,x+0.5*pts[2*k],y+0.5*pts[2*k+1]); - k=ed[2*k]; - fprintf(fp,"%g,%g,0>,r}\n",x+0.5*pts[2*k],y+0.5*pts[2*k+1]); - } while (k!=0); -} - -/** Computes the maximum radius squared of a vertex from the center of the - * cell. It can be used to determine when enough particles have been testing an - * all planes that could cut the cell have been considered. - * \return The maximum radius squared of a vertex.*/ -double voronoicell_base_2d::max_radius_squared() { - double r,s,*ptsp(pts+2),*ptse(pts+2*p); - r=*pts*(*pts)+pts[1]*pts[1]; - while(ptspr) r=s; - } - return r; -} - -/** Cuts the Voronoi cell by a particle whose center is at a separation of - * (x,y) from the cell center. The value of rsq should be initially set to - * \f$x^2+y^2\f$. - * \param[in] (x,y) the normal vector to the plane. - * \param[in] rsq the distance along this vector of the plane. - * \return False if the plane cut deleted the cell entirely, true otherwise. */ -bool voronoicell_base_2d::plane_intersects(double x,double y,double rsq) { - int up=0,up2,up3; - double u,u2,u3; - - // First try and find a vertex that is within the cutting plane, if - // there is one. If one can't be found, then the cell is not cut by - // this plane and the routine immediately returns true. - u=pos(x,y,rsq,up); - if(uu3) { - while(u2 -bool voronoicell_base_2d::nplane(vc_class &vc,double x,double y,double rsq,int p_id) { - int up=0,up2,up3; - double u,u2,u3; - - // First try and find a vertex that is within the cutting plane, if - // there is one. If one can't be found, then the cell is not cut by - // this plane and the routine immediately returns true. - u=pos(x,y,rsq,up); - if(uu3) { - while(u2 -bool voronoicell_base_2d::nplane_cut(vc_class &vc,double x,double y,double rsq,int p_id,double u,int up) { - int cp,lp,up2,up3,*stackp=ds; - double fac,l,u2,u3; - - // Add this point to the delete stack, and search counter-clockwise to - // find additional points that need to be deleted. - *(stackp++)=up; - l=u;up2=ed[2*up]; - u2=pos(x,y,rsq,up2); - while(u2>tolerance) { - if(stackp==stacke) add_memory_ds(stackp); - *(stackp++)=up2; - up2=ed[2*up2]; - l=u2; - u2=pos(x,y,rsq,up2); - if(up2==up) return false; - } - - // Consider the first point that was found in the counter-clockwise - // direction that was not inside the cutting plane. If it lies on the - // cutting plane then do nothing. Otherwise, introduce a new vertex. - if(u2>-tolerance) cp=up2; - else { - if(p==current_vertices) add_memory_vertices(vc); - lp=ed[2*up2+1]; - fac=1/(u2-l); - pts[2*p]=(pts[2*lp]*u2-pts[2*up2]*l)*fac; - pts[2*p+1]=(pts[2*lp+1]*u2-pts[2*up2+1]*l)*fac; - vc.n_copy(p,lp); - ed[2*p]=up2; - ed[2*up2+1]=p; - cp=p++; - } - - // Search clockwise for additional points that need to be deleted - l=u;up3=ed[2*up+1];u3=pos(x,y,rsq,up3); - while(u3>tolerance) { - if(stackp==stacke) add_memory_ds(stackp); - *(stackp++)=up3; - up3=ed[2*up3+1]; - l=u3; - u3=pos(x,y,rsq,up3); - if(up3==up2) break; - } - - // Either adjust the existing vertex or create new one, and connect it - // with the vertex found on the previous search in the counter-clockwise - // direction - if(u3>tolerance) { - ed[2*cp+1]=up3; - ed[2*up3]=cp; - vc.n_set(up3,p_id); - } else { - if(p==current_vertices) add_memory_vertices(vc); - lp=ed[2*up3]; - fac=1/(u3-l); - pts[2*p]=(pts[2*lp]*u3-pts[2*up3]*l)*fac; - pts[2*p+1]=(pts[2*lp+1]*u3-pts[2*up3+1]*l)*fac; - ed[2*p]=cp; - ed[2*cp+1]=p; - vc.n_set(p,p_id); - ed[2*p+1]=up3; - ed[2*up3]=p++; - } - - // Mark points on the delete stack - for(int *sp=ds;spds) { - while(ed[2*--p]==-1); - up=*(--stackp); - if(up &v) { - v.resize(2*p); - double *ptsp=pts; - for(int i=0;i<2*p;i+=2) { - v[i]=*(ptsp++)*0.5; - v[i+1]=*(ptsp++)*0.5; - } -} - -/** Outputs the vertex vectors using the local coordinate system. - * \param[out] fp the file handle to write to. */ -void voronoicell_base_2d::output_vertices(FILE *fp) { - if(p>0) { - fprintf(fp,"(%g,%g)",*pts*0.5,pts[1]*0.5); - for(double *ptsp=pts+2;ptsp &v) { - v.resize(2*p); - double *ptsp=pts; - for(int i=0;i<2*p;i+=2) { - v[i]=x+*(ptsp++)*0.5; - v[i+1]=y+*(ptsp++)*0.5; - } -} - -/** Outputs the vertex vectors using the global coordinate system. - * \param[out] fp the file handle to write to. - * \param[in] (x,y,z) the position vector of the particle in the global - * coordinate system. */ -void voronoicell_base_2d::output_vertices(double x,double y,FILE *fp) { - if(p>0) { - fprintf(fp,"(%g,%g)",x+*pts*0.5,y+pts[1]*0.5); - for(double *ptsp=pts+2;ptsp &vd) { - if(p==0) {vd.clear();return;} - vd.resize(p); - int i=0,k=0,l;double dx,dy; - do { - l=ed[2*k]; - dx=pts[2*k]-pts[2*l]; - dy=pts[2*k+1]-pts[2*l+1]; - vd[i++]=sqrt(dx*dx+dy*dy); - k=l; - } while (k!=0); -} - -/** Calculates the perimeter of the Voronoi cell. - * \return A floating point number holding the calculated distance. */ -void voronoicell_base_2d::normals(vector &vd) { - if(p==0) {vd.clear();return;} - vd.resize(2*p); - int i=0,k=0,l;double dx,dy,nor; - do { - l=ed[2*k]; - dx=pts[2*k]-pts[2*l]; - dy=pts[2*k+1]-pts[2*l+1]; - nor=dx*dx+dy*dy; - if(nor>tolerance_sq) { - nor=1/sqrt(nor); - vd[i++]=dy*nor; - vd[i++]=-dx*nor; - } else { - vd[i++]=0; - vd[i++]=0; - } - k=l; - } while (k!=0); -} - -/** Calculates the area of the Voronoi cell. - * \return A floating point number holding the calculated distance. */ -double voronoicell_base_2d::area() { - if(p==0) return 0; - int k(*ed);double area=0,x=*pts,y=pts[1],dx1,dy1,dx2,dy2; - dx1=pts[2*k]-x;dy1=pts[2*k+1]-y; - k=ed[2*k]; - while(k!=0) { - dx2=pts[2*k]-x;dy2=pts[2*k+1]-y; - area+=dx1*dy2-dx2*dy1; - dx1=dx2;dy1=dy2; - k=ed[2*k]; - } - return 0.125*area; -} - -/** Calculates the centroid of the Voronoi cell. - * \param[out] (cx,cy) The coordinates of the centroid. */ -void voronoicell_base_2d::centroid(double &cx,double &cy) { - cx=cy=0; - static const double third=1/3.0; - if(p==0) return; - int k(*ed); - double area,tarea=0,x=*pts,y=pts[1],dx1,dy1,dx2,dy2; - dx1=pts[2*k]-x;dy1=pts[2*k+1]-y; - k=ed[2*k]; - while(k!=0) { - dx2=pts[2*k]-x;dy2=pts[2*k+1]-y; - area=dx1*dy2-dx2*dy1; - tarea+=area; - cx+=area*(dx1+dx2); - cy+=area*(dy1+dy2); - dx1=dx2;dy1=dy2; - k=ed[2*k]; - } - tarea=third/tarea; - cx=0.5*(x+cx*tarea); - cy=0.5*(y+cy*tarea); -} - -/** Computes the Voronoi cells for all particles in the container, and for each - * cell, outputs a line containing custom information about the cell structure. - * The output format is specified using an input string with control sequences - * similar to the standard C printf() routine. - * \param[in] format the format of the output lines, using control sequences to - * denote the different cell statistics. - * \param[in] i the ID of the particle associated with this Voronoi cell. - * \param[in] (x,y) the position of the particle associated with this Voronoi - * cell. - * \param[in] r a radius associated with the particle. - * \param[in] fp the file handle to write to. */ -void voronoicell_base_2d::output_custom(const char *format,int i,double x,double y,double r,FILE *fp) { - char *fmp(const_cast(format)); - vector vi; - vector vd; - while(*fmp!=0) { - if(*fmp=='%') { - fmp++; - switch(*fmp) { - - // Particle-related output - case 'i': fprintf(fp,"%d",i);break; - case 'x': fprintf(fp,"%g",x);break; - case 'y': fprintf(fp,"%g",y);break; - case 'q': fprintf(fp,"%g %g",x,y);break; - case 'r': fprintf(fp,"%g",r);break; - - // Vertex-related output - case 'w': fprintf(fp,"%d",p);break; - case 'p': output_vertices(fp);break; - case 'P': output_vertices(x,y,fp);break; - case 'm': fprintf(fp,"%g",0.25*max_radius_squared());break; - - // Edge-related output - case 'g': fprintf(fp,"%d",p);break; - case 'E': fprintf(fp,"%g",perimeter());break; - case 'e': edge_lengths(vd);voro_print_vector(vd,fp);break; - case 'l': normals(vd); - voro_print_positions_2d(vd,fp); - break; - case 'n': neighbors(vi); - voro_print_vector(vi,fp); - break; - - // Area-related output - case 'a': fprintf(fp,"%g",area());break; - case 'c': { - double cx,cy; - centroid(cx,cy); - fprintf(fp,"%g %g",cx,cy); - } break; - case 'C': { - double cx,cy; - centroid(cx,cy); - fprintf(fp,"%g %g",x+cx,y+cy); - } break; - - // End-of-string reached - case 0: fmp--;break; - - // The percent sign is not part of a - // control sequence - default: putc('%',fp);putc(*fmp,fp); - } - } else putc(*fmp,fp); - fmp++; - } - fputs("\n",fp); -} - -/** Doubles the storage for the vertices, by reallocating the pts and ed - * arrays. If the allocation exceeds the absolute maximum set in max_vertices, - * then the routine exits with a fatal error. */ -template -void voronoicell_base_2d::add_memory_vertices(vc_class &vc) { - double *ppe(pts+2*current_vertices); - int *ede(ed+2*current_vertices); - - // Double the memory allocation and check it is within range - current_vertices<<=1; - if(current_vertices>max_vertices) voro_fatal_error("Vertex memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=2 - fprintf(stderr,"Vertex memory scaled up to %d\n",current_vertices); -#endif - - // Copy the vertex positions - double *npts(new double[2*current_vertices]),*npp(npts),*pp(pts); - while(pp>1),*nep=ne,*nnep=nne; - while(nep &v) { - v.resize(p); - for(int i=0;imax_delete_size) voro_fatal_error("Delete stack 1 memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=2 - fprintf(stderr,"Delete stack 1 memory scaled up to %d\n",current_delete_size); -#endif - int *dsn(new int[current_delete_size]),*dsnp(dsn),*dsp(ds); - while(dsp -#include -#include -#include -using namespace std; - -#include "common.hh" -#include "config.hh" - -namespace voro { - -/** \brief A class encapsulating all the routines for storing and calculating a - * single Voronoi cell. */ -class voronoicell_base_2d { - public: - /** This holds the current size of the ed and pts arrays. If - * more vertices are created than can fit in these arrays, then - * they are dynamically extended using the add_memory_vertices - * routine. */ - int current_vertices; - /** This sets the size of the current delete stack. */ - int current_delete_size; - /** The total nuber of vertices in the current cell. */ - int p; - /** An array with size 2*current_vertices holding information - * about edge connections between vertices.*/ - int *ed; - /** An array with size 2*current_vertices for holding - * the positions of the vertices. */ - double *pts; - voronoicell_base_2d(); - ~voronoicell_base_2d(); - void init_base(double xmin,double xmax,double ymin,double ymax); - void draw_gnuplot(double x,double y,FILE *fp=stdout); - /** Outputs the edges of the Voronoi cell in gnuplot format to - * an output stream. - * \param[in] (x,y) a displacement vector to be added to the - * cell's position. - * \param[in] filename the file to write to. */ - inline void draw_gnuplot(double x,double y,const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_gnuplot(x,y,fp); - fclose(fp); - } - void draw_pov(double x,double y,FILE *fp=stdout); - /** Outputs the edges of the Voronoi cell in POV-Ray format to - * an open file stream, displacing the cell by given vector. - * \param[in] (x,y,z) a displacement vector to be added to the - * cell's position. - * \param[in] filename the file to write to. */ - inline void draw_pov(double x,double y,const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_pov(x,y,fp); - fclose(fp); - } - void output_custom(const char *format,int i,double x,double y,double r,FILE *fp=stdout); - /** Computes the Voronoi cells for all particles in the - * container, and for each cell, outputs a line containing - * custom information about the cell structure. The output - * format is specified using an input string with control - * sequences similar to the standard C printf() routine. - * \param[in] format the format of the output lines, using - * control sequences to denote the different - * cell statistics. - * \param[in] i the ID of the particle associated with this - * Voronoi cell. - * \param[in] (x,y) the position of the particle associated - * with this Voronoi cell. - * \param[in] r a radius associated with the particle. - * \param[in] filename the file to write to. */ - inline void output_custom(const char *format,int i,double x,double y,double r,const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - output_custom(format,i,x,y,r,fp); - fclose(fp); - } - template - bool nplane(vc_class &vc,double x,double y,double rs,int p_id); - template - bool nplane_cut(vc_class &vc,double x,double y,double rsq,int p_id,double u,int up); - bool plane_intersects(double x,double y,double rs); - inline bool plane_intersects_guess(double x,double y,double rs) { - return plane_intersects(x,y,rs); - } - double max_radius_squared(); - double perimeter(); - double area(); - void vertices(vector &v); - void output_vertices(FILE *fp=stdout); - void vertices(double x,double y,vector &v); - void output_vertices(double x,double y,FILE *fp=stdout); - void edge_lengths(vector &vd); - void normals(vector &vd); - void centroid(double &cx,double &cy); - virtual void neighbors(vector &v) {v.clear();} - protected: - /** Computes the distance of a Voronoi cell vertex to a plane. - * \param[in] (x,y) the normal vector to the plane. - * \param[in] rsq the distance along this vector of the plane. - * \param[in] qp the index of the vertex to consider. */ - inline double pos(double x,double y,double rsq,int qp) { - return x*pts[2*qp]+y*pts[2*qp+1]-rsq; - } - private: - template - void add_memory_vertices(vc_class &vc); - void add_memory_ds(int *&stackp); - /** The delete stack, used to store the vertices that are - * deleted during the plane cutting procedure. */ - int *ds; - /** A pointer to the end of the delete stack, used to detect - * when it is full. */ - int *stacke; -}; - -class voronoicell_2d : public voronoicell_base_2d { - public: - using voronoicell_base_2d::nplane; - inline bool nplane(double x,double y,double rs,int p_id) { - return nplane(*this,x,y,rs,0); - } - inline bool nplane(double x,double y,int p_id) { - double rs=x*x+y*y; - return nplane(*this,x,y,rs,0); - } - inline bool plane(double x,double y,double rs) { - return nplane(*this,x,y,rs,0); - } - inline bool plane(double x,double y) { - double rs=x*x+y*y; - return nplane(*this,x,y,rs,0); - } - inline void init(double xmin,double xmax,double ymin,double ymax) { - init_base(xmin,xmax,ymin,ymax); - } - private: - inline void n_add_memory_vertices() {} - inline void n_copy(int a,int b) {} - inline void n_set(int a,int id) {} - friend class voronoicell_base_2d; -}; - -class voronoicell_neighbor_2d : public voronoicell_base_2d { - public: - using voronoicell_base_2d::nplane; - int *ne; - voronoicell_neighbor_2d() : ne(new int[init_vertices]) {} - ~voronoicell_neighbor_2d() {delete [] ne;} - inline bool nplane(double x,double y,double rs,int p_id) { - return nplane(*this,x,y,rs,p_id); - } - inline bool nplane(double x,double y,int p_id) { - double rs=x*x+y*y; - return nplane(*this,x,y,rs,p_id); - } - inline bool plane(double x,double y,double rs) { - return nplane(*this,x,y,rs,0); - } - inline bool plane(double x,double y) { - double rs=x*x+y*y; - return nplane(*this,x,y,rs,0); - } - void init(double xmin,double xmax,double ymin,double ymax); - virtual void neighbors(vector &v); - private: - inline void n_add_memory_vertices(); - inline void n_copy(int a,int b) {ne[a]=ne[b];} - inline void n_set(int a,int id) {ne[a]=id;} - friend class voronoicell_base_2d; -}; - -} -#endif diff -Nru voro++-0.5/2d/src/cell_nc_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cell_nc_2d.cc --- voro++-0.5/2d/src/cell_nc_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cell_nc_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -// Voro++, a cell-based Voronoi library -// -// Authors : Chris H. Rycroft (LBL / UC Berkeley) -// Cody Robert Dance (UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file cell_nc_2d.cc - * \brief Function implementations for the non-convex 2D Voronoi classes. */ - -#include "cell_nc_2d.hh" - -namespace voro { - -void voronoicell_nonconvex_neighbor_2d::init(double xmin,double xmax,double ymin,double ymax) { - nonconvex=exclude=false; - init_base(xmin,xmax,ymin,ymax); - *ne=-3;ne[1]=-2;ne[2]=-4;ne[3]=-1; -} - -void voronoicell_nonconvex_base_2d::init_nonconvex_base(double xmin,double xmax,double ymin,double ymax,double wx0,double wy0,double wx1,double wy1) { - xmin*=2;xmax*=2;ymin*=2;ymax*=2; - int f0=face(xmin,xmax,ymin,ymax,wx0,wy0), - f1=face(xmin,xmax,ymin,ymax,wx1,wy1); - - *pts=0;pts[1]=0; - pts[2]=wx0;pts[3]=wy0;p=4; - if(f0!=f1||wx0*wy11) { - if(f0==2) {pts[p++]=xmin;pts[p++]=ymin;} - else {pts[p++]=xmax;pts[p++]=ymin;} - } else { - if(f0==0) {pts[p++]=xmax;pts[p++]=ymax;} - else {pts[p++]=xmin;pts[p++]=ymax;} - } - f0++;f0&=3; - } while(f0!=f1); - } - pts[p++]=wx1;pts[p++]=wy1; - p>>=1; - - int i,*q=ed; - *(q++)=1;*(q++)=p-1; - for(i=1;iwx1*wy0) nonconvex=false; - else { - nonconvex=true; - if(wx0*wx1+wy0*wy1>0) { - *reg=wy0+wy1;reg[1]=-wx0-wx1; - } else { - *reg=wx1-wx0;reg[1]=wy1-wy0; - } - } - reg[2]=wx0;reg[3]=wy0; - reg[4]=wx1;reg[5]=wy1; -} - -void voronoicell_nonconvex_neighbor_2d::init_nonconvex(double xmin,double xmax,double ymin,double ymax,double wx0,double wy0,double wx1,double wy1) { - init_nonconvex_base(xmin,xmax,ymin,ymax,wx0,wy0,wx1,wy1); - *ne=-5; - for(int i=1;i -bool voronoicell_nonconvex_base_2d::nplane_nonconvex(vc_class &vc,double x,double y,double rsq,int p_id) { - int up=0,*edd; - double u,rx,ry,sx,sy; - - if(x*(*reg)+y*reg[1]<0) {edd=ed;rx=reg[2];ry=reg[3];sx=*reg;sy=reg[1];} - else {edd=ed+1;rx=reg[4];ry=reg[5];sx=-*reg;sy=-reg[1];} - - up=*edd;u=pos(x,y,rsq,up); - while(u0&&rx*pts[2*up]+ry*pts[2*up+1]>0) return true; - u=pos(x,y,rsq,up); - } - - return nplane_cut(vc,x,y,rsq,p_id,u,up); -} - -inline int voronoicell_nonconvex_base_2d::face(double xmin,double xmax,double ymin,double ymax,double &wx,double &wy) { - if(wy>0) { - if(xmin*wy>ymax*wx) {wy*=xmin/wx;wx=xmin;return 2;} - if(xmax*wy>ymax*wx) {wx*=ymax/wy;wy=ymax;return 1;} - wy*=xmax/wx;wx=xmax;return 0; - } - if(xmax*wy>ymin*wx) {wy*=xmax/wx;wx=xmax;return 0;} - if(xmin*wy>ymin*wx) {wx*=ymin/wy;wy=ymin;return 3;} - wy*=xmin/wx;wx=xmin;return 2; -} - -void voronoicell_nonconvex_neighbor_2d::neighbors(vector &v) { - v.resize(p); - for(int i=0;i - inline bool nplane_base(vc_class &vc,double x,double y,double rs,int p_id) { - return exclude?(nonconvex? - (-x*reg[3]+y*reg[2]<-tolerance&&x*reg[5]-y*reg[4]<-tolerance)||nplane_nonconvex(vc,x,y,rs,p_id): - -x*reg[3]+y*reg[2]<-tolerance||x*reg[5]-y*reg[4]<-tolerance||nplane(vc,x,y,rs,p_id)): - nplane(vc,x,y,rs,p_id); - } - template - bool nplane_nonconvex(vc_class &vc,double x,double y,double rs,int p_id); - void init_nonconvex_base(double xmin,double xmax,double ymin,double ymax,double wx0,double wy0,double wx1,double wy1); - private: - double reg[6]; - inline int face(double xmin,double xmax,double ymin,double ymax,double &wx,double &wy); -}; - -class voronoicell_nonconvex_2d : public voronoicell_nonconvex_base_2d { - public: - inline bool nplane(double x,double y,double rs,int p_id) { - return nplane_base(*this,x,y,rs,0); - } - inline bool nplane(double x,double y,int p_id) { - double rs=x*x+y*y; - return nplane(x,y,rs,0); - } - inline bool plane(double x,double y,double rs) { - return nplane(x,y,rs,0); - } - inline bool plane(double x,double y) { - double rs=x*x+y*y; - return nplane(x,y,rs,0); - } - inline void init(double xmin,double xmax,double ymin,double ymax) { - nonconvex=exclude=false; - init_base(xmin,xmax,ymin,ymax); - } - inline void init_nonconvex(double xmin,double xmax,double ymin,double ymax,double wx0,double wy0,double wx1,double wy1) { - init_nonconvex_base(xmin,xmax,ymin,ymax,wx0,wy0,wx1,wy1); - } - private: - inline void n_add_memory_vertices() {} - inline void n_copy(int a,int b) {} - inline void n_set(int a,int id) {} - friend class voronoicell_base_2d; -}; - -class voronoicell_nonconvex_neighbor_2d : public voronoicell_nonconvex_base_2d { - public: - int *ne; - voronoicell_nonconvex_neighbor_2d() : ne(new int[init_vertices]) {} - ~voronoicell_nonconvex_neighbor_2d() {delete [] ne;} - inline bool nplane(double x,double y,double rs,int p_id) { - return nplane_base(*this,x,y,rs,p_id); - } - inline bool nplane(double x,double y,int p_id) { - double rs=x*x+y*y; - return nplane(x,y,rs,p_id); - } - inline bool plane(double x,double y,double rs) { - return nplane(x,y,rs,0); - } - inline bool plane(double x,double y) { - double rs=x*x+y*y; - return nplane(x,y,rs,0); - } - void init(double xmin,double xmax,double ymin,double ymax); - void init_nonconvex(double xmin,double xmax,double ymin,double ymax,double wx0,double wy0,double wx1,double wy1); - virtual void neighbors(vector &v); - private: - inline void n_add_memory_vertices() { - int *nne=new int[current_vertices], - *nee=ne+(current_vertices>>1), - *nep=ne,*nnep=nne; - while(nep=nx) {bi=nx-1;if(ai>=nx) ai=nx-1;} - } - if(!yperiodic) { - if(aj<0) {aj=0;if(bj<0) bj=0;} - if(bj>=ny) {bj=ny-1;if(aj>=ny) aj=ny-1;} - } - ci=ai;cj=aj; - di=i=step_mod(ci,nx);apx=px=step_div(ci,nx)*sx; - dj=j=step_mod(cj,ny);apy=py=step_div(cj,ny)*sy; - inc1=nx+di-step_mod(bi,nx); - ij=di+nx*dj; - q=0; -} - -/** Starts the loop by finding the first particle within the container to - * consider. - * \return True if there is any particle to consider, false otherwise. */ -bool c_loop_subset_2d::start() { - while(co[ij]==0) {if(!next_block()) return false;} - while(mode!=no_check&&out_of_bounds()) { - q++; - while(q>=co[ij]) {q=0;if(!next_block()) return false;} - } - return true; -} - -/** Initializes the class to loop over all particles in a rectangular box. - * \param[in] (xmin,xmax) the minimum and maximum x coordinates of the box. - * \param[in] (ymin,ymax) the minimum and maximum y coordinates of the box. - * \param[in] bounds_test whether to do detailed bounds checking. If this is - * false then the class will loop over all particles in - * blocks that overlap the given box. If it is true, the - * particle will only loop over the particles which - * actually lie within the box. - * \return True if there is any valid point to loop over, false otherwise. */ -void c_loop_subset_2d::setup_box(double xmin,double xmax,double ymin,double ymax,bool bounds_test) { - if(bounds_test) {mode=rectangle;v0=xmin;v1=xmax;v2=ymin;v3=ymax;} else mode=no_check; - ai=step_int((xmin-ax)*xsp); - bi=step_int((xmax-ax)*xsp); - aj=step_int((ymin-ay)*ysp); - bj=step_int((ymax-ay)*ysp); - setup_common(); -} - -/** Computes whether the current point is out of bounds, relative to the - * current loop setup. - * \return True if the point is out of bounds, false otherwise. */ -bool c_loop_subset_2d::out_of_bounds() { - double *pp(p[ij]+ps*q); - if(mode==circle) { - double fx(*pp+px-v0),fy(pp[1]+py-v1); - return fx*fx+fy*fy>v2; - } else { - double f(*pp+px);if(fv1) return true; - f=pp[1]+py;return fv3; - } -} - -/** Returns the next block to be tested in a loop, and updates the periodicity - * vector if necessary. */ -bool c_loop_subset_2d::next_block() { - if(i -#include -#include -#include -using namespace std; - -#include "config.hh" - -namespace voro { - -/** A type associated with a c_loop_subset_2d class, determining what type of - * geometrical region to loop over. */ -enum c_loop_subset_mode_2d { - circle, - rectangle, - no_check -}; - -/** \brief A class for storing ordering information when particles are added to - * a container. - * - * When particles are added to a container class, they are sorted into an - * internal computational grid of blocks. The particle_order class provides a - * mechanism for remembering which block particles were sorted into. The import - * and put routines in the container class have variants that also take a - * particle_order class. Each time they are called, they will store the block - * that the particle was sorted into, plus the position of the particle within - * the block. The particle_order class can used by the c_loop_order class to - * specifically loop over the particles that have their information stored - * within it. */ -class particle_order { - public: - /** A pointer to the array holding the ordering. */ - int *o; - /** A pointer to the next position in the ordering array in - * which to store an entry. */ - int *op; - /** The current memory allocation for the class, set to the - * number of entries which can be stored. */ - int size; - /** The particle_order constructor allocates memory to store the - * ordering information. - * \param[in] init_size the initial amount of memory to - * allocate. */ - particle_order(int init_size=init_ordering_size) - : o(new int[init_size<<1]),op(o),size(init_size) {} - /** The particle_order destructor frees the dynamically allocated - * memory used to store the ordering information. */ - ~particle_order() { - delete [] o; - } - /** Adds a record to the order, corresponding to the memory - * address of where a particle was placed into the container. - * \param[in] ijk the block into which the particle was placed. - * \param[in] q the position within the block where the - * particle was placed. */ - inline void add(int ijk,int q) { - if(op==o+size) add_ordering_memory(); - *(op++)=ijk;*(op++)=q; - } - private: - void add_ordering_memory(); -}; - -/** \brief Base class for looping over particles in a container. - * - * This class forms the base of all classes that can loop over a subset of - * particles in a contaner in some order. When initialized, it stores constants - * about the corresponding container geometry. It also contains a number of - * routines for interrogating which particle currently being considered by the - * loop, which are common between all of the derived classes. */ -class c_loop_base_2d { - public: - /** The number of blocks in the x direction. */ - const int nx; - /** The number of blocks in the y direction. */ - const int ny; - /** A constant, set to the value of nx multiplied by ny, which - * is used in the routines that step through blocks in - * sequence. */ - const int nxy; - /** The number of floating point numbers per particle in the - * associated container data structure. */ - const int ps; - /** A pointer to the particle position information in the - * associated container data structure. */ - double **p; - /** A pointer to the particle ID information in the associated - * container data structure. */ - int **id; - /** A pointer to the particle counts in the associated - * container data structure. */ - int *co; - /** The current x-index of the block under consideration by the - * loop. */ - int i; - /** The current y-index of the block under consideration by the - * loop. */ - int j; - /** The current index of the block under consideration by the - * loop. */ - int ij; - /** The index of the particle under consideration within the current - * block. */ - int q; - /** The constructor copies several necessary constants from the - * base container class. - * \param[in] con the container class to use. */ - template - c_loop_base_2d(c_class_2d &con) : nx(con.nx), ny(con.ny), nxy(con.nxy), - ps(con.ps), p(con.p), id(con.id), - co(con.co) {} - /** Returns the position vector of the particle currently being - * considered by the loop. - * \param[out] (x,y) the position vector of the particle. */ - inline void pos(double &x,double &y) { - double *pp=p[ij]+ps*q; - x=*(pp++);y=*pp; - } - /** Returns the ID, position vector, and radius of the particle - * currently being considered by the loop. - * \param[out] pid the particle ID. - * \param[out] (x,y) the position vector of the particle. - * \param[out] r the radius of the particle. If no radius - * information is available the default radius - * value is returned. */ - inline void pos(int &pid,double &x,double &y,double &r) { - pid=id[ij][q]; - double *pp=p[ij]+ps*q; - x=*(pp++);y=*pp; - r=ps==2?default_radius_2d:*(++pp); - } - /** Returns the x position of the particle currently being - * considered by the loop. */ - inline double x() {return p[ij][ps*q];} - /** Returns the y position of the particle currently being - * considered by the loop. */ - inline double y() {return p[ij][ps*q+1];} - /** Returns the ID of the particle currently being considered - * by the loop. */ - inline int pid() {return id[ij][q];} -}; - -/** \brief Class for looping over all of the particles in a container. - * - * This is one of the simplest loop classes, that scans the computational - * blocks in order, and scans all the particles within each block in order. */ -class c_loop_all_2d : public c_loop_base_2d { - public: - /** The constructor copies several necessary constants from the - * base container class. - * \param[in] con the container class to use. */ - template - c_loop_all_2d(c_class_2d &con) : c_loop_base_2d(con) {} - /** Sets the class to consider the first particle. - * \return True if there is any particle to consider, false - * otherwise. */ - inline bool start() { - i=j=ij=q=0; - while(co[ij]==0) if(!next_block()) return false; - return true; - } - /** Finds the next particle to test. - * \return True if there is another particle, false if no more - * particles are available. */ - inline bool inc() { - q++; - if(q>=co[ij]) { - q=0; - do { - if(!next_block()) return false; - } while(co[ij]==0); - } - return true; - } - private: - /** Updates the internal variables to find the next - * computational block with any particles. - * \return True if another block is found, false if there are - * no more blocks. */ - inline bool next_block() { - ij++; - i++; - if(i==nx) { - i=0;j++; - if(j==ny) return false; - } - return true; - } -}; - -/** \brief Class for looping over a subset of particles in a container. - * - * This class can loop over a subset of particles in a certain geometrical - * region within the container. The class can be set up to loop over a - * rectangle or circle. It can also rectangular group of internal computational - * blocks. */ -class c_loop_subset_2d : public c_loop_base_2d { - public: - /** The current mode of operation, determining whether tests - * should be applied to particles to ensure they are within a - * certain geometrical object. */ - c_loop_subset_mode_2d mode; - /** The constructor copies several necessary constants from the - * base container class. - * \param[in] con the container class to use. */ - template - c_loop_subset_2d(c_class_2d &con) : c_loop_base_2d(con), ax(con.ax), ay(con.ay), - sx(con.bx-ax), sy(con.by-ay), xsp(con.xsp), ysp(con.ysp), - xperiodic(con.xperiodic), yperiodic(con.yperiodic) {} - void setup_circle(double vx,double vy,double r,bool bounds_test=true); - void setup_box(double xmin,double xmax,double ymin,double ymax,bool bounds_test=true); - void setup_intbox(int ai_,int bi_,int aj_,int bj_); - bool start(); - /** Finds the next particle to test. - * \return True if there is another particle, false if no more - * particles are available. */ - inline bool inc() { - do { - q++; - while(q>=co[ij]) {q=0;if(!next_block()) return false;} - } while(mode!=no_check&&out_of_bounds()); - return true; - } - private: - const double ax,ay,sx,sy,xsp,ysp; - const bool xperiodic,yperiodic; - double px,py,apx,apy; - double v0,v1,v2,v3; - int ai,bi,aj,bj; - int ci,cj,di,dj,inc1; - inline int step_mod(int a,int b) {return a>=0?a%b:b-1-(b-1-a)%b;} - inline int step_div(int a,int b) {return a>=0?a/b:-1+(a+1)/b;} - inline int step_int(double a) {return a<0?int(a)-1:int(a);} - void setup_common(); - bool next_block(); - bool out_of_bounds(); -}; - -/** \brief Class for looping over all of the particles specified in a - * pre-assembled particle_order class. - * - * The particle_order class can be used to create a specific order of particles - * within the container. This class can then loop over these particles in this - * order. The class is particularly useful in cases where the ordering of the - * output must match the ordering of particles as they were inserted into the - * container. */ -class c_loop_order_2d : public c_loop_base_2d { - public: - /** A reference to the ordering class to use. */ - particle_order &vo; - /** A pointer to the current position in the ordering class. */ - int *cp; - /** A pointer to the end position in the ordering class. */ - int *op; - /** The constructor copies several necessary constants from the - * base class, and sets up a reference to the ordering class to - * use. - * \param[in] con the container class to use. - * \param[in] vo_ the ordering class to use. */ - template - c_loop_order_2d(c_class_2d &con,particle_order &vo_) - : c_loop_base_2d(con), vo(vo_), nx(con.nx) {} - /** Sets the class to consider the first particle. - * \return True if there is any particle to consider, false - * otherwise. */ - inline bool start() { - cp=vo.o;op=vo.op; - if(cp!=op) { - ij=*(cp++);decode(); - q=*(cp++); - return true; - } else return false; - } - /** Finds the next particle to test. - * \return True if there is another particle, false if no more - * particles are available. */ - inline bool inc() { - if(cp==op) return false; - ij=*(cp++);decode(); - q=*(cp++); - return true; - } - private: - /** The number of computational blocks in the x direction. */ - const int nx; - /** Takes the current block index and computes indices in the - * x, y directions. */ - inline void decode() { - j=ij/nx; - i=ij-j*nx; - } -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/common.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/common.cc --- voro++-0.5/2d/src/common.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/common.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : May 18th 2011 - -/** \file common.cc - * \brief Implementations of the small helper functions. */ - -#include "common.hh" - -namespace voro { - -/** \brief Prints a vector of integers. - * - * Prints a vector of integers. - * \param[in] v the vector to print. - * \param[in] fp the file stream to print to. */ -void voro_print_vector(std::vector &v,FILE *fp) { - int k(0),s(v.size()); - while(k+4 &v,FILE *fp) { - int k(0),s(v.size()); - while(k+4 -#include -#include - -#include "config.hh" - -namespace voro { - -/** \brief Function for printing fatal error messages and exiting. - * - * Function for printing fatal error messages and exiting. - * \param[in] p a pointer to the message to print. - * \param[in] status the status code to return with. */ -inline void voro_fatal_error(const char *p,int status) { - fprintf(stderr,"voro++: %s\n",p); - exit(status); -} - -/** \brief Prints a vector of 2D positions. - * - * Prints a vector of positions as bracketed triplets. - * \param[in] v the vector to print. - * \param[in] fp the file stream to print to. */ -inline void voro_print_positions_2d(std::vector &v,FILE *fp=stdout) { - if(v.size()>0) { - fprintf(fp,"(%g,%g)",v[0],v[1]); - for(int k=2;(unsigned int) k &v,FILE *fp=stdout) { - if(v.size()>0) { - fprintf(fp,"(%g,%g,%g)",v[0],v[1],v[2]); - for(int k=3;(unsigned int) k &v,FILE *fp=stdout); -void voro_print_vector(std::vector &v,FILE *fp=stdout); - -} - -#endif diff -Nru voro++-0.5/2d/src/config.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/config.hh --- voro++-0.5/2d/src/config.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/config.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -/** \file config.hh - * \brief Master configuration file for setting various compile-time options. */ - -#ifndef VOROPP_CONFIG_HH -#define VOROPP_CONFIG_HH - -// These constants set the initial memory allocation for the Voronoi cell -/** The initial memory allocation for the number of vertices. */ -const int init_vertices=256; -/** The initial size for the delete stack. */ -const int init_delete_size=256; -/** The default initial size for the ordering class. */ -const int init_ordering_size=4096; - -const int init_boundary_size=256; -const int init_wall_tag_size=6; -const int init_wall_size=32; -const int init_temp_label_size=256; - -const int max_boundary_size=1048576; -const int max_wall_tag_size=65536; -const int max_wall_size=4096; -const int max_temp_label_size=16777216; - -const double large_number=1e30; - -// If the initial memory is too small, the program dynamically allocates more. -// However, if the limits below are reached, then the program bails out. -/** The maximum memory allocation for the number of vertices. */ -const int max_vertices=16777216; -/** The maximum size for the delete stack. */ -const int max_delete_size=16777216; - -/** The maximum amount of particle memory allocated for a single region. */ -const int max_particle_memory_2d=16777216; - -#ifndef VOROPP_VERBOSE -/** Voro++ can print a number of different status and debugging messages to - * notify the user of special behavior, and this macro sets the amount which - * are displayed. At level 0, no messages are printed. At level 1, messages - * about unusual cases during cell construction are printed, such as when the - * plane routine bails out due to floating point problems. At level 2, general - * messages about memory expansion are printed. At level 3, technical details - * about memory management are printed. */ -#define VOROPP_VERBOSE 2 -#endif - -/** A radius to use as a placeholder when no other information is available. */ -const double default_radius=0.5; - -/** A radius to use as a placeholder when no other information is available. */ -const double default_radius_2d=0.5; - -/** If a point is within this distance of a cutting plane, then the code - * assumes that point exactly lies on the plane. */ -const double tolerance=1e-10; - -const double tolerance_sq=1e-20; - -/** If this is set to 1, then the code reports any instances of particles being - * put outside of the container geometry. */ -#define VOROPP_REPORT_OUT_OF_BOUNDS 0 - -/** Voro++ returns this status code if there is a file-related error, such as - * not being able to open file. */ -#define VOROPP_FILE_ERROR 1 - -/** Voro++ returns this status code if there is a memory allocation error, if - * one of the safe memory limits is exceeded. */ -#define VOROPP_MEMORY_ERROR 2 - -/** Voro++ returns this status code if there is any type of internal error, if - * it detects that representation of the Voronoi cell is inconsistent. This - * status code will generally indicate a bug, and the developer should be - * contacted. */ -#define VOROPP_INTERNAL_ERROR 3 - -/** Voro++ returns this status code if it could not interpret the command line - * arguments passed to the command line utility. */ -#define VOROPP_CMD_LINE_ERROR 4 - -#endif diff -Nru voro++-0.5/2d/src/container_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/container_2d.cc --- voro++-0.5/2d/src/container_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/container_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,517 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file container_2d.cc - * \brief Function implementations for the container_2d and related classes. */ - -#include "container_2d.hh" - -namespace voro { - -/** The class constructor sets up the geometry of container, initializing the - * minimum and maximum coordinates in each direction, and setting whether each - * direction is periodic or not. It divides the container into a rectangular - * grid of blocks, and allocates memory for each of these for storing particle - * positions and IDs. - * \param[in] (ax_,bx_) the minimum and maximum x coordinates. - * \param[in] (ay_,by_) the minimum and maximum y coordinates. - * \param[in] (nx_,ny_) the number of grid blocks in each of the three - * coordinate directions. - * \param[in] (xperiodic_,yperiodic_) flags setting whether the container is - * periodic in each coordinate direction. - * \param[in] init_mem the initial memory allocation for each block. - * \param[in] ps_ the number of floating point entries to store for each - * particle. */ -container_base_2d::container_base_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem,int ps_) - : voro_base_2d(nx_,ny_,(bx_-ax_)/nx_,(by_-ay_)/ny_), - ax(ax_), bx(bx_), ay(ay_), by(by_), xperiodic(xperiodic_), yperiodic(yperiodic_), - id(new int*[nxy]), p(new double*[nxy]), co(new int[nxy]), mem(new int[nxy]), ps(ps_) { - int l; - //totpar=0; - for(l=0;l=0;l--) delete [] p[l]; - for(l=nxy-1;l>=0;l--) delete [] id[l]; - delete [] id; - delete [] p; - delete [] co; - delete [] mem; -} - -/** The class constructor sets up the geometry of container. - * \param[in] (ax_,bx_) the minimum and maximum x coordinates. - * \param[in] (ay_,by_) the minimum and maximum y coordinates. - * \param[in] (nx_,ny_) the number of grid blocks in each of the three - * coordinate directions. - * \param[in] (xperiodic_,yperiodic_) flags setting whether the container is - * periodic in each coordinate direction. - * \param[in] init_mem the initial memory allocation for each block. */ -container_2d::container_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem) - : container_base_2d(ax_,bx_,ay_,by_,nx_,ny_,xperiodic_,yperiodic_,init_mem,2), - vc(*this,xperiodic_?2*nx_+1:nx_,yperiodic_?2*ny_+1:ny_) {} - -/** The class constructor sets up the geometry of container. - * \param[in] (ax_,bx_) the minimum and maximum x coordinates. - * \param[in] (ay_,by_) the minimum and maximum y coordinates. - * \param[in] (nx_,ny_) the number of grid blocks in each of the three - * coordinate directions. - * \param[in] (xperiodic_,yperiodic_) flags setting whether the container is - * periodic in each coordinate direction. - * \param[in] init_mem the initial memory allocation for each block. */ -container_poly_2d::container_poly_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem) - : container_base_2d(ax_,bx_,ay_,by_,nx_,ny_,xperiodic_,yperiodic_,init_mem,3), - vc(*this,xperiodic_?2*nx_+1:nx_,yperiodic_?2*ny_+1:ny_) {ppr=p;} - -/** Put a particle into the correct region of the container. - * \param[in] n the numerical ID of the inserted particle. - * \param[in] (x,y) the position vector of the inserted particle. */ -void container_2d::put(int n,double x,double y) { - int ij; - if(put_locate_block(ij,x,y)) { - //totpar++; - id[ij][co[ij]]=n; - double *pp=p[ij]+2*co[ij]++; - *(pp++)=x;*pp=y; - } -} - -/** Put a particle into the correct region of the container. - * \param[in] n the numerical ID of the inserted particle. - * \param[in] (x,y) the position vector of the inserted particle. - * \param[in] r the radius of the particle. */ -void container_poly_2d::put(int n,double x,double y,double r) { - int ij; - if(put_locate_block(ij,x,y)) { - //totpar++; - id[ij][co[ij]]=n; - double *pp=p[ij]+3*co[ij]++; - *(pp++)=x;*(pp++)=y;*pp=r; - if(max_radius=nx) return false; - - int j=step_int((y-ay)*ysp); - if(yperiodic) {l=step_mod(j,ny);y+=boxy*(l-j);j=l;} - else if(j<0||j>=ny) return false; - - ij+=nx*j; - return true; -} - -/** Takes a position vector and attempts to remap it into the primary domain. - * \param[out] (ai,aj) the periodic image displacement that the vector is in, - * with (0,0,0) corresponding to the primary domain. - * \param[out] (ci,cj) the index of the block that the position vector is - * within, once it has been remapped. - * \param[in,out] (x,y) the position vector to consider, which is remapped into - * the primary domain during the routine. - * \param[out] ij the block index that the vector is within. - * \return True if the particle is within the container or can be remapped into - * it, false if it lies outside of the container bounds. */ -inline bool container_base_2d::remap(int &ai,int &aj,int &ci,int &cj,double &x,double &y,int &ij) { - ci=step_int((x-ax)*xsp); - if(ci<0||ci>=nx) { - if(xperiodic) {ai=step_div(ci,nx);x-=ai*(bx-ax);ci-=ai*nx;} - else return false; - } else ai=0; - - cj=step_int((y-ay)*ysp); - if(cj<0||cj>=ny) { - if(yperiodic) {aj=step_div(cj,ny);y-=aj*(by-ay);cj-=aj*ny;} - else return false; - } else aj=0; - - ij=ci+nx*cj; - return true; -} - -/** Takes a vector and finds the particle whose Voronoi cell contains that - * vector. This is equivalent to finding the particle which is nearest to the - * vector. Additional wall classes are not considered by this routine. - * \param[in] (x,y) the vector to test. - * \param[out] (rx,ry) the position of the particle whose Voronoi cell contains - * the vector. If the container is periodic, this may point - * to a particle in a periodic image of the primary domain. - * \param[out] pid the ID of the particle. - * \return True if a particle was found. If the container has no particles, - * then the search will not find a Voronoi cell and false is returned. */ -bool container_2d::find_voronoi_cell(double x,double y,double &rx,double &ry,int &pid) { - int ai,aj,ci,cj,ij; - particle_record_2d w; - double mrs; - - // If the given vector lies outside the domain, but the container - // is periodic, then remap it back into the domain - if(!remap(ai,aj,ci,cj,x,y,ij)) return false; - vc.find_voronoi_cell(x,y,ci,cj,ij,w,mrs); - - if(w.ij!=-1) { - - // Assemble the position vector of the particle to be returned, - // applying a periodic remapping if necessary - if(xperiodic) {ci+=w.di;if(ci<0||ci>=nx) ai+=step_div(ci,nx);} - if(yperiodic) {cj+=w.dj;if(cj<0||cj>=ny) aj+=step_div(cj,ny);} - rx=p[w.ij][2*w.l]+ai*(bx-ax); - ry=p[w.ij][2*w.l+1]+aj*(by-ay); - pid=id[w.ij][w.l]; - return true; - } - - // If no particle if found then just return false - return false; -} - -/** Takes a vector and finds the particle whose Voronoi cell contains that - * vector. Additional wall classes are not considered by this routine. - * \param[in] (x,y) the vector to test. - * \param[out] (rx,ry) the position of the particle whose Voronoi cell contains - * the vector. If the container is periodic, this may point - * to a particle in a periodic image of the primary domain. - * \param[out] pid the ID of the particle. - * \return True if a particle was found. If the container has no particles, - * then the search will not find a Voronoi cell and false is returned. */ -bool container_poly_2d::find_voronoi_cell(double x,double y,double &rx,double &ry,int &pid) { - int ai,aj,ci,cj,ij; - particle_record_2d w; - double mrs; - - // If the given vector lies outside the domain, but the container - // is periodic, then remap it back into the domain - if(!remap(ai,aj,ci,cj,x,y,ij)) return false; - vc.find_voronoi_cell(x,y,ci,cj,ij,w,mrs); - - if(w.ij!=-1) { - - // Assemble the position vector of the particle to be returned, - // applying a periodic remapping if necessary - if(xperiodic) {ci+=w.di;if(ci<0||ci>=nx) ai+=step_div(ci,nx);} - if(yperiodic) {cj+=w.dj;if(cj<0||cj>=ny) aj+=step_div(cj,ny);} - rx=p[w.ij][3*w.l]+ai*(bx-ax); - ry=p[w.ij][3*w.l+1]+aj*(by-ay); - pid=id[w.ij][w.l]; - return true; - } - - // If no particle if found then just return false - return false; -} - -/** Increase memory for a particular region. - * \param[in] i the index of the region to reallocate. */ -void container_base_2d::add_particle_memory(int i) { - int l,nmem=mem[i]<<1; - - // Carry out a check on the memory allocation size, and - // print a status message if requested - if(nmem>max_particle_memory_2d) - voro_fatal_error("Absolute maximum memory allocation exceeded",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=3 - fprintf(stderr,"Particle memory in region %d scaled up to %d\n",i,nmem); -#endif - - // Allocate new memory and copy in the contents of the old arrays - int *idp=new int[nmem]; - for(l=0;lbx||yby) return false; - return point_inside_walls(x,y); -} - -/** Draws an outline of the domain in gnuplot format. - * \param[in] fp the file handle to write to. */ -void container_base_2d::draw_domain_gnuplot(FILE *fp) { - fprintf(fp,"%g %g\n%g %g\n%g %g\n%g %g\n%g %g\n",ax,ay,bx,ay,bx,by,ax,by,ax,ay); -} - -/** Draws an outline of the domain in POV-Ray format. - * \param[in] fp the file handle to write to. */ -void container_base_2d::draw_domain_pov(FILE *fp) { - fprintf(fp,"cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n" - "cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n",ax,ay,bx,ay,ax,by,bx,by); - fprintf(fp,"cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n" - "cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n",ax,ay,ax,by,bx,ay,bx,by); - fprintf(fp,"sphere{<%g,%g,0>,rr}\nsphere{<%g,%g,0>,rr}\n" - "sphere{<%g,%g,0>,rr}\nsphere{<%g,%g,0>,rr}\n",ax,ay,bx,ay,ax,by,bx,by); -} - -/** The wall_list constructor sets up an array of pointers to wall classes. */ -wall_list_2d::wall_list_2d() : walls(new wall_2d*[init_wall_size]), wep(walls), wel(walls+init_wall_size), - current_wall_size(init_wall_size) {} - -/** The wall_list destructor frees the array of pointers to the wall classes. - */ -wall_list_2d::~wall_list_2d() { - delete [] walls; -} - -/** Adds all of the walls on another wall_list to this class. - * \param[in] wl a reference to the wall class. */ -void wall_list_2d::add_wall(wall_list_2d &wl) { - for(wall_2d **wp=wl.walls;wpmax_wall_size) - voro_fatal_error("Wall memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); - wall_2d **nwalls=new wall_2d*[current_wall_size],**nwp=nwalls,**wp=walls; - while(wp -#include -#include -#include -using namespace std; - -#include "config.hh" -#include "common.hh" -#include "v_base_2d.hh" -#include "cell_2d.hh" -#include "c_loops_2d.hh" -#include "rad_option.hh" -#include "v_compute_2d.hh" - -namespace voro { - -/** \brief Pure virtual class from which wall objects are derived. - * - * This is a pure virtual class for a generic wall object. A wall object - * can be specified by deriving a new class from this and specifying the - * functions.*/ -class wall_2d { - public: - virtual ~wall_2d() {}; - /** A pure virtual function for testing whether a point is - * inside the wall object. */ - virtual bool point_inside(double x,double y) = 0; - /** A pure virtual function for cutting a cell without - * neighbor-tracking with a wall. */ - virtual bool cut_cell(voronoicell_2d &c,double x,double y) = 0; - /** A pure virtual function for cutting a cell with - * neighbor-tracking enabled with a wall. */ - virtual bool cut_cell(voronoicell_neighbor_2d &c,double x,double y) = 0; -}; - -/** \brief A class for storing a list of pointers to walls. - * - * This class stores a list of pointers to wall classes. It contains several - * simple routines that make use of the wall classes (such as telling whether a - * given position is inside all of the walls or not). It can be used by itself, - * but also forms part of container_base, for associating walls with this - * class. */ -class wall_list_2d { - public: - /** An array holding pointers to wall objects. */ - wall_2d **walls; - /** A pointer to the next free position to add a wall pointer. - */ - wall_2d **wep; - wall_list_2d(); - ~wall_list_2d(); - /** Adds a wall to the list. - * \param[in] w the wall to add. */ - inline void add_wall(wall_2d *w) { - if(wep==wel) increase_wall_memory(); - *(wep++)=w; - } - /** Adds a wall to the list. - * \param[in] w a reference to the wall to add. */ - inline void add_wall(wall_2d &w) {add_wall(&w);} - void add_wall(wall_list_2d &wl); - /** Determines whether a given position is inside all of the - * walls on the list. - * \param[in] (x,y) the position to test. - * \return True if it is inside, false if it is outside. */ - inline bool point_inside_walls(double x,double y) { - for(wall_2d **wp=walls;wppoint_inside(x,y))) return false; - return true; - } - /** Cuts a Voronoi cell by all of the walls currently on - * the list. - * \param[in] c a reference to the Voronoi cell class. - * \param[in] (x,y) the position of the cell. - * \return True if the cell still exists, false if the cell is - * deleted. */ - template - bool apply_walls(c_class_2d &c,double x,double y) { - for(wall_2d **wp=walls;wpcut_cell(c,x,y))) return false; - return true; - } - void deallocate(); - protected: - void increase_wall_memory(); - /** A pointer to the limit of the walls array, used to - * determine when array is full. */ - wall_2d **wel; - /** The current amount of memory allocated for walls. */ - int current_wall_size; -}; - -/** \brief Class for representing a particle system in a three-dimensional - * rectangular box. - * - * This class represents a system of particles in a three-dimensional - * rectangular box. Any combination of non-periodic and periodic coordinates - * can be used in the three coordinate directions. The class is not intended - * for direct use, but instead forms the base of the container and - * container_poly classes that add specialized routines for computing the - * regular and radical Voronoi tessellations respectively. It contains routines - * that are commonly between these two classes, such as those for drawing the - * domain, and placing particles within the internal data structure. - * - * The class is derived from the wall_list class, which encapsulates routines - * for associating walls with the container, and the voro_base class, which - * encapsulates routines about the underlying computational grid. */ -class container_base_2d : public voro_base_2d, public wall_list_2d { - public: - /** The minimum x coordinate of the container. */ - const double ax; - /** The maximum x coordinate of the container. */ - const double bx; - /** The minimum y coordinate of the container. */ - const double ay; - /** The maximum y coordinate of the container. */ - const double by; - /** A boolean value that determines if the x coordinate in - * periodic or not. */ - const bool xperiodic; - /** A boolean value that determines if the y coordinate in - * periodic or not. */ - const bool yperiodic; - /** This array holds the numerical IDs of each particle in each - * computational box. */ - int **id; - /** A two dimensional array holding particle positions. For the - * derived container_poly class, this also holds particle - * radii. */ - double **p; - /** This array holds the number of particles within each - * computational box of the container. */ - int *co; - /** This array holds the maximum amount of particle memory for - * each computational box of the container. If the number of - * particles in a particular box ever approaches this limit, - * more is allocated using the add_particle_memory() function. - */ - int *mem; - /** The amount of memory in the array structure for each - * particle. This is set to 2 when the basic class is - * initialized, so that the array holds (x,y) positions. If the - * 2D container class is initialized as part of the derived class - * container_poly_2d, then this is set to 3, to also hold the - * particle radii. */ - const int ps; - container_base_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_, - int init_mem,int ps_); - ~container_base_2d(); - bool point_inside(double x,double y); - void region_count(); - inline bool skip(int ij,int l,double x,double y) {return false;} - template - inline bool boundary_cuts(v_cell_2d &c,int ij,double x,double y) {return true;} - /** Initializes the Voronoi cell prior to a compute_cell - * operation for a specific particle being carried out by a - * voro_compute class. The cell is initialized to fill the - * entire container. For non-periodic coordinates, this is set - * by the position of the walls. For periodic coordinates, the - * space is equally divided in either direction from the - * particle's initial position. Plane cuts made by any walls - * that have been added are then applied to the cell. - * \param[in,out] c a reference to a voronoicell_2d object. - * \param[in] ij the block that the particle is within. - * \param[in] q the index of the particle within its block. - * \param[in] (ci,cj) the coordinates of the block in the - * container coordinate system. - * \param[out] (i,j) the coordinates of the test block relative - * to the voro_compute coordinate system. - * \param[out] (x,y) the position of the particle. - * \param[out] disp a block displacement used internally by the - * compute_cell routine. - * \return False if the plane cuts applied by walls completely - * removed the cell, true otherwise. */ - template - inline bool initialize_voronoicell(v_cell_2d &c,int ij,int q,int ci,int cj, - int &i,int &j,double &x,double &y,int &disp) { - double x1,x2,y1,y2,*pp=p[ij]+ps*q; - x=*(pp++);y=*(pp++); - if(xperiodic) {x1=-(x2=0.5*(bx-ax));i=nx;} else {x1=ax-x;x2=bx-x;i=ci;} - if(yperiodic) {y1=-(y2=0.5*(by-ay));j=ny;} else {y1=ay-y;y2=by-y;j=cj;} - c.init(x1,x2,y1,y2); - if(!apply_walls(c,x,y)) return false; - disp=ij-i-nx*j; - return true; - } - /** Initializes parameters for a find_voronoi_cell call within - * the voro_compute template. - * \param[in] (ci,cj) the coordinates of the test block in - * the container coordinate system. - * \param[in] ij the index of the test block - * \param[out] (i,j) the coordinates of the test block relative - * to the voro_compute coordinate system. - * \param[out] disp a block displacement used internally by the - * find_voronoi_cell routine. */ - inline void initialize_search(int ci,int cj,int ij,int &i,int &j,int &disp) { - i=xperiodic?nx:ci; - j=yperiodic?ny:cj; - disp=ij-i-nx*j; - } - /** Returns the position of a particle currently being computed - * relative to the computational block that it is within. It is - * used to select the optimal worklist entry to use. - * \param[in] (x,y) the position of the particle. - * \param[in] (ci,cj) the block that the particle is within. - * \param[out] (fx,fy) the position relative to the block. - */ - inline void frac_pos(double x,double y,double ci,double cj, - double &fx,double &fy) { - fx=x-ax-boxx*ci; - fy=y-ay-boxy*cj; - } - /** Calculates the index of block in the container structure - * corresponding to given coordinates. - * \param[in] (ci,cj) the coordinates of the original block in - * the current computation, relative to the - * container coordinate system. - * \param[in] (ei,ej) the displacement of the current block - * from the original block. - * \param[in,out] (qx,qy) the periodic displacement that must - * be added to the particles within the - * computed block. - * \param[in] disp a block displacement used internally by the - * find_voronoi_cell and compute_cell routines. - * \return The block index. */ - inline int region_index(int ci,int cj,int ei,int ej,double &qx,double &qy,int &disp) { - if(xperiodic) {if(ci+ei=(nx<<1)) {ei-=nx;qx=bx-ax;} else qx=0;} - if(yperiodic) {if(cj+ej=(ny<<1)) {ej-=ny;qy=by-ay;} else qy=0;} - return disp+ei+nx*ej; - } - void draw_domain_gnuplot(FILE *fp=stdout); - /** Draws an outline of the domain in Gnuplot format. - * \param[in] filename the filename to write to. */ - inline void draw_domain_gnuplot(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_domain_gnuplot(fp); - fclose(fp); - } - void draw_domain_pov(FILE *fp=stdout); - /** Draws an outline of the domain in Gnuplot format. - * \param[in] filename the filename to write to. */ - inline void draw_domain_pov(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_domain_pov(fp); - fclose(fp); - } - /** Sums up the total number of stored particles. - * \return The number of particles. */ - inline int total_particles() { - int tp=*co; - for(int *cop=co+1;cop - void draw_particles(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+2*vl.q; - fprintf(fp,"%d %g %g\n",id[vl.ij][vl.q],*pp,pp[1]); - } while(vl.inc()); - } - /** Dumps all of the particle IDs and positions to a file. - * \param[in] fp a file handle to write to. */ - inline void draw_particles(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles(vl,fp); - } - /** Dumps all of the particle IDs and positions to a file. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles(fp); - fclose(fp); - } - /** Dumps particle positions in POV-Ray format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_particles_pov(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+2*vl.q; - fprintf(fp,"// id %d\nsphere{<%g,%g,0>,s}\n", - id[vl.ij][vl.q],*pp,pp[1]); - } while(vl.inc()); - } - /** Dumps all particle positions in POV-Ray format. - * \param[in] fp a file handle to write to. */ - inline void draw_particles_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles_pov(vl,fp); - } - /** Dumps all particle positions in POV-Ray format. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles_pov(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in gnuplot - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_gnuplot(c_loop_2d &vl,FILE *fp) { - voronoicell_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - pp=p[vl.ij]+ps*vl.q; - c.draw_gnuplot(*pp,pp[1],fp); - } while(vl.inc()); - } - /** Computes all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_gnuplot(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_gnuplot(vl,fp); - } - /** Computes all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_gnuplot(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_gnuplot(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_pov(c_loop_2d &vl,FILE *fp) { - voronoicell_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - fprintf(fp,"// cell %d\n",id[vl.ij][vl.q]); - pp=p[vl.ij]+ps*vl.q; - c.draw_pov(*pp,pp[1],fp); - } while(vl.inc()); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_pov(vl,fp); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_pov(fp); - fclose(fp); - } - /** Computes the Voronoi cells and saves customized information - * about them. - * \param[in] vl the loop class to use. - * \param[in] format the custom output string to use. - * \param[in] fp a file handle to write to. */ - template - void print_custom(c_loop_2d &vl,const char *format,FILE *fp) { - int ij,q;double *pp; - if(contains_neighbor(format)) { - voronoicell_neighbor_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - c.output_custom(format,id[ij][q],*pp,pp[1],default_radius_2d,fp); - } while(vl.inc()); - } else { - voronoicell_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - c.output_custom(format,id[ij][q],*pp,pp[1],default_radius_2d,fp); - } while(vl.inc()); - } - } - void print_custom(const char *format,FILE *fp=stdout); - void print_custom(const char *format,const char *filename); - bool find_voronoi_cell(double x,double y,double &rx,double &ry,int &pid); - /** Computes the Voronoi cell for a particle currently being - * referenced by a loop class. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] vl the loop class to use. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,c_loop_2d &vl) { - return vc.compute_cell(c,vl.ij,vl.q,vl.i,vl.j); - } - /** Computes the Voronoi cell for given particle. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] ij the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,int ij,int q) { - int j=ij/nx,i=ij-j*nx; - return vc.compute_cell(c,ij,q,i,j); - } - private: - voro_compute_2d vc; - friend class voro_compute_2d; -}; - -/** \brief Extension of the container_base class for computing radical Voronoi - * tessellations. - * - * This class is an extension of container_base class that has routines - * specifically for computing the radical Voronoi tessellation that depends on - * the particle radii. */ -class container_poly_2d : public container_base_2d, public radius_poly { - public: - container_poly_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem); - void clear(); - void put(int n,double x,double y,double r); - void put(particle_order &vo,int n,double x,double y,double r); - void import(FILE *fp=stdin); - void import(particle_order &vo,FILE *fp=stdin); - /** Imports a list of particles from an open file stream into - * the container_poly class. Entries of four numbers (Particle - * ID, x position, y position, radius) are searched for. If the - * file cannot be successfully read, then the routine causes a - * fatal error. - * \param[in] filename the name of the file to open and read - * from. */ - inline void import(const char* filename) { - FILE *fp=safe_fopen(filename,"r"); - import(fp); - fclose(fp); - } - /** Imports a list of particles from an open file stream into - * the container_poly class. Entries of four numbers (Particle - * ID, x position, y position, radius) are searched for. In - * addition, the order in which particles are read is saved - * into an ordering class. If the file cannot be successfully - * read, then the routine causes a fatal error. - * \param[in,out] vo the ordering class to use. - * \param[in] filename the name of the file to open and read - * from. */ - inline void import(particle_order &vo,const char* filename) { - FILE *fp=safe_fopen(filename,"r"); - import(vo,fp); - fclose(fp); - } - void compute_all_cells(); - double sum_cell_areas(); - /** Dumps particle IDs, positions and radii to a file. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_particles(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+3*vl.q; - fprintf(fp,"%d %g %g %g\n",id[vl.ij][vl.q],*pp,pp[1],pp[2]); - } while(vl.inc()); - } - /** Dumps all of the particle IDs, positions and radii to a - * file. - * \param[in] fp a file handle to write to. */ - inline void draw_particles(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles(vl,fp); - } - /** Dumps all of the particle IDs, positions and radii to a - * file. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles(fp); - fclose(fp); - } - /** Dumps particle positions in POV-Ray format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_particles_pov(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+3*vl.q; - fprintf(fp,"// id %d\nsphere{<%g,%g,0>,%g}\n", - id[vl.ij][vl.q],*pp,pp[1],pp[2]); - } while(vl.inc()); - } - /** Dumps all the particle positions in POV-Ray format. - * \param[in] fp a file handle to write to. */ - inline void draw_particles_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles_pov(vl,fp); - } - /** Dumps all the particle positions in POV-Ray format. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles_pov(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in gnuplot - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_gnuplot(c_loop_2d &vl,FILE *fp) { - voronoicell_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - pp=p[vl.ij]+ps*vl.q; - c.draw_gnuplot(*pp,pp[1],fp); - } while(vl.inc()); - } - /** Compute all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_gnuplot(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_gnuplot(vl,fp); - } - /** Compute all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_gnuplot(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_gnuplot(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_pov(c_loop_2d &vl,FILE *fp) { - voronoicell_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - fprintf(fp,"// cell %d\n",id[vl.ij][vl.q]); - pp=p[vl.ij]+ps*vl.q; - c.draw_pov(*pp,pp[1],fp); - } while(vl.inc()); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_pov(vl,fp); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_pov(fp); - fclose(fp); - } - /** Computes the Voronoi cells and saves customized information - * about them. - * \param[in] vl the loop class to use. - * \param[in] format the custom output string to use. - * \param[in] fp a file handle to write to. */ - template - void print_custom(c_loop_2d &vl,const char *format,FILE *fp) { - int ij,q;double *pp; - if(contains_neighbor(format)) { - voronoicell_neighbor_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - c.output_custom(format,id[ij][q],*pp,pp[1],pp[2],fp); - } while(vl.inc()); - } else { - voronoicell_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - c.output_custom(format,id[ij][q],*pp,pp[1],pp[2],fp); - } while(vl.inc()); - } - } - /** Computes the Voronoi cell for a particle currently being - * referenced by a loop class. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] vl the loop class to use. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,c_loop_2d &vl) { - return vc.compute_cell(c,vl.ij,vl.q,vl.i,vl.j); - } - /** Computes the Voronoi cell for given particle. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] ij the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,int ij,int q) { - int j=ij/nx,i=ij-j*nx; - return vc.compute_cell(c,ij,q,i,j); - } - void print_custom(const char *format,FILE *fp=stdout); - void print_custom(const char *format,const char *filename); - bool find_voronoi_cell(double x,double y,double &rx,double &ry,int &pid); - private: - voro_compute_2d vc; - friend class voro_compute_2d; -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/container_2d_old.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/container_2d_old.cc --- voro++-0.5/2d/src/container_2d_old.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/container_2d_old.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,352 +0,0 @@ -/** \file container_2d.cc - * \brief Function implementations for the container_2d class. */ - -#include "container_2d.hh" - -/** The class constructor sets up the geometry of container, initializing the - * minimum and maximum coordinates in each direction, and setting whether each - * direction is periodic or not. It divides the container into a rectangular - * grid of blocks, and allocates memory for each of these for storing particle - * positions and IDs. - * \param[in] (ax_,bx_) the minimum and maximum x coordinates. - * \param[in] (ay_,by_) the minimum and maximum y coordinates. - * \param[in] (nx_,ny_) the number of grid blocks in each of the three - * coordinate directions. - * \param[in] (xperiodic_,yperiodic_) flags setting whether the container is periodic - * in each coordinate direction. - * \param[in] init_mem the initial memory allocation for each block. */ -container_2d::container_2d(double ax_,double bx_,double ay_, - double by_,int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem) - : ax(ax_), bx(bx_), ay(ay_), by(by_), boxx((bx_-ax_)/nx_), boxy((by_-ay_)/ny_), - xsp(1/boxx), ysp(1/boxy), nx(nx_), ny(ny_), nxy(nx*ny), - xperiodic(xperiodic_), yperiodic(yperiodic_), - co(new int[nxy]), mem(new int[nxy]), id(new int*[nxy]), p(new double*[nxy]) { - int l; - for(l=0;l=0;l--) delete [] p[l]; - for(l=nxy-1;l>=0;l--) delete [] id[l]; - delete [] p; - delete [] id; - delete [] mem; - delete [] co; -} - -/** Put a particle into the correct region of the container. - * \param[in] n the numerical ID of the inserted particle. - * \param[in] (x,y) the position vector of the inserted particle. */ -void container_2d::put(int n,double x,double y) { - int ij; - if(put_locate_block(ij,x,y)) { - id[ij][co[ij]]=n; - double *pp(p[ij]+2*co[ij]++); - *(pp++)=x;*pp=y; - } -} - -/** This routine takes a particle position vector, tries to remap it into the - * primary domain. If successful, it computes the region into which it can be - * stored and checks that there is enough memory within this region to store - * it. - * \param[out] ij the region index. - * \param[in,out] (x,y) the particle position, remapped into the primary - * domain if necessary. - * \return True if the particle can be successfully placed into the container, - * false otherwise. */ -inline bool container_2d::put_locate_block(int &ij,double &x,double &y) { - if(put_remap(ij,x,y)) { - if(co[ij]==mem[ij]) add_particle_memory(ij); - return true; - } -#if VOROPP_REPORT_OUT_OF_BOUNDS ==1 - fprintf(stderr,"Out of bounds: (x,y)=(%g,%g)\n",x,y); -#endif - return false; -} - -/** Takes a particle position vector and computes the region index into which - * it should be stored. If the container is periodic, then the routine also - * maps the particle position to ensure it is in the primary domain. If the - * container is not periodic, the routine bails out. - * \param[out] ij the region index. - * \param[in,out] (x,y) the particle position, remapped into the primary - * domain if necessary. - * \return True if the particle can be successfully placed into the container, - * false otherwise. */ -inline bool container_2d::put_remap(int &ij,double &x,double &y) { - int l; - - ij=step_int((x-ax)*xsp); - if(xperiodic) {l=step_mod(ij,nx);x+=boxx*(l-ij);ij=l;} - else if(ij<0||ij>=nx) return false; - - int j(step_int((y-ay)*ysp)); - if(yperiodic) {l=step_mod(j,ny);y+=boxy*(l-j);j=l;} - else if(j<0||j>=ny) return false; - - ij+=nx*j; - return true; -} - -/** Increase memory for a particular region. - * \param[in] i the index of the region to reallocate. */ -void container_2d::add_particle_memory(int i) { - int l,*idp;double *pp; - mem[i]<<=1; - if(mem[i]>max_particle_memory) - voropp_fatal_error("Absolute maximum particle memory allocation exceeded",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=3 - fprintf(stderr,"Particle memory in region %d scaled up to %d\n",i,mem[i]); -#endif - idp=new int[mem[i]]; - for(l=0;l,s\n",id[ij][q],p[ij][2*q],p[ij][2*q+1]); -} - -/** Computes the Voronoi cells for all particles and saves the output in - * gnuplot format. - * \param[in] fp a file handle to write to. */ -void container_2d::draw_cells_gnuplot(FILE *fp) { - int i,j,ij=0,q; - double x,y; - voronoicell_2d c; - for(j=0;j=nx) {bi=nx-1;if(ai>=nx) ai=nx-1;} - } - aj=step_int((vy-ay-r)*ysp); - bj=step_int((vy-ay+r)*ysp); - if(!yperiodic) { - if(aj<0) {aj=0;if(bj<0) bj=0;} - if(bj>=ny) {bj=ny-1;if(aj>=ny) aj=ny-1;} - } - i=ai;j=aj; - aip=ip=step_mod(i,nx);apx=px=step_div(i,nx)*boxx; - ajp=jp=step_mod(j,ny);apy=py=step_div(j,ny)*boxy; - inc1=aip-step_mod(bi,nx)+nx; - s=aip+nx*ajp; - return s; -} - -/** Initializes a voropp_loop_2d object, by finding all blocks which overlap a given - * rectangular box. It calculates the index of the first block that needs to be - * tested and sets the periodic displacement vector (px,py,pz) accordingly. - * \param[in] (xmin,xmax) the minimum and maximum x coordinates of the box. - * \param[in] (ymin,ymax) the minimum and maximum y coordinates of the box. - * \param[out] (px,py) the periodic displacement vector for the first block - * to be tested. - * \return The index of the first block to be tested. */ -int voropp_loop_2d::init(double xmin,double xmax,double ymin,double ymax,double &px,double &py) { - ai=step_int((xmin-ax)*xsp); - bi=step_int((xmax-ax)*xsp); - if(!xperiodic) { - if(ai<0) {ai=0;if(bi<0) bi=0;} - if(bi>=nx) {bi=nx-1;if(ai>=nx) ai=nx-1;} - } - aj=step_int((ymin-ay)*ysp); - bj=step_int((ymax-ay)*ysp); - if(!yperiodic) { - if(aj<0) {aj=0;if(bj<0) bj=0;} - if(bj>=ny) {bj=ny-1;if(aj>=ny) aj=ny-1;} - } - i=ai;j=aj; - aip=ip=step_mod(i,nx);apx=px=step_div(i,nx)*boxx; - ajp=jp=step_mod(j,ny);apy=py=step_div(j,ny)*boxy; - inc1=aip-step_mod(bi,nx)+nx; - s=aip+nx*ajp; - return s; -} - -/** Returns the next block to be tested in a loop, and updates the periodicity - * vector if necessary. - * \param[in,out] (px,py) the current block on entering the function, which is - * updated to the next block on exiting the function. */ -int voropp_loop_2d::inc(double &px,double &py) { - if(i -#include -#include -using namespace std; - -#include "config.hh" -#include "cell_2d.hh" - -class voropp_loop_2d; - -/** \brief A class representing the whole 2D simulation region. - * - * The container class represents the whole simulation region. The - * container constructor sets up the geometry and periodicity, and divides - * the geometry into rectangular grid of blocks, each of which handles the - * particles in a particular area. Routines exist for putting in particles, - * importing particles from standard input, and carrying out Voronoi - * calculations. */ -class container_2d { - public: - /** The minimum x coordinate of the container. */ - const double ax; - /** The maximum x coordinate of the container. */ - const double bx; - /** The minimum y coordinate of the container. */ - const double ay; - /** The maximum y coordinate of the container. */ - const double by; - /** The box length in the x direction, set to (bx-ax)/nx. */ - const double boxx; - /** The box length in the y direction, set to (by-ay)/ny. */ - const double boxy; - /** The inverse box length in the x direction. */ - const double xsp; - /** The inverse box length in the y direction. */ - const double ysp; - /** The number of boxes in the x direction. */ - const int nx; - /** The number of boxes in the y direction. */ - const int ny; - /** A constant, set to the value of nx multiplied by ny, which - * is used in the routines which step through boxes in - * sequence. */ - const int nxy; - /** A boolean value that determines if the x coordinate in - * periodic or not. */ - const bool xperiodic; - /** A boolean value that determines if the y coordinate in - * periodic or not. */ - const bool yperiodic; - /** This array holds the number of particles within each - * computational box of the container. */ - int *co; - /** This array holds the maximum amount of particle memory for - * each computational box of the container. If the number of - * particles in a particular box ever approaches this limit, - * more is allocated using the add_particle_memory() function. - */ - int *mem; - /** This array holds the numerical IDs of each particle in each - * computational box. */ - int **id; - /** A two dimensional array holding particle positions. For the - * derived container_poly class, this also holds particle - * radii. */ - double **p; - container_2d(double xa,double xb,double ya,double yb,int xn,int yn,bool xper,bool yper,int memi); - ~container_2d(); - void import(FILE *fp=stdin); - /** Imports a list of particles from a file. - * \param[in] filename the file to read from. */ - inline void import(const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"r")); - import(fp); - fclose(fp); - } - void draw_particles(FILE *fp=stdout); - /** Dumps all the particle positions and IDs to a file. - * \param[in] filename the file to write to. */ - inline void draw_particles(const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"w")); - draw_particles(fp); - fclose(fp); - } - void draw_particles_pov(FILE *fp=stdout); - /** Dumps all the particles positions in POV-Ray format. - * \param[in] filename the file to write to. */ - inline void draw_particles_pov(const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"w")); - draw_particles_pov(fp); - fclose(fp); - } - void draw_cells_gnuplot(FILE *fp=stdout); - /** Computes the Voronoi cells for all particles and saves the - * output in gnuplot format. - * \param[in] filename the file to write to. */ - inline void draw_cells_gnuplot(const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"w")); - draw_cells_gnuplot(fp); - fclose(fp); - } - void draw_cells_pov(FILE *fp=stdout); - /** Computes the Voronoi cells for all particles and saves the - * output in POV-Ray format. - * \param[in] filename the file to write to. */ - inline void draw_cells_pov(const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"w")); - draw_cells_pov(fp); - fclose(fp); - } - void print_custom(const char *format,FILE *fp=stdout); - /** Computes the Voronoi cells for all particles in the - * container, and for each cell, outputs a line containing - * custom information about the cell structure. The output - * format is specified using an input string with control - * sequences similar to the standard C printf() routine. - * \param[in] format the format of the output lines, using - * control sequences to denote the different - * cell statistics. - * \param[in] filename the file to write to. */ - inline void print_custom(const char *format,const char *filename) { - FILE *fp(voropp_safe_fopen(filename,"w")); - print_custom(format,fp); - fclose(fp); - } - double sum_cell_areas(); - void compute_all_cells(); - /** An overloaded version of the compute_cell_sphere routine, - * that sets up the x and y variables. - *\param[in,out] c a reference to a voronoicell object. - * \param[in] (i,j) the coordinates of the block that the test - * particle is in. - * \param[in] ij the index of the block that the test particle - * is in, set to i+nx*j. - * \param[in] s the index of the particle within the test - * block. - * \return False if the Voronoi cell was completely removed - * during the computation and has zero volume, true otherwise. - */ - inline bool compute_cell_sphere(voronoicell_2d &c,int i,int j,int ij,int s) { - double x=p[ij][2*s],y=p[ij][2*s+1]; - return compute_cell_sphere(c,i,j,ij,s,x,y); - } - bool compute_cell_sphere(voronoicell_2d &c,int i,int j,int ij,int s,double x,double y); - bool initialize_voronoicell(voronoicell_2d &c,double x,double y); - void put(int n,double x,double y); - void clear(); - private: - inline bool put_locate_block(int &ij,double &x,double &y); - inline bool put_remap(int &ij,double &x,double &y); - void add_particle_memory(int i); - /** Custom int function, that gives consistent stepping for - * negative numbers. With normal int, we have - * (-1.5,-0.5,0.5,1.5) -> (-1,0,0,1). With this routine, we - * have (-1.5,-0.5,0.5,1.5) -> (-2,-1,0,1). */ - inline int step_int(double a) {return a<0?int(a)-1:int(a);} - /** Custom modulo function, that gives consistent stepping for - * negative numbers. */ - inline int step_mod(int a,int b) {return a>=0?a%b:b-1-(b-1-a)%b;} - /** Custom integer division function, that gives consistent - * stepping for negative numbers. */ - inline int step_div(int a,int b) {return a>=0?a/b:-1+(a+1)/b;} - friend class voropp_loop_2d; -}; - -/** \brief A class to handle loops on regions of the container handling - * non-periodic and periodic boundary conditions. - * - * Many of the container routines require scanning over a rectangular sub-grid - * of blocks, and the routines for handling this are stored in the - * voropp_loop_2d class. A voropp_loop_2d class can first be initialized to - * either calculate the subgrid which is within a distance r of a vector - * (vx,vy,vz), or a subgrid corresponding to a rectangular box. The routine - * inc() can then be successively called to step through all the blocks within - * this subgrid. - */ -class voropp_loop_2d { - public: - voropp_loop_2d(container_2d &con); - int init(double vx,double vy,double r,double &px,double &py); - int init(double xmin,double xmax,double ymin,double ymax,double &px,double &py); - int inc(double &px,double &py); - /** The current block index in the x direction, referencing a - * real cell in the range 0 to nx-1. */ - int ip; - /** The current block index in the y direction, referencing a - * real cell in the range 0 to ny-1. */ - int jp; - private: - const double boxx,boxy,xsp,ysp,ax,ay; - const int nx,ny,nxy; - const bool xperiodic,yperiodic; - double apx,apy; - int i,j,ai,bi,aj,bj,s; - int aip,ajp,inc1; - /** Custom modulo function, that gives consistent stepping for - * negative numbers. */ - inline int step_mod(int a,int b) {return a>=0?a%b:b-1-(b-1-a)%b;} - /** Custom integer division function, that gives consistent - * stepping for negative numbers. */ - inline int step_div(int a,int b) {return a>=0?a/b:-1+(a+1)/b;} - /** Custom int function, that gives consistent stepping for - * negative numbers. With normal int, we have - * (-1.5,-0.5,0.5,1.5) -> (-1,0,0,1). With this routine, we - * have (-1.5,-0.5,0.5,1.5) -> (-2,-1,0,1). */ - inline int step_int(double a) {return a<0?int(a)-1:int(a);} -}; - -#endif diff -Nru voro++-0.5/2d/src/cq_test.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cq_test.cc --- voro++-0.5/2d/src/cq_test.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/cq_test.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -#include -#include - -#include "voro++_2d.hh" -using namespace voro; - -#include "omp.h" - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i,l,n=10;double x,y,r,t1,t2; - - while(n<10000000) { - container_quad_2d con1(-1,1,-1,1); - l=int(sqrt(double(n))/3.46)+1; - container_2d con2(-1,1,-1,1,l,l,false,false,8); - - for(i=0;i>2; - } -} diff -Nru voro++-0.5/2d/src/ctr_boundary_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_boundary_2d.cc --- voro++-0.5/2d/src/ctr_boundary_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_boundary_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,624 +0,0 @@ -// Voro++, a cell-based Voronoi library -// -// Authors : Chris H. Rycroft (LBL / UC Berkeley) -// Cody Robert Dance (UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file ctr_boundary_2d.cc - * \brief Function implementations for the ctr_boundary_2d and related classes. */ - -#include - -#include "ctr_boundary_2d.hh" - -namespace voro { - -/** The class constructor sets up the geometry of container, initializing the - * minimum and maximum coordinates in each direction, and setting whether each - * direction is periodic or not. It divides the container into a rectangular - * grid of blocks, and allocates memory for each of these for storing particle - * positions and IDs. - * \param[in] (ax_,bx_) the minimum and maximum x coordinates. - * \param[in] (ay_,by_) the minimum and maximum y coordinates. - * \param[in] (nx_,ny_) the number of grid blocks in each of the three - * coordinate directions. - * \param[in] (xperiodic_,yperiodic_) flags setting whether the container is - * periodic in each coordinate direction. - * \param[in] init_mem the initial memory allocation for each block. - * \param[in] ps_ the number of floating point entries to store for each - * particle. */ -container_boundary_2d::container_boundary_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem) - : voro_base_2d(nx_,ny_,(bx_-ax_)/nx_,(by_-ay_)/ny_), - ax(ax_), bx(bx_), ay(ay_), by(by_), xperiodic(xperiodic_), yperiodic(yperiodic_), - id(new int*[nxy]), p(new double*[nxy]), co(new int[nxy]), mem(new int[nxy]), - wid(new int*[nxy]), nlab(new int*[nxy]), plab(new int**[nxy]), bndpts(new int*[nxy]), - boundary_track(-1), edbc(0), edbm(init_boundary_size), - edb(new int[2*edbm]), bnds(new double[2*edbm]), ps(2), soi(NULL), - vc(*this,xperiodic_?2*nx_+1:nx_,yperiodic_?2*ny_+1:ny_) { - int l; -// totpar=0; - for(l=0;l=0;l--) delete [] wid[l]; - for(l=nxy-1;l>=0;l--) delete [] bndpts[l]; - for(l=nxy-1;l>=0;l--) delete [] plab[l]; - for(l=nxy-1;l>=0;l--) delete [] nlab[l]; - for(l=nxy-1;l>=0;l--) delete [] p[l]; - for(l=nxy-1;l>=0;l--) delete [] id[l]; - - // Delete the two-dimensional arrays - delete [] id; - delete [] p; - delete [] co; - delete [] mem; -} - -/** Put a particle into the correct region of the container. - * \param[in] n the numerical ID of the inserted particle. - * \param[in] (x,y) the position vector of the inserted particle. */ -void container_boundary_2d::put(int n,double x,double y) { - int ij; - if(put_locate_block(ij,x,y)) { - //totpar++; - id[ij][co[ij]]=n; - if(boundary_track!=-1) { - bndpts[ij][co[ij]]=edbc; - register_boundary(x,y); - } else bndpts[ij][co[ij]]=-1; - double *pp=p[ij]+2*co[ij]++; - *(pp++)=x;*pp=y; - } -} - -/** Put a particle into the correct region of the container, also recording - * into which region it was stored. - * \param[in] vo the ordering class in which to record the region. - * \param[in] n the numerical ID of the inserted particle. - * \param[in] (x,y) the position vector of the inserted particle. */ -void container_boundary_2d::put(particle_order &vo,int n,double x,double y) { - int ij; - if(put_locate_block(ij,x,y)) { - //totpar++; - id[ij][co[ij]]=n; - if(boundary_track!=-1) { - bndpts[ij][co[ij]]=edbc; - register_boundary(x,y); - } else bndpts[ij][co[ij]]=-1; - vo.add(ij,co[ij]); - double *pp=p[ij]+2*co[ij]++; - *(pp++)=x;*pp=y; - } -} - -/** This routine takes a particle position vector, tries to remap it into the - * primary domain. If successful, it computes the region into which it can be - * stored and checks that there is enough memory within this region to store - * it. - * \param[out] ij the region index. - * \param[in,out] (x,y) the particle position, remapped into the primary - * domain if necessary. - * \return True if the particle can be successfully placed into the container, - * false otherwise. */ -inline bool container_boundary_2d::put_locate_block(int &ij,double &x,double &y) { - if(put_remap(ij,x,y)) { - if(co[ij]==mem[ij]) add_particle_memory(ij); - return true; - } -#if VOROPP_REPORT_OUT_OF_BOUNDS ==1 - fprintf(stderr,"Out of bounds: (x,y)=(%g,%g)\n",x,y); -#endif - return false; -} - -/** Takes a particle position vector and computes the region index into which - * it should be stored. If the container is periodic, then the routine also - * maps the particle position to ensure it is in the primary domain. If the - * container is not periodic, the routine bails out. - * \param[out] ij the region index. - * \param[in,out] (x,y) the particle position, remapped into the primary domain - * if necessary. - * \return True if the particle can be successfully placed into the container, - * false otherwise. */ -inline bool container_boundary_2d::put_remap(int &ij,double &x,double &y) { - int l; - - ij=step_int((x-ax)*xsp); - if(xperiodic) {l=step_mod(ij,nx);x+=boxx*(l-ij);ij=l;} - else if(ij<0||ij>=nx) return false; - - int j=step_int((y-ay)*ysp); - if(yperiodic) {l=step_mod(j,ny);y+=boxy*(l-j);j=l;} - else if(j<0||j>=ny) return false; - - ij+=nx*j; - return true; -} - -/** Increase memory for a particular region. - * \param[in] i the index of the region to reallocate. */ -void container_boundary_2d::add_particle_memory(int i) { - int l,nmem=mem[i]<<1; - - // Carry out a check on the memory allocation size, and - // print a status message if requested - if(nmem>max_particle_memory_2d) - voro_fatal_error("Absolute maximum memory allocation exceeded",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=3 - fprintf(stderr,"Particle memory in region %d scaled up to %d\n",i,nmem); -#endif - - // Allocate new memory and copy in the contents of the old arrays - int *idp=new int[nmem]; - for(l=0;l,<%g,%g,0>,rr}\n" - "cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n",ax,ay,bx,ay,ax,by,bx,by); - fprintf(fp,"cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n" - "cylinder{<%g,%g,0>,<%g,%g,0>,rr}\n",ax,ay,ax,by,bx,ay,bx,by); - fprintf(fp,"sphere{<%g,%g,0>,rr}\nsphere{<%g,%g,0>,rr}\n" - "sphere{<%g,%g,0>,rr}\nsphere{<%g,%g,0>,rr}\n",ax,ay,bx,ay,ax,by,bx,by); -} - -/** This does the additional set-up for non-convex containers. We assume that - * **p, **id, *co, *mem, *bnds, and edbc have already been setup. We then - * proceed to setup **wid, *soi, and THE PROBLEM POINTS BOOLEAN ARRAY. - * This algorithm keeps the importing seperate from the set-up */ -void container_boundary_2d::setup(){ -// double lx,ly;//last (x,y) - double cx,cy,nx,ny;//current (x,y),next (x,y) - int widl=1,maxwid=1,fwid=1,nwid;//lwid; -// bool first=true; - - tmp=tmpp=new int[3*init_temp_label_size]; - tmpe=tmp+3*init_temp_label_size; - - while(widl!=edbc){ - cx=bnds[2*widl];cy=bnds[2*widl+1]; - nwid=edb[2*widl];//lwid=edb[2*widl+1]; - //lx=bnds[lwid*2];ly=bnds[lwid*2+1]; - nx=bnds[2*nwid];ny=bnds[2*nwid+1]; - - tag_walls(cx,cy,nx,ny,widl); - semi_circle_labeling(cx,cy,nx,ny,widl); - - //make sure that the cos(angle)>1 and the angle points inward - //probpts=(lx-cx)*(nx-cx)+(ly-cy)*(ny-cy)>tolerance && - // cross_product(lx-cx,ly-cy,nx-cx,ny-cy); - - widl=edb[2*widl]; - if(widl>maxwid) maxwid=widl; - if(widl==fwid){ - widl=maxwid+1; - fwid=widl; - maxwid++; - // first=false; - } - } - - // The temporary array can now be used to set up the label table - create_label_table(); - - // Remove temporary array - delete [] tmp; -} - -/** Given two points, tags all the computational boxes that the line segment - * specified by the two points - * goes through. param[in] (x1,y1) this is one point - * \param[in] (x2,y2) this is the other point. - * \param[in] wid this is the wall id bnds[2*wid] is the x index of the first - * vertex in the c-c direction. */ -void container_boundary_2d::tag_walls(double x1,double y1,double x2,double y2,int wid_) { - - // Find which boxes these points are within - int i1=int((x1-ax)*xsp),j1=int((y1-ay)*ysp); - int i2=int((x2-ax)*xsp),j2=int((y2-ay)*ysp),k,ij; - - // Swap to ensure that i1 is smaller than i2 - double q,yfac; - if(i2=nx) k=nx-1; - tag_line(ij,(j1-1)*nx+k,wid_); - ij+=nx; - } while(j1j2) { - yfac=1/(y2-y1); - do { - q=ay+j1*boxy; - k=int((((q-y1)*x2+x1*(y2-q))*yfac-ax)*xsp); - if(k>=nx) k=nx-1; - tag_line(ij,j1*nx+k,wid_); - ij-=nx; - j1--; - } while(j1>j2); - } - tag_line(ij,i2+j2*nx,wid_); -} - -void container_boundary_2d::tag_line(int &ij,int ije,int wid_) { - tag(ij,wid_); - while(ijmax_wall_tag_size) voro_fatal_error("Maximum wall tag memory exceeded",VOROPP_MEMORY_ERROR); - int *np=new int[nws+2]; - *np=*wp;np[1]=nws; - for(int i=2;i<*wp+2;i++) np[i]=wp[i]; - delete [] wp; - wp=np; - } - wp[2+(*wp)++]=wid_; -} - -/* Tags particles that are within a semicircle (on the appropriate side) of a - * boundary. - * \param[in] (x1,y1) the start point of the wall segment, arranged so that it - * is the first point reached in the counter-clockwise - * direction. - * \param[in] (x2,y2) the end points of the wall segment. */ -void container_boundary_2d::semi_circle_labeling(double x1,double y1,double x2,double y2,int bid) { - - double radius=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))*0.5, - midx=(x1+x2)*0.5,midy=(y1+y2)*0.5,cpx,cpy; - int ai=int((midx-radius-ax)*xsp), - bi=int((midx+radius-ax)*xsp), - aj=int((midy-radius-ay)*ysp), - bj=int((midy+radius-ay)*ysp),i,j,ij,k; - if(ai<0) ai=0; - if(ai>=nx) ai=nx-1; - if(bi<0) bi=0; - if(bi>=nx) bi=nx-1; - if(aj<0) aj=0; - if(aj>=ny) aj=ny-1; - if(bj<0) bj=0; - if(bj>=ny) bj=ny-1; - - // Now loop through all the particles in the boxes we found, tagging - // the ones that are within radius of (midx,midy) and are on the - // appropriate side of the wall - for(j=aj;j<=bj;j++) for(i=ai;i<=bi;i++) { - ij=i+nx*j; - for(k=0;k=2 - fputs("No labels needed\n",stderr); -#endif - return; - } - - // If there was already a table from a previous call, remove it - if(soi!=NULL) delete [] soi; - - // Allocate the label array, and set up pointers from each particle - // to the corresponding location - pp=soi=new int[tlab]; - for(ij=0;ijy*(bnds[2*j]-bnds[2*i])) k--; - } - } - left=nleft; - i++; - } while(j==i); - } - -#if VOROPP_VERBOSE >=2 - if(k<0) fprintf(stderr,"Negative winding number of %d for (%g,%g)\n",k,x,y); - else if(k>1) fprintf(stderr,"Winding number of %d for (%g,%g)\n",k,x,y); -#endif - return k>0; -} - -template -bool container_boundary_2d::boundary_cuts(v_cell_2d &c,int ij,double x,double y) { - int i,j,k; - double lx,ly,dx,dy,dr; - for(i=2;i<*(wid[ij])+2;i++) { - j=2*wid[ij][i];k=2*edb[j]; - dx=bnds[k]-bnds[j];dy=bnds[k+1]-bnds[j+1]; - dr=dy*(bnds[j]-x)-dx*(bnds[j+1]-y); - if(drdx*dx+dy*dy) continue; - if(!c.plane(dy,-dx,2*dr)) return false; - } - return true; -} - -bool container_boundary_2d::skip(int ij,int q,double x,double y) { - int j; - double wx1,wy1,wx2,wy2,dx,dy,lx,ly; - double cx=p[ij][ps*q],cy=p[ij][ps*q+1]; - - for(int i=0;itolerance) { - lx=cx-x;ly=cy-y; - if(wx1*ly-wy1*lx>tolerance&&lx*(wy2-y)-ly*(wx2-x)>tolerance) return true; - } - } - return false; - -} - -/** Imports a list of particles from an input stream. - * \param[in] fp a file handle to read from. */ -void container_boundary_2d::import(FILE *fp) { - int i; - double x,y; - char *buf(new char[512]); - - while(fgets(buf,512,fp)!=NULL) { - if(strcmp(buf,"#Start\n")==0||strcmp(buf,"# Start\n")==0) { - - // Check that two consecutive start tokens haven't been - // encountered - if(boundary_track!=-1) voro_fatal_error("File import error - two consecutive start tokens found",VOROPP_FILE_ERROR); - start_boundary(); - - } else if(strcmp(buf,"#End\n")==0||strcmp(buf,"# End\n")==0|| - strcmp(buf,"#End")==0||strcmp(buf,"# End")==0) { - - // Check that two consecutive end tokens haven't been - // encountered - if(boundary_track==-1) voro_fatal_error("File import error - found end token without start token",VOROPP_FILE_ERROR); - end_boundary(); - } else { - - // Try and read three entries from the line - if(sscanf(buf,"%d %lg %lg",&i,&x,&y)!=3) voro_fatal_error("File import error - can't parse particle information",VOROPP_FILE_ERROR); - put(i,x,y); - } - } - if(boundary_track!=-1) voro_fatal_error("File import error - end of file reached without finding end token",VOROPP_FILE_ERROR); - - if(!feof(fp)) voro_fatal_error("File import error - error reading string from file",VOROPP_FILE_ERROR); - delete [] buf; -} - -void container_boundary_2d::end_boundary() { - if(boundary_track!=edbc) { - edb[2*boundary_track+1]=edbc-1; - edb[2*(edbc-1)]=boundary_track; - } - boundary_track=-1; -} - -void container_boundary_2d::register_boundary(double x,double y) { - if(edbc==edbm) add_boundary_memory(); - if(edbc!=boundary_track) { - edb[2*edbc-2]=edbc; - edb[2*edbc+1]=edbc-1; - } - bnds[2*edbc]=x; - bnds[2*(edbc++)+1]=y; -} - -/** Increases the size of the temporary label memory. */ -void container_boundary_2d::add_temporary_label_memory() { - int size(tmpe-tmp); - size<<=1; - if(size>3*max_temp_label_size) - voro_fatal_error("Absolute temporary label memory allocation exceeded",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=3 - fprintf(stderr,"Temporary label memory in region scaled up to %d\n",size); -#endif - int *ntmp(new int[size]),*tp(tmp);tmpp=ntmp; - while(tpmax_boundary_size) - voro_fatal_error("Absolute boundary memory allocation exceeded",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=3 - fprintf(stderr,"Boundary memory scaled up to %d\n",size); -#endif - - // Reallocate the boundary vertex information - double *nbnds(new double[2*edbm]); - for(i=0;i<2*edbc;i++) nbnds[i]=bnds[i]; - delete [] nbnds;bnds=nbnds; - - // Reallocate the edge information - int *nedb(new int[2*edbm]); - for(i=0;i<2*edbc;i++) nedb[i]=edb[i]; - delete [] edb;edb=nedb; -} - -// Explicit instantiation -template bool container_boundary_2d::boundary_cuts(voronoicell_nonconvex_2d&,int,double,double); -template bool container_boundary_2d::boundary_cuts(voronoicell_nonconvex_neighbor_2d&,int,double,double); - -} diff -Nru voro++-0.5/2d/src/ctr_boundary_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_boundary_2d.hh --- voro++-0.5/2d/src/ctr_boundary_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_boundary_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,434 +0,0 @@ -// Voro++, a cell-based Voronoi library -// -// Authors : Chris H. Rycroft (LBL / UC Berkeley) -// Cody Robert Dance (UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file ctr_boundary_2d.hh - * \brief Header file for the container_boundary_2d and related classes. */ - -#ifndef VOROPP_CTR_BOUNDARY_2D_HH -#define VOROPP_CTR_BOUNDARY_2D_HH - -#include -#include -#include -#include -using namespace std; - -#include "config.hh" -#include "common.hh" -#include "v_base_2d.hh" -#include "cell_2d.hh" -#include "c_loops_2d.hh" -#include "rad_option.hh" -#include "v_compute_2d.hh" - -namespace voro { - -/** \brief Class for representing a particle system in a three-dimensional - * rectangular box. - * - * This class represents a system of particles in a three-dimensional - * rectangular box. Any combination of non-periodic and periodic coordinates - * can be used in the three coordinate directions. The class is not intended - * for direct use, but instead forms the base of the container and - * container_poly classes that add specialized routines for computing the - * regular and radical Voronoi tessellations respectively. It contains routines - * that are commonly between these two classes, such as those for drawing the - * domain, and placing particles within the internal data structure. - * - * The class is derived from the wall_list class, which encapsulates routines - * for associating walls with the container, and the voro_base class, which - * encapsulates routines about the underlying computational grid. */ -class container_boundary_2d : public voro_base_2d, public radius_mono { - public: - - /** The minimum x coordinate of the container. */ - const double ax; - /** The maximum x coordinate of the container. */ - const double bx; - /** The minimum y coordinate of the container. */ - const double ay; - /** The maximum y coordinate of the container. */ - const double by; - /** A boolean value that determines if the x coordinate in - * periodic or not. */ - const bool xperiodic; - /** A boolean value that determines if the y coordinate in - * periodic or not. */ - const bool yperiodic; - /** This array holds the numerical IDs of each particle in each - * computational box. */ - int **id; - /** A two dimensional array holding particle positions. For the - * derived container_poly class, this also holds particle - * radii. */ - double **p; - /** This array holds the number of particles within each - * computational box of the container. */ - int *co; - /** This array holds the maximum amount of particle memory for - * each computational box of the container. If the number of - * particles in a particular box ever approaches this limit, - * more is allocated using the add_particle_memory() function. - */ - int *mem; - int **wid; - int **nlab; - int ***plab; - int **bndpts; - int boundary_track; - int edbc; - int edbm; - int *edb; - double *bnds; - - /** The amount of memory in the array structure for each - * particle. This is set to 2 when the basic class is - * initialized, so that the array holds (x,y) positions. If the - * 2D container class is initialized as part of the derived class - * container_poly_2d, then this is set to 3, to also hold the - * particle radii. */ - const int ps; - container_boundary_2d(double ax_,double bx_,double ay_,double by_, - int nx_,int ny_,bool xperiodic_,bool yperiodic_,int init_mem); - ~container_boundary_2d(); - void region_count(); - /** Initializes the Voronoi cell prior to a compute_cell - * operation for a specific particle being carried out by a - * voro_compute class. The cell is initialized to fill the - * entire container. For non-periodic coordinates, this is set - * by the position of the walls. For periodic coordinates, the - * space is equally divided in either direction from the - * particle's initial position. Plane cuts made by any walls - * that have been added are then applied to the cell. - * \param[in,out] c a reference to a voronoicell_nonconvex_2d object. - * \param[in] ij the block that the particle is within. - * \param[in] q the index of the particle within its block. - * \param[in] (ci,cj) the coordinates of the block in the - * container coordinate system. - * \param[out] (i,j) the coordinates of the test block relative - * to the voro_compute coordinate system. - * \param[out] (x,y) the position of the particle. - * \param[out] disp a block displacement used internally by the - * compute_cell routine. - * \return False if the plane cuts applied by walls completely - * removed the cell, true otherwise. */ - template - inline bool initialize_voronoicell(v_cell_2d &c,int ij,int q,int ci,int cj, - int &i,int &j,double &x,double &y,int &disp) { - double x1,x2,y1,y2,*pp=p[ij]+ps*q; - x=*(pp++);y=*(pp++); - if(xperiodic) {x1=-(x2=0.5*(bx-ax));i=nx;} else {x1=ax-x;x2=bx-x;i=ci;} - if(yperiodic) {y1=-(y2=0.5*(by-ay));j=ny;} else {y1=ay-y;y2=by-y;j=cj;} - if(bndpts[ij][q]==-1) c.init(x1,x2,y1,y2); - else { - int &bid=bndpts[ij][q]; - double cx=bnds[2*bid],cy=bnds[2*bid+1]; - int nwid=edb[2*bid],lwid=edb[2*bid+1]; - double lx=bnds[2*lwid],ly=bnds[2*lwid+1]; - double nx=bnds[2*nwid],ny=bnds[2*nwid+1]; - c.init_nonconvex(x1,x2,y1,y2,nx-cx,ny-cy,lx-cx,ly-cy); - } - disp=ij-i-nx*j; - return true; - } - bool point_inside(double x,double y); - template - bool boundary_cuts(v_cell_2d &c,int ij,double x,double y); - /** Initializes parameters for a find_voronoi_cell call within - * the voro_compute template. - * \param[in] (ci,cj) the coordinates of the test block in - * the container coordinate system. - * \param[in] ij the index of the test block - * \param[out] (i,j) the coordinates of the test block relative - * to the voro_compute coordinate system. - * \param[out] disp a block displacement used internally by the - * find_voronoi_cell routine. */ - inline void initialize_search(int ci,int cj,int ij,int &i,int &j,int &disp) { - i=xperiodic?nx:ci; - j=yperiodic?ny:cj; - disp=ij-i-nx*j; - } - /** Returns the position of a particle currently being computed - * relative to the computational block that it is within. It is - * used to select the optimal worklist entry to use. - * \param[in] (x,y) the position of the particle. - * \param[in] (ci,cj) the block that the particle is within. - * \param[out] (fx,fy) the position relative to the block. - */ - inline void frac_pos(double x,double y,double ci,double cj, - double &fx,double &fy) { - fx=x-ax-boxx*ci; - fy=y-ay-boxy*cj; - } - /** Calculates the index of block in the container structure - * corresponding to given coordinates. - * \param[in] (ci,cj) the coordinates of the original block in - * the current computation, relative to the - * container coordinate system. - * \param[in] (ei,ej) the displacement of the current block - * from the original block. - * \param[in,out] (qx,qy) the periodic displacement that must - * be added to the particles within the - * computed block. - * \param[in] disp a block displacement used internally by the - * find_voronoi_cell and compute_cell routines. - * \return The block index. */ - inline int region_index(int ci,int cj,int ei,int ej,double &qx,double &qy,int &disp) { - if(xperiodic) {if(ci+ei=(nx<<1)) {ei-=nx;qx=bx-ax;} else qx=0;} - if(yperiodic) {if(cj+ej=(ny<<1)) {ej-=ny;qy=by-ay;} else qy=0;} - return disp+ei+nx*ej; - } - void draw_domain_gnuplot(FILE *fp=stdout); - /** Draws an outline of the domain in Gnuplot format. - * \param[in] filename the filename to write to. */ - inline void draw_domain_gnuplot(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_domain_gnuplot(fp); - fclose(fp); - } - void draw_domain_pov(FILE *fp=stdout); - /** Draws an outline of the domain in Gnuplot format. - * \param[in] filename the filename to write to. */ - inline void draw_domain_pov(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_domain_pov(fp); - fclose(fp); - } - void draw_boundary_gnuplot(FILE *fp=stdout); - inline void draw_boundary_gnuplot(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_boundary_gnuplot(fp); - fclose(fp); - } - /** Sums up the total number of stored particles. - * \return The number of particles. */ - inline int total_particles() { - int tp=*co; - for(int *cop=co+1;cop - void draw_particles(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+2*vl.q; - fprintf(fp,"%d %g %g\n",id[vl.ij][vl.q],*pp,pp[1]); - } while(vl.inc()); - } - /** Dumps all of the particle IDs and positions to a file. - * \param[in] fp a file handle to write to. */ - inline void draw_particles(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles(vl,fp); - } - /** Dumps all of the particle IDs and positions to a file. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles(fp); - fclose(fp); - } - /** Dumps particle positions in POV-Ray format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_particles_pov(c_loop_2d &vl,FILE *fp) { - double *pp; - if(vl.start()) do { - pp=p[vl.ij]+2*vl.q; - fprintf(fp,"// id %d\nsphere{<%g,%g,0>,s}\n", - id[vl.ij][vl.q],*pp,pp[1]); - } while(vl.inc()); - } - /** Dumps all particle positions in POV-Ray format. - * \param[in] fp a file handle to write to. */ - inline void draw_particles_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_particles_pov(vl,fp); - } - /** Dumps all particle positions in POV-Ray format. - * \param[in] filename the name of the file to write to. */ - inline void draw_particles_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles_pov(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in gnuplot - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_gnuplot(c_loop_2d &vl,FILE *fp) { - voronoicell_nonconvex_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - pp=p[vl.ij]+ps*vl.q; - fprintf(fp,"# [%d]\n",id[vl.ij][vl.q]); - c.draw_gnuplot(*pp,pp[1],fp); - fputs("\n",fp); - } while(vl.inc()); - } - /** Computes all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_gnuplot(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_gnuplot(vl,fp); - } - /** Computes all Voronoi cells and saves the output in gnuplot - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_gnuplot(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_gnuplot(fp); - fclose(fp); - } - /** Computes Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] vl the loop class to use. - * \param[in] fp a file handle to write to. */ - template - void draw_cells_pov(c_loop_2d &vl,FILE *fp) { - voronoicell_nonconvex_2d c;double *pp; - if(vl.start()) do if(compute_cell(c,vl)) { - fprintf(fp,"// cell %d\n",id[vl.ij][vl.q]); - pp=p[vl.ij]+ps*vl.q; - c.draw_pov(*pp,pp[1],fp); - } while(vl.inc()); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] fp a file handle to write to. */ - inline void draw_cells_pov(FILE *fp=stdout) { - c_loop_all_2d vl(*this); - draw_cells_pov(vl,fp); - } - /** Computes all Voronoi cells and saves the output in POV-Ray - * format. - * \param[in] filename the name of the file to write to. */ - inline void draw_cells_pov(const char *filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_pov(fp); - fclose(fp); - } - /** Computes the Voronoi cells and saves customized information - * about them. - * \param[in] vl the loop class to use. - * \param[in] format the custom output string to use. - * \param[in] fp a file handle to write to. */ - template - void print_custom(c_loop_2d &vl,const char *format,FILE *fp) { - int ij,q;double *pp; - // bool glob=false, loc=false; - // if(contains_neighbor_global(format)){ - // init_globne(); - // glob=true; - // } - if(contains_neighbor(format)){ - // loc=true; - // } - // if(glob || loc) { - voronoicell_nonconvex_neighbor_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - // if(glob) add_globne_info(id[ij][q], c.ne, c.p); - c.output_custom(format,id[ij][q],*pp,pp[1],default_radius_2d,fp); - } while(vl.inc()); - // if(glob) print_globne(fp); - } else { - voronoicell_nonconvex_2d c; - if(vl.start()) do if(compute_cell(c,vl)) { - ij=vl.ij;q=vl.q;pp=p[ij]+ps*q; - c.output_custom(format,id[ij][q],*pp,pp[1],default_radius_2d,fp); - } while(vl.inc()); - } - } - void print_custom(const char *format,FILE *fp=stdout); - void print_custom(const char *format,const char *filename); - //bool find_voronoi_cell(double x,double y,double &rx,double &ry,int &pid); - /** Computes the Voronoi cell for a particle currently being - * referenced by a loop class. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] vl the loop class to use. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,c_loop_2d &vl) { - return vc.compute_cell(c,vl.ij,vl.q,vl.i,vl.j); - } - /** Computes the Voronoi cell for given particle. - * \param[out] c a Voronoi cell class in which to store the - * computed cell. - * \param[in] ij the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return True if the cell was computed. If the cell cannot be - * computed, if it is removed entirely by a wall or boundary - * condition, then the routine returns false. */ - template - inline bool compute_cell(v_cell_2d &c,int ij,int q) { - int j=ij/nx,i=ij-j*nx; - return vc.compute_cell(c,ij,q,i,j); - } - void setup(); - bool skip(int ij,int l,double x,double y); - private: - inline void draw_block(int ij) { - int i=ij%nx,j=ij/nx; - double lx=ax+i*boxx,ly=ay+j*boxy,ux=lx+boxx,uy=ly+boxy; - printf("%g %g\n%g %g\n%g %g\n%g %g\n%g %g\n\n\n",lx,ly,ux,ly,ux,uy,lx,uy,lx,ly); - } - int *soi; - int *tmp; - int *tmpp; - int *tmpe; - void create_label_table(); - void add_particle_memory(int i); - inline bool put_locate_block(int &ij,double &x,double &y); - inline bool put_remap(int &ij,double &x,double &y); - inline bool remap(int &ai,int &aj,int &ci,int &cj,double &x,double &y,int &ij); - void add_temporary_label_memory(); - void add_boundary_memory(); - void tag_line(int &ij,int ije,int wid); - inline void tag(int ij,int wid); - void tag_walls(double x1,double y1,double x2,double y2,int wid); - inline bool cross_product(double x1,double y1,double x2,double y2) { - return x1*y2>x2*y1; - } - void semi_circle_labeling(double x1,double y1,double x2,double y2,int bid); - voro_compute_2d vc; - friend class voro_compute_2d; -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/ctr_quad_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_quad_2d.cc --- voro++-0.5/2d/src/ctr_quad_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_quad_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,295 +0,0 @@ -#include "ctr_quad_2d.hh" -#include "quad_march.hh" - -#include -#include -#include - -namespace voro { - -container_quad_2d::container_quad_2d(double ax_,double bx_,double ay_,double by_) : - quadtree((ax_+bx_)*0.5,(ay_+by_)*0.5,(bx_-ax_)*0.5,(by_-ay_)*0.5,*this), - ax(ax_), bx(bx_), ay(ay_), by(by_), bmask(0) { - -} - -quadtree::quadtree(double cx_,double cy_,double lx_,double ly_,container_quad_2d &parent_) : - parent(parent_), cx(cx_), cy(cy_), lx(lx_), ly(ly_), ps(2), - id(new int[qt_max]), p(new double[ps*qt_max]), co(0), mask(0), nco(0), nmax(0) { - -} - -quadtree::~quadtree() { - if(id==NULL) { - delete qne;delete qnw; - delete qse;delete qsw; - } else { - delete [] p; - delete [] id; - } - if(nmax>0) delete [] nei; -} - -void quadtree::split() { - double hx=0.5*lx,hy=0.5*ly; - qsw=new quadtree(cx-hx,cy-hy,hx,hy,parent); - qse=new quadtree(cx+hx,cy-hy,hx,hy,parent); - qnw=new quadtree(cx-hx,cy+hy,hx,hy,parent); - qne=new quadtree(cx+hx,cy+hy,hx,hy,parent); - for(int i=0;iquick_put(id[i],p[ps*i],p[ps*i+1]); - delete [] id;id=NULL; - delete [] p; -} - -void quadtree::put(int i,double x,double y) { - if(id!=NULL) { - if(co==qt_max) split(); - else { - quick_put(i,x,y); - return; - } - } - (xput(i,x,y); -} - -void quadtree::draw_cross(FILE *fp) { - if(id==NULL) { - fprintf(fp,"%g %g\n%g %g\n\n\n%g %g\n%g %g\n\n\n", - cx-lx,cy,cx+ly,cy,cx,cy-ly,cx,cy+ly); - qsw->draw_cross(fp); - qse->draw_cross(fp); - qnw->draw_cross(fp); - qne->draw_cross(fp); - } -} - -void quadtree::reset_mask() { - mask=0; - if(id==NULL) { - qsw->reset_mask(); - qse->reset_mask(); - qnw->reset_mask(); - qne->reset_mask(); - } -} - -void container_quad_2d::draw_quadtree(FILE *fp) { - fprintf(fp,"%g %g\n%g %g\n%g %g\n%g %g\n%g %g\n",ax,ay,bx,ay,bx,by,ax,by,ax,ay); - draw_cross(fp); -} - -void quadtree::draw_neighbors(FILE *fp) { - for(int i=0;icx-cx,nei[i]->cy-cy); - if(id==NULL) { - qsw->draw_neighbors(fp); - qse->draw_neighbors(fp); - qnw->draw_neighbors(fp); - qne->draw_neighbors(fp); - } -} - -void quadtree::draw_particles(FILE *fp) { - if(id==NULL) { - qsw->draw_particles(fp); - qse->draw_particles(fp); - qnw->draw_particles(fp); - qne->draw_particles(fp); - } else for(int i=0;idraw_cells_gnuplot(fp); - qse->draw_cells_gnuplot(fp); - qnw->draw_cells_gnuplot(fp); - qne->draw_cells_gnuplot(fp); - } else { - voronoicell_2d c; - for(int j=0;jsum_cell_areas()+qse->sum_cell_areas() - +qnw->sum_cell_areas()+qne->sum_cell_areas(); - double area=0; - voronoicell_2d c; - for(int j=0;jcompute_all_cells(); - qse->compute_all_cells(); - qnw->compute_all_cells(); - qne->compute_all_cells(); - } else{ - voronoicell_2d c; - for(int j=0;jsetup_neighbors(); - qse->setup_neighbors(); - qnw->setup_neighbors(); - qne->setup_neighbors(); - we_neighbors(qsw,qse); - we_neighbors(qnw,qne); - ns_neighbors(qsw,qnw); - ns_neighbors(qse,qne); - } -} - -void quadtree::we_neighbors(quadtree *qw,quadtree *qe) { - const int ma=1<<30; - quad_march<0> mw(qw); - quad_march<1> me(qe); - while(mw.sadd_neighbor(me.cu()); - me.cu()->add_neighbor(mw.cu()); - if(mw.ns>me.ns) me.step(); - else { - if(mw.ns==me.ns) me.step(); - mw.step(); - } - } -} - -void quadtree::ns_neighbors(quadtree *qs,quadtree *qn) { - const int ma=1<<30; - quad_march<2> ms(qs); - quad_march<3> mn(qn); - while(ms.sadd_neighbor(mn.cu()); - mn.cu()->add_neighbor(ms.cu()); - if(ms.ns>mn.ns) mn.step(); - else { - if(ms.ns==mn.ns) mn.step(); - ms.step(); - } - } -} - -void quadtree::add_neighbor_memory() { - if(nmax==0) { - nmax=4; - nei=new quadtree*[nmax]; - } - if(nmax>16777216) { - fputs("Maximum quadtree neighbor memory exceeded\n",stderr); - exit(1); - } - nmax<<=1; - quadtree** pp=new quadtree*[nmax]; - for(int i=0;i dq; - for(i=0;imask=bm; - } - - while(!dq.empty()) { - - q=dq.front();dq.pop_front(); - q->bound(xlo,xhi,ylo,yhi); - xlo-=x;xhi-=x; - ylo-=y;yhi-=y; - - if(xlo>0) { - if(ylo>0) { - if(corner_test(c,xlo,ylo,xhi,yhi)) continue; - } else if(yhi<0) { - if(corner_test(c,xlo,yhi,xhi,ylo)) continue; - } else { - if(edge_x_test(c,xlo,ylo,yhi)) continue; - } - } else if(xhi<0) { - if(ylo>0) { - if(corner_test(c,xhi,ylo,xlo,yhi)) continue; - } else if(yhi<0) { - if(corner_test(c,xhi,yhi,xlo,ylo)) continue; - } else { - if(edge_x_test(c,xhi,ylo,yhi)) continue; - } - } else { - if(ylo>0) { - if(edge_y_test(c,xlo,ylo,xhi)) continue; - } else if(yhi<0) { - if(edge_y_test(c,xlo,yhi,xhi)) continue; - } else voro_fatal_error("Compute cell routine revisiting central block, which should never\nhappen.",VOROPP_INTERNAL_ERROR); - } - - for(i=0;ico;i++) { - x1=q->p[ps*i]-x; - y1=q->p[ps*i+1]-y; - if(!c.nplane(x1,y1,x1*x1+y1*y1,id[i])) return false; - } - - for(i=0;inco;i++) if(q->nei[i]->mask!=bm) { - dq.push_back(q->nei[i]); - q->nei[i]->mask=bm; - } - } - return true; -} - -inline bool quadtree::corner_test(voronoicell_2d &c,double xl,double yl,double xh,double yh) { - if(c.plane_intersects_guess(xl,yh,xl*xl+yl*yh)) return false; - if(c.plane_intersects(xh,yl,xl*xh+yl*yl)) return false; - return true; -} - -inline bool quadtree::edge_x_test(voronoicell_2d &c,double xl,double y0,double y1) { - if(c.plane_intersects_guess(xl,y0,xl*xl)) return false; - if(c.plane_intersects(xl,y1,xl*xl)) return false; - return true; -} - -inline bool quadtree::edge_y_test(voronoicell_2d &c,double x0,double yl,double x1) { - if(c.plane_intersects_guess(x0,yl,yl*yl)) return false; - if(c.plane_intersects(x1,yl,yl*yl)) return false; - return true; -} - -} diff -Nru voro++-0.5/2d/src/ctr_quad_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_quad_2d.hh --- voro++-0.5/2d/src/ctr_quad_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/ctr_quad_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -#ifndef CONTAINER_QUAD_2D_HH -#define CONTAINER_QUAD_2D_HH - -#include "cell_2d.hh" -#include "config.hh" -#include "common.hh" - -namespace voro { - -const int qt_max=6; - -class container_quad_2d; - -class quadtree { - public: - container_quad_2d &parent; - const double cx; - const double cy; - const double lx; - const double ly; - const int ps; - int *id; - double *p; - int co; - unsigned int mask; - quadtree *qsw; - quadtree *qse; - quadtree *qnw; - quadtree *qne; - quadtree **nei; - int nco; - quadtree(double cx_,double cy_,double lx_,double ly_,container_quad_2d &parent_); - ~quadtree(); - void put(int i,double x,double y); - void split(); - void draw_particles(FILE *fp=stdout); - void draw_cross(FILE *fp=stdout); - void setup_neighbors(); - void draw_neighbors(FILE *fp=stdout); - void draw_cells_gnuplot(FILE *fp=stdout); - inline void quick_put(int i,double x,double y) { - id[co]=i; - p[ps*co]=x; - p[1+ps*co++]=y; - } - inline void add_neighbor(quadtree *qt) { - if(nco==nmax) add_neighbor_memory(); - nei[nco++]=qt; - } - inline void bound(double &xlo,double &xhi,double &ylo,double &yhi) { - xlo=cx-lx;xhi=cx+lx; - ylo=cy-ly;yhi=cy+ly; - } - double sum_cell_areas(); - void compute_all_cells(); - bool compute_cell(voronoicell_2d &c,int j); - void reset_mask(); - protected: - int nmax; - inline bool corner_test(voronoicell_2d &c,double xl,double yl,double xh,double yh); - inline bool edge_x_test(voronoicell_2d &c,double xl,double y0,double y1); - inline bool edge_y_test(voronoicell_2d &c,double x0,double yl,double x1); - void we_neighbors(quadtree *qw,quadtree *qe); - void ns_neighbors(quadtree *qs,quadtree *qn); - void add_neighbor_memory(); -}; - -class container_quad_2d : public quadtree { - public: - using quadtree::draw_particles; - using quadtree::draw_neighbors; - using quadtree::draw_cells_gnuplot; - /** The minimum x coordinate of the container. */ - const double ax; - /** The maximum x coordinate of the container. */ - const double bx; - /** The minimum y coordinate of the container. */ - const double ay; - /** The maximum y coordinate of the container. */ - const double by; - unsigned int bmask; - container_quad_2d(double ax_,double bx_,double ay_,double by_); - inline void draw_particles(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_particles(fp); - fclose(fp); - } - inline void draw_neighbors(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_neighbors(fp); - fclose(fp); - } - inline void draw_cells_gnuplot(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_cells_gnuplot(fp); - fclose(fp); - } - void draw_quadtree(FILE *fp=stdout); - inline void draw_quadtree(const char* filename) { - FILE *fp=safe_fopen(filename,"w"); - draw_quadtree(fp); - fclose(fp); - } - inline void initialize_voronoicell(voronoicell_2d &c,double x,double y) { - c.init(ax-x,bx-x,ay-y,by-y); - } -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/Doxyfile voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Doxyfile --- voro++-0.5/2d/src/Doxyfile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Doxyfile 1970-01-01 00:00:00.000000000 +0000 @@ -1,1718 +0,0 @@ -# Doxyfile 1.7.4 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = "Voro++ (experimental 2D version)" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = .. - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = NO - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 8 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = test_ctr.cc \ - test_cell.cc - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. -# Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. -# The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = NO - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is adviced to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = YES - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the -# mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. - -MATHJAX_RELPATH = http://www.mathjax.org/mathjax - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = YES - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = YES - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = letter - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = fullpage, \ - palatino - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = YES - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = YES - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. -# This is useful -# if you want to understand what is going on. -# On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called Helvetica to the output -# directory and reference it in all dot files that doxygen generates. -# When you want a differently looking font you can specify the font name -# using DOT_FONTNAME. You need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = YES - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff -Nru voro++-0.5/2d/src/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Makefile --- voro++-0.5/2d/src/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (Harvard SEAS / LBL) -# Email : chr@alum.mit.edu -# Date : February 27th 2008 - -# Load the common configuration file -include ../config.mk - -# List of the common source files -objs=common.o cell_2d.o container_2d.o v_base_2d.o v_compute_2d.o \ - c_loops_2d.o wall_2d.o cell_nc_2d.o ctr_boundary_2d.o ctr_quad_2d.o \ - quad_march.o -src=$(patsubst %.o,%.cc,$(objs)) -execs=cq_test - -# Makefile rules -all: libvoro++_2d.a $(execs) - -depend: - $(CXX) -MM $(src) >Makefile.dep - -include Makefile.dep - -worklist_2d.hh v_base_wl_2d.cc: worklist_gen.pl - perl worklist_gen.pl - -libvoro++_2d.a: $(objs) - rm -f libvoro++_2d.a - ar rs libvoro++_2d.a $^ - -cq_test: cq_test.cc libvoro++_2d.a - $(CXX) -fopenmp $(CFLAGS) -o $@ $^ - -%.o: %.cc - $(CXX) $(CFLAGS) -c $< - -help: Doxyfile $(SOURCE) - doxygen Doxyfile - cd ../latex && $(MAKE) - -clean: - rm -f $(objs) libvoro++_2d.a - -.PHONY: all help depend diff -Nru voro++-0.5/2d/src/Makefile.dep voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Makefile.dep --- voro++-0.5/2d/src/Makefile.dep 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/Makefile.dep 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -common.o: common.cc common.hh config.hh -cell_2d.o: cell_2d.cc cell_2d.hh common.hh config.hh cell_nc_2d.hh -container_2d.o: container_2d.cc container_2d.hh config.hh common.hh \ - v_base_2d.hh worklist_2d.hh cell_2d.hh c_loops_2d.hh rad_option.hh \ - v_compute_2d.hh cell_nc_2d.hh -v_base_2d.o: v_base_2d.cc v_base_2d.hh worklist_2d.hh config.hh \ - v_base_wl_2d.cc -v_compute_2d.o: v_compute_2d.cc worklist_2d.hh v_compute_2d.hh config.hh \ - cell_2d.hh common.hh cell_nc_2d.hh rad_option.hh container_2d.hh \ - v_base_2d.hh c_loops_2d.hh ctr_boundary_2d.hh -c_loops_2d.o: c_loops_2d.cc c_loops_2d.hh config.hh -wall_2d.o: wall_2d.cc wall_2d.hh cell_2d.hh common.hh config.hh \ - container_2d.hh v_base_2d.hh worklist_2d.hh c_loops_2d.hh rad_option.hh \ - v_compute_2d.hh cell_nc_2d.hh -cell_nc_2d.o: cell_nc_2d.cc cell_nc_2d.hh cell_2d.hh common.hh config.hh -ctr_boundary_2d.o: ctr_boundary_2d.cc ctr_boundary_2d.hh config.hh \ - common.hh v_base_2d.hh worklist_2d.hh cell_2d.hh c_loops_2d.hh \ - rad_option.hh v_compute_2d.hh cell_nc_2d.hh -ctr_quad_2d.o: ctr_quad_2d.cc ctr_quad_2d.hh config.hh common.hh \ - quad_march.hh -quad_march.o: quad_march.cc quad_march.hh ctr_quad_2d.hh config.hh \ - common.hh diff -Nru voro++-0.5/2d/src/quad_march.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/quad_march.cc --- voro++-0.5/2d/src/quad_march.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/quad_march.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#include "quad_march.hh" - -namespace voro { - -template -quad_march::quad_march(quadtree *q) : ma(1<<30), s(0), p(0) { - list[p]=q; - while(list[p]->id==NULL) {list[p+1]=up(list[p]);p++;} - ns=ma>>p; -} - -template -void quad_march::step() { - if(ns>=ma) {s=ma+1;return;} - while(down(list[p-1])==list[p]) p--; - list[p]=down(list[p-1]); - while(list[p]->id==NULL) {list[p+1]=up(list[p]);p++;} - s=ns;ns+=ma>>p; -} - -// Explicit instantiation -template class quad_march<0>; -template class quad_march<1>; -template class quad_march<2>; -template class quad_march<3>; - -} diff -Nru voro++-0.5/2d/src/quad_march.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/quad_march.hh --- voro++-0.5/2d/src/quad_march.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/quad_march.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#ifndef QUAD_MARCH_HH -#define QUAD_MARCH_HH - -#include "ctr_quad_2d.hh" - -namespace voro { - -template -class quad_march { - public: - const int ma; - int s; - int ns; - int p; - quadtree* list[32]; - quad_march(quadtree *q); - void step(); - inline quadtree* cu() { - return list[p]; - } - private: - inline quadtree* up(quadtree* q) { - return ca<2?(ca==0?q->qne:q->qnw):(ca==2?q->qnw:q->qsw); - } - inline quadtree* down(quadtree* q) { - return ca<2?(ca==0?q->qse:q->qsw):(ca==2?q->qne:q->qse); - } -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/rad_option.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/rad_option.hh --- voro++-0.5/2d/src/rad_option.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/rad_option.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file rad_option.hh - * \brief Header file for the classes encapsulating functionality for the - * regular and radical Voronoi tessellations. */ - -#ifndef VOROPP_RAD_OPTION_HH -#define VOROPP_RAD_OPTION_HH - -namespace voro { - -/** \brief Class containing all of the routines that are specific to computing - * the regular Voronoi tessellation. - * - * The container and container_periodic classes are derived from this class, - * and during the Voronoi cell computation, these routines are used to create - * the regular Voronoi tessellation. */ -class radius_mono { - protected: - /** This is called prior to computing a Voronoi cell for a - * given particle to initialize any required constants. - * \param[in] ijk the block that the particle is within. - * \param[in] s the index of the particle within the block. */ - inline void r_init(int ijk,int s) {} - /** Sets a required constant to be used when carrying out a - * plane bounds check. */ - inline void r_prime(double rv) {} - /** Carries out a radius bounds check. - * \param[in] crs the radius squared to be tested. - * \param[in] mrs the current maximum distance to a Voronoi - * vertex multiplied by two. - * \return True if particles at this radius could not possibly - * cut the cell, false otherwise. */ - inline bool r_ctest(double crs,double mrs) {return crs>mrs;} - /** Scales a plane displacement during a plane bounds check. - * \param[in] lrs the plane displacement. - * \return The scaled value. */ - inline double r_cutoff(double lrs) {return lrs;} - /** Adds the maximum radius squared to a given value. - * \param[in] rs the value to consider. - * \return The value with the radius squared added. */ - inline double r_max_add(double rs) {return rs;} - /** Subtracts the radius squared of a particle from a given - * value. - * \param[in] rs the value to consider. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return The value with the radius squared subtracted. */ - inline double r_current_sub(double rs,int ijk,int q) {return rs;} - /** Scales a plane displacement prior to use in the plane cutting - * algorithm. - * \param[in] rs the initial plane displacement. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ - inline double r_scale(double rs,int ijk,int q) {return rs;} - /** Scales a plane displacement prior to use in the plane - * cutting algorithm, and also checks if it could possibly cut - * the cell. - * \param[in,out] rs the plane displacement to be scaled. - * \param[in] mrs the current maximum distance to a Voronoi - * vertex multiplied by two. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return True if the cell could possibly cut the cell, false - * otherwise. */ - inline bool r_scale_check(double &rs,double mrs,int ijk,int q) {return rssqrt(mrs*crs);} - /** Scales a plane displacement during a plane bounds check. - * \param[in] lrs the plane displacement. - * \return The scaled value. */ - inline double r_cutoff(double lrs) {return lrs*r_val;} - /** Adds the maximum radius squared to a given value. - * \param[in] rs the value to consider. - * \return The value with the radius squared added. */ - inline double r_max_add(double rs) {return rs+max_radius*max_radius;} - /** Subtracts the radius squared of a particle from a given - * value. - * \param[in] rs the value to consider. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return The value with the radius squared subtracted. */ - inline double r_current_sub(double rs,int ijk,int q) { - return rs-ppr[ijk][3*q+2]*ppr[ijk][3*q+2]; - } - /** Scales a plane displacement prior to use in the plane cutting - * algorithm. - * \param[in] rs the initial plane displacement. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ - inline double r_scale(double rs,int ijk,int q) { - return rs+r_rad-ppr[ijk][3*q+2]*ppr[ijk][3*q+2]; - } - /** Scales a plane displacement prior to use in the plane - * cutting algorithm, and also checks if it could possibly cut - * the cell. - * \param[in,out] rs the plane displacement to be scaled. - * \param[in] mrs the current maximum distance to a Voronoi - * vertex multiplied by two. - * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. - * \return True if the cell could possibly cut the cell, false - * otherwise. */ - inline bool r_scale_check(double &rs,double mrs,int ijk,int q) { - double trs=rs; - rs+=r_rad-ppr[ijk][3*q+2]*ppr[ijk][3*q+2]; - return rs - -#include "v_base_2d.hh" -#include "config.hh" - -namespace voro { - -/** This function is called during container construction. The routine scans - * all of the worklists in the wl[] array. For a given worklist of blocks - * labeled \f$w_1\f$ to \f$w_n\f$, it computes a sequence \f$r_0\f$ to - * \f$r_n\f$ so that $r_i$ is the minimum distance to all the blocks - * \f$w_{j}\f$ where \f$j>i\f$ and all blocks outside the worklist. The values - * of \f$r_n\f$ is calculated first, as the minimum distance to any block in - * the shell surrounding the worklist. The \f$r_i\f$ are then computed in - * reverse order by considering the distance to \f$w_{i+1}\f$. */ -voro_base_2d::voro_base_2d(int nx_,int ny_,double boxx_,double boxy_) : - nx(nx_), ny(ny_), nxy(nx_*ny_), boxx(boxx_), boxy(boxy_), - xsp(1/boxx_), ysp(1/boxy_), mrad(new double[wl_hgridsq_2d*wl_seq_length_2d]) { - const unsigned int b1=1<<21,b2=1<<22,b3=1<<24,b4=1<<25; - const double xstep=boxx/wl_fgrid_2d,ystep=boxy/wl_fgrid_2d; - int i,j,lx,ly,q; - unsigned int f,*e=const_cast (wl); - double xlo,ylo,xhi,yhi,minr,*radp=mrad; - for(ylo=0,yhi=ystep,ly=0;ly>7&127)-64; - if((f&b2)==b2) { - compute_minimum(minr,xlo,xhi,ylo,yhi,i-1,j); - if((f&b1)==0) compute_minimum(minr,xlo,xhi,ylo,yhi,i+1,j); - } else if((f&b1)==b1) compute_minimum(minr,xlo,xhi,ylo,yhi,i+1,j); - if((f&b4)==b4) { - compute_minimum(minr,xlo,xhi,ylo,yhi,i,j-1); - if((f&b3)==0) compute_minimum(minr,xlo,xhi,ylo,yhi,i,j+1); - } else if((f&b3)==b3) compute_minimum(minr,xlo,xhi,ylo,yhi,i,j+1); - } - q--; - while(q>0) { - radp[q]=minr; - f=e[q]; - i=(f&127)-64; - j=(f>>7&127)-64; - compute_minimum(minr,xlo,xhi,ylo,yhi,i,j); - q--; - } - *radp=minr; - e+=wl_seq_length_2d; - radp+=wl_seq_length_2d; - } - } -} - -/** Computes the minimum distance from a subregion to a given block. If this distance - * is smaller than the value of minr, then it passes - * \param[in,out] minr a pointer to the current minimum distance. If the distance - * computed in this function is smaller, then this distance is - * set to the new one. - * \param[out] (xlo,ylo) the lower coordinates of the subregion being - * considered. - * \param[out] (xhi,yhi) the upper coordinates of the subregion being - * considered. - * \param[in] (ti,tj) the coordinates of the block. */ -void voro_base_2d::compute_minimum(double &minr,double &xlo,double &xhi,double &ylo,double &yhi,int ti,int tj) { - double radsq,temp; - if(ti>0) {temp=boxx*ti-xhi;radsq=temp*temp;} - else if(ti<0) {temp=xlo-boxx*(1+ti);radsq=temp*temp;} - else radsq=0; - - if(tj>0) {temp=boxy*tj-yhi;radsq+=temp*temp;} - else if(tj<0) {temp=ylo-boxy*(1+tj);radsq+=temp*temp;} - - if(radsq(format)); - - // Check to see if "%n" appears in the format sequence - while(*fmp!=0) { - if(*fmp=='%') { - fmp++; - if(*fmp=='n') return true; - else if(*fmp==0) return false; - } - fmp++; - } - - return false; -} - -/*bool voro_base_2d::contains_neighbor_global(const char *format) { - char *fmp=(const_cast(format)); - - // Check to see if "%N" appears in the format sequence - while(*fmp!=0) { - if(*fmp=='%') { - fmp++; - if(*fmp=='N') return true; - else if(*fmp==0) return false; - } - fmp++; - } - - return false; -} -void voro_base_2d::add_globne_info(int pid, int *nel, int length){ - for(int i=0;i=0){ - globne[((totpar*pid)+nel[i])/32] |= (unsigned int)(1 << (((totpar*pid)+nel[i])%32)); - } - } - -} -void voro_base_2d::print_globne(FILE *fp){ - int j=0; - fprintf(fp, "Global neighbor info: Format \n [Particle-ID] \t [Neighbors] \n [Particle-ID] \t [Neighbors]"); - for(int i=0; i -//#include -namespace voro { - -/** \brief Class containing data structures common across all particle container classes. - * - * This class contains constants and data structures that are common across all - * particle container classes. It contains constants setting the size of the - * underlying subgrid of blocks that forms the basis of the Voronoi cell - * computations. It also constructs bound tables that are used in the Voronoi - * cell computation, and contains a number of routines that are common across - * all container classes. */ -class voro_base_2d { - public: -// /** total number of particles. */ -// int totpar; - /** The number of blocks in the x direction. */ - const int nx; - /** The number of blocks in the y direction. */ - const int ny; - /** A constant, set to the value of nx multiplied by ny, which - * is used in the routines that step through blocks in - * sequence. */ - const int nxy; - /** The size of a computational block in the x direction. */ - const double boxx; - /** The size of a computational block in the y direction. */ - const double boxy; - /** The inverse box length in the x direction. */ - const double xsp; - /** The inverse box length in the y direction. */ - const double ysp; - /** An array to hold the minimum distances associated with the - * worklists. This array is initialized during container - * construction, by the initialize_radii() routine. */ - double *mrad; -// /** The pre-computed block worklists. */ -// unsigned int *globne; -// /** global neighbor information */ -// inline void init_globne(){ -// globne = new unsigned int[((totpar*totpar)/32)+1]; -// for(int i=0;i<((totpar*totpar)/32);i++){ -// globne[i] = 0; -// } -// } -// void add_globne_info(int pid, int *nel, int length); -// void print_globne(FILE *fp); - static const unsigned int wl[wl_seq_length_2d*wl_hgridsq_2d]; - bool contains_neighbor(const char* format); -// bool contains_neighbor_global(const char* format); - voro_base_2d(int nx_,int ny_,double boxx_,double boxy_); - ~voro_base_2d() {delete [] mrad;} - protected: - /** A custom int function that returns consistent stepping - * for negative numbers, so that (-1.5, -0.5, 0.5, 1.5) maps - * to (-2,-1,0,1). - * \param[in] a the number to consider. - * \return The value of the custom int operation. */ - inline int step_int(double a) {return a<0?int(a)-1:int(a);} - /** A custom modulo function that returns consistent stepping - * for negative numbers. For example, (-2,-1,0,1,2) step_mod 2 - * is (0,1,0,1,0). - * \param[in] (a,b) the input integers. - * \return The value of a modulo b, consistent for negative - * numbers. */ - inline int step_mod(int a,int b) {return a>=0?a%b:b-1-(b-1-a)%b;} - /** A custom integer division function that returns consistent - * stepping for negative numbers. For example, (-2,-1,0,1,2) - * step_div 2 is (-1,-1,0,0,1). - * \param[in] (a,b) the input integers. - * \return The value of a div b, consistent for negative - * numbers. */ - inline int step_div(int a,int b) {return a>=0?a/b:-1+(a+1)/b;} - private: - void compute_minimum(double &minr,double &xlo,double &xhi,double &ylo,double &yhi,int ti,int tj); -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/v_base_wl_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_base_wl_2d.cc --- voro++-0.5/2d/src/v_base_wl_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_base_wl_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -// Voro++, a 2D and 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file v_base_wl_2d.cc - * \brief The table of block worklists that are used during the cell - * computation, which is part of the voro_base class. - * - * This file is automatically generated by worklist_gen.pl and it is not - * intended to be edited by hand. */ - -const unsigned int voro_base_2d::wl[wl_seq_length_2d*wl_hgridsq_2d]={ - 39,0x203f,0x1fc0,0x1fbf,0x20bf,0x20c0,0x2041,0x1fc1,0x1f40,0x1f3f,0x1fbe,0x203e,0x20c1,0x20be,0x1f41,0x1f3e,0x213f,0x2140,0x2042,0x1fc2,0x1ec0,0x1ebf,0x1fbd,0x203d,0x2141,0x20c2,0x1f42,0x1ec1,0x213e,0x20bd,0x1f3d,0x1ebe,0x2142,0x1ec2,0x213d,0x21bf,0x21c0,0x2043,0x1fc3,0x1ebd,0x3001e3f,0x3001e40,0x601fbc,0x60203c,0x21be,0x21c1,0x20c3,0x1f43,0x3001e41,0x3001e3e,0x601f3c,0x6020bc,0x10021bd,0x10021c2,0x1202143,0x201ec3,0x3201e42,0x3001e3d,0x3601ebc,0x160213c,0x160223f,0x1202240,0x1202044,0x3201fc4, - 36,0x1fc0,0x203f,0x1fbf,0x1fc1,0x2041,0x20c0,0x20bf,0x1f40,0x1f3f,0x1fbe,0x203e,0x20c1,0x1f41,0x20be,0x1f3e,0x1fc2,0x2042,0x2140,0x213f,0x20c2,0x2141,0x1ec0,0x1ebf,0x1f42,0x1ec1,0x1fbd,0x203d,0x213e,0x20bd,0x1ebe,0x1f3d,0x2142,0x1ec2,0x1fc3,0x2043,0x20c3,0x10021c0,0x10021bf,0x213d,0x1ebd,0x3001e3f,0x3001e40,0x1f43,0x10021c1,0x10021be,0x60203c,0x601fbc,0x3001e41,0x3001e3e,0x601f3c,0x6020bc,0x2143,0x12021c2,0x1ec3,0x3201e42,0x10021bd,0x160213c,0x3001e3d,0x3601ebc,0x201fc4,0x202044,0x12020c4,0x3201f44, - 37,0x1fc0,0x1fbf,0x203f,0x2041,0x1fc1,0x20c0,0x20bf,0x1f40,0x1f3f,0x20c1,0x1f41,0x1fbe,0x203e,0x20be,0x1f3e,0x1fc2,0x2042,0x20c2,0x2140,0x213f,0x1f42,0x1ec0,0x1ebf,0x2141,0x1ec1,0x1fbd,0x203d,0x213e,0x20bd,0x1ebe,0x1f3d,0x2142,0x2043,0x1fc3,0x1ec2,0x1f43,0x20c3,0x10021c0,0x10021bf,0x10021c1,0x213d,0x3001e40,0x3001e3f,0x1ebd,0x3001e41,0x10021be,0x60203c,0x601fbc,0x3001e3e,0x2143,0x12021c2,0x1ec3,0x3201e42,0x6020bc,0x601f3c,0x10021bd,0x202044,0x201fc4,0x12020c4,0x3201f44,0x3001e3d,0x3601ebc,0x160213c, - 38,0x1fc0,0x1fbf,0x203f,0x2041,0x1fc1,0x20c0,0x20bf,0x1f40,0x20c1,0x1f3f,0x1f41,0x1fbe,0x203e,0x2042,0x1fc2,0x20be,0x1f3e,0x20c2,0x1f42,0x2140,0x213f,0x2141,0x1ec0,0x1ebf,0x1ec1,0x1fbd,0x203d,0x213e,0x2142,0x2043,0x1fc3,0x1ebe,0x1ec2,0x20bd,0x1f3d,0x20c3,0x1f43,0x21c0,0x21bf,0x21c1,0x213d,0x3001e40,0x3001e3f,0x3001e41,0x1ebd,0x2143,0x10021c2,0x10021be,0x1ec3,0x3201e42,0x3601e3e,0x601fbc,0x60203c,0x6020bc,0x3601f3c,0x201fc4,0x202044,0x12020c4,0x3201f44,0x10021bd,0x160213c,0x1402240,0x12021c3, - 36,0x203f,0x1fc0,0x1fbf,0x20bf,0x20c0,0x2041,0x1fc1,0x203e,0x1fbe,0x1f3f,0x1f40,0x20c1,0x20be,0x1f41,0x1f3e,0x213f,0x2140,0x2042,0x1fc2,0x2141,0x20c2,0x203d,0x1fbd,0x213e,0x20bd,0x1ebf,0x1ec0,0x1f42,0x1ec1,0x1f3d,0x1ebe,0x2142,0x213d,0x21bf,0x21c0,0x21c1,0x202043,0x201fc3,0x1ec2,0x1ebd,0x601fbc,0x60203c,0x21be,0x2020c3,0x201f43,0x3001e40,0x3001e3f,0x6020bc,0x601f3c,0x3001e3e,0x3001e41,0x21c2,0x1202143,0x21bd,0x160213c,0x201ec3,0x3201e42,0x601ebc,0x3601e3d,0x100223f,0x1002240,0x1202241,0x160223e, - 40,0x203f,0x1fc0,0x1fbf,0x2041,0x20c0,0x20bf,0x1fc1,0x20c1,0x203e,0x1fbe,0x1f3f,0x1f40,0x1f41,0x20be,0x1f3e,0x2042,0x1fc2,0x2140,0x213f,0x2141,0x20c2,0x1f42,0x1ec0,0x1ebf,0x1fbd,0x203d,0x213e,0x20bd,0x1ec1,0x1ebe,0x1f3d,0x2142,0x2043,0x1fc3,0x1ec2,0x21c0,0x21bf,0x213d,0x21c1,0x20c3,0x1f43,0x21be,0x1ebd,0x3001e3f,0x3001e40,0x601fbc,0x60203c,0x6020bc,0x3001e41,0x3601e3e,0x3601f3c,0x21c2,0x1002143,0x201ec3,0x3201e42,0x10021bd,0x160213c,0x160223f,0x1002240,0x1202241,0x202044,0x3201fc4,0x12020c4, - 40,0x1fc0,0x203f,0x1fbf,0x2041,0x1fc1,0x20c0,0x20bf,0x20c1,0x1f40,0x1f3f,0x1fbe,0x203e,0x1f41,0x20be,0x2042,0x1fc2,0x1f3e,0x2140,0x213f,0x20c2,0x2141,0x1f42,0x1ec0,0x1ebf,0x1ec1,0x213e,0x203d,0x1fbd,0x20bd,0x2142,0x1ebe,0x1f3d,0x2043,0x1fc3,0x1ec2,0x20c3,0x21c0,0x21bf,0x21c1,0x213d,0x1f43,0x21be,0x1ebd,0x3001e3f,0x3001e40,0x3001e41,0x2143,0x2021c2,0x60203c,0x601fbc,0x6020bc,0x3601e3e,0x201ec3,0x3201e42,0x3601f3c,0x10021bd,0x160213c,0x202044,0x3201fc4,0x12020c4,0x1002240,0x160223f,0x1202241, - 39,0x1fc0,0x203f,0x1fbf,0x2041,0x1fc1,0x20c0,0x20bf,0x20c1,0x1f40,0x1f3f,0x1f41,0x203e,0x1fbe,0x2042,0x1fc2,0x20be,0x20c2,0x2140,0x213f,0x2141,0x1f3e,0x1f42,0x1ec0,0x1ebf,0x1ec1,0x213e,0x2142,0x203d,0x1fbd,0x20bd,0x2043,0x1fc3,0x1ebe,0x1f3d,0x1ec2,0x20c3,0x1f43,0x21c0,0x21bf,0x21c1,0x213d,0x21be,0x2143,0x10021c2,0x3001e40,0x3001e3f,0x3001e41,0x1ebd,0x601fbc,0x60203c,0x1ec3,0x3201e42,0x3601e3e,0x16020bc,0x3601f3c,0x202044,0x201fc4,0x12020c4,0x3201f44,0x16021bd,0x1202240,0x160223f,0x12021c3, - 37,0x203f,0x1fbf,0x1fc0,0x20c0,0x20bf,0x2041,0x1fc1,0x203e,0x1fbe,0x20c1,0x20be,0x1f3f,0x1f40,0x1f41,0x1f3e,0x213f,0x2140,0x2141,0x2042,0x1fc2,0x213e,0x203d,0x1fbd,0x20c2,0x20bd,0x1ebf,0x1ec0,0x1f42,0x1ec1,0x1f3d,0x1ebe,0x2142,0x21c0,0x21bf,0x213d,0x21be,0x21c1,0x202043,0x201fc3,0x2020c3,0x1ec2,0x60203c,0x601fbc,0x1ebd,0x6020bc,0x201f43,0x3001e40,0x3001e3f,0x601f3c,0x21c2,0x1202143,0x21bd,0x160213c,0x3001e41,0x3001e3e,0x201ec3,0x1002240,0x100223f,0x1202241,0x160223e,0x601ebc,0x3601e3d,0x3201e42, - 40,0x203f,0x1fc0,0x1fbf,0x20c0,0x20bf,0x2041,0x1fc1,0x20c1,0x203e,0x1fbe,0x1f3f,0x1f40,0x20be,0x1f41,0x2140,0x213f,0x1f3e,0x2042,0x1fc2,0x2141,0x20c2,0x213e,0x203d,0x1fbd,0x20bd,0x1f42,0x1ec0,0x1ebf,0x1ec1,0x2142,0x1f3d,0x1ebe,0x21c0,0x21bf,0x213d,0x21c1,0x2043,0x1fc3,0x20c3,0x1ec2,0x21be,0x1f43,0x1ebd,0x601fbc,0x60203c,0x6020bc,0x21c2,0x1002143,0x3001e40,0x3001e3f,0x3001e41,0x3601f3c,0x10021bd,0x160213c,0x3601e3e,0x201ec3,0x3201e42,0x1002240,0x160223f,0x1202241,0x202044,0x3201fc4,0x12020c4, - 39,0x203f,0x1fc0,0x1fbf,0x2041,0x20c0,0x20bf,0x1fc1,0x20c1,0x203e,0x1f40,0x1f3f,0x1fbe,0x20be,0x1f41,0x2042,0x1fc2,0x2140,0x213f,0x2141,0x20c2,0x1f3e,0x213e,0x1f42,0x1ec0,0x1ebf,0x203d,0x1fbd,0x20bd,0x2142,0x1ec1,0x1ebe,0x1f3d,0x21c0,0x21bf,0x2043,0x1fc3,0x20c3,0x21c1,0x213d,0x1ec2,0x1f43,0x21be,0x21c2,0x2143,0x1ebd,0x3001e3f,0x3001e40,0x3201e41,0x60203c,0x601fbc,0x6020bc,0x10021bd,0x3601f3c,0x3601e3e,0x3201ec3,0x3201fc4,0x202044,0x12020c4,0x1002240,0x160223f,0x160213c,0x1202241,0x12021c3, - 39,0x1fc0,0x203f,0x1fbf,0x2041,0x1fc1,0x20c0,0x20bf,0x20c1,0x1f40,0x1f3f,0x1f41,0x203e,0x1fbe,0x20be,0x2042,0x1fc2,0x20c2,0x2140,0x213f,0x2141,0x1f3e,0x1f42,0x213e,0x2142,0x1ec0,0x1ebf,0x1ec1,0x203d,0x1fbd,0x20bd,0x2043,0x1fc3,0x20c3,0x21c0,0x21bf,0x21c1,0x1ebe,0x1f3d,0x1ec2,0x1f43,0x213d,0x21be,0x2143,0x21c2,0x3001e40,0x3001e3f,0x3001e41,0x1ebd,0x601fbc,0x60203c,0x16020bc,0x201ec3,0x3201fc4,0x202044,0x12020c4,0x12021c3,0x16021bd,0x1002240,0x160223f,0x1202241,0x3601e3e,0x3601f3c,0x3201e42, - 38,0x203f,0x1fbf,0x1fc0,0x20c0,0x20bf,0x2041,0x1fc1,0x203e,0x20c1,0x1fbe,0x20be,0x1f3f,0x1f40,0x2140,0x213f,0x1f41,0x1f3e,0x2141,0x213e,0x2042,0x1fc2,0x20c2,0x203d,0x1fbd,0x20bd,0x1ebf,0x1ec0,0x1f42,0x2142,0x21c0,0x21bf,0x1f3d,0x213d,0x1ec1,0x1ebe,0x21c1,0x21be,0x2043,0x1fc3,0x20c3,0x1ec2,0x60203c,0x601fbc,0x6020bc,0x1ebd,0x21c2,0x202143,0x201f43,0x21bd,0x160213c,0x3601f3c,0x3001e3f,0x3001e40,0x3001e41,0x3601e3e,0x100223f,0x1002240,0x1202241,0x160223e,0x201ec3,0x3201e42,0x2202044,0x12021c3, - 39,0x203f,0x1fc0,0x1fbf,0x20c0,0x20bf,0x2041,0x1fc1,0x20c1,0x203e,0x1fbe,0x20be,0x1f40,0x1f3f,0x2140,0x213f,0x1f41,0x2141,0x2042,0x1fc2,0x20c2,0x1f3e,0x213e,0x203d,0x1fbd,0x20bd,0x1f42,0x2142,0x1ec0,0x1ebf,0x1ec1,0x21c0,0x21bf,0x1f3d,0x1ebe,0x213d,0x21c1,0x21be,0x2043,0x1fc3,0x20c3,0x1ec2,0x1f43,0x21c2,0x202143,0x60203c,0x601fbc,0x6020bc,0x1ebd,0x3001e3f,0x3001e40,0x21bd,0x160213c,0x3601f3c,0x3201e41,0x3601e3e,0x1002240,0x100223f,0x1202241,0x160223e,0x3201ec3,0x1202044,0x3201fc4,0x12021c3, - 39,0x203f,0x1fc0,0x1fbf,0x20c0,0x20bf,0x2041,0x1fc1,0x20c1,0x203e,0x1fbe,0x20be,0x1f40,0x1f3f,0x1f41,0x2140,0x213f,0x2141,0x2042,0x1fc2,0x20c2,0x1f3e,0x213e,0x1f42,0x2142,0x203d,0x1fbd,0x20bd,0x1ec0,0x1ebf,0x1ec1,0x21c0,0x21bf,0x21c1,0x2043,0x1fc3,0x20c3,0x1f3d,0x1ebe,0x213d,0x21be,0x1ec2,0x1f43,0x21c2,0x2143,0x60203c,0x601fbc,0x6020bc,0x1ebd,0x3001e3f,0x3001e40,0x3201e41,0x10021bd,0x160223f,0x1002240,0x1202241,0x12021c3,0x3201ec3,0x202044,0x3201fc4,0x12020c4,0x3601f3c,0x3601e3e,0x160213c, - 39,0x203f,0x1fc0,0x2041,0x20c0,0x1fbf,0x20bf,0x1fc1,0x20c1,0x203e,0x1f40,0x1f3f,0x1fbe,0x20be,0x2140,0x2042,0x1f41,0x1fc2,0x20c2,0x213f,0x2141,0x1f3e,0x213e,0x1f42,0x2142,0x203d,0x1fbd,0x1ec0,0x1ebf,0x1ec1,0x20bd,0x21c0,0x21bf,0x2043,0x1fc3,0x20c3,0x21c1,0x1f3d,0x1ebe,0x1ec2,0x1f43,0x213d,0x21be,0x21c2,0x2143,0x3001e40,0x3001e3f,0x1ebd,0x60203c,0x601fbc,0x16020bc,0x16021bd,0x1002240,0x160223f,0x1202241,0x3001e41,0x201ec3,0x202044,0x3201fc4,0x12020c4,0x12021c3,0x3601f3c,0x3601e3e,0x3201e42 -}; diff -Nru voro++-0.5/2d/src/v_compute_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_compute_2d.cc --- voro++-0.5/2d/src/v_compute_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_compute_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,757 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file v_compute_2d.cc - * \brief Function implementantions for the 2D voro_compute class. */ - -#include "worklist_2d.hh" -#include "v_compute_2d.hh" -#include "rad_option.hh" -#include "container_2d.hh" -#include "ctr_boundary_2d.hh" - -namespace voro { - -/** The class constructor initializes constants from the container class, and - * sets up the mask and queue used for Voronoi computations. - * \param[in] con_ a reference to the container class to use. - * \param[in] (hx_,hy_) the size of the mask to use. */ -template -voro_compute_2d::voro_compute_2d(c_class_2d &con_,int hx_,int hy_) : - con(con_), boxx(con_.boxx), boxy(con_.boxy), xsp(con_.xsp), - ysp(con_.ysp), hx(hx_), hy(hy_), hxy(hx_*hy_), ps(con_.ps), - id(con_.id), p(con_.p), co(con_.co), bxsq(boxx*boxx+boxy*boxy), - mv(0), qu_size(2*(2+hx+hy)), wl(con_.wl), mrad(con_.mrad), - mask(new unsigned int[hxy]), qu(new int[qu_size]), qu_l(qu+qu_size) { - reset_mask(); -} - -/** Scans all of the particles within a block to see if any of them have a - * smaller distance to the given test vector. If one is found, the routine - * updates the minimum distance and store information about this particle. - * \param[in] ij the index of the block. - * \param[in] (x,y) the test vector to consider (which may have already had a - * periodic displacement applied to it). - * \param[in] (di,dj) the coordinates of the current block, to store if the - * particle record is updated. - * \param[in,out] w a reference to a particle record in which to store - * information about the particle whose Voronoi cell the - * vector is within. - * \param[in,out] mrs the current minimum distance, that may be updated if a - * closer particle is found. */ -template -inline void voro_compute_2d::scan_all(int ij,double x,double y,int di,int dj,particle_record_2d &w,double &mrs) { - double x1,y1,rs;bool in_block=false; - for(int l=0;l -void voro_compute_2d::find_voronoi_cell(double x,double y,int ci,int cj,int ij,particle_record_2d &w,double &mrs) { - double qx=0,qy=0,rs; - int i,j,di,dj,ei,ej,f,g,disp; - double fx,fy,mxs,mys,*radp; - unsigned int q,*e,*mij; - - // Init setup for parameters to return - w.ij=-1;mrs=large_number; - - con.initialize_search(ci,cj,ij,i,j,disp); - - // Test all particles in the particle's local region first - scan_all(ij,x,y,0,0,w,mrs); - - // Now compute the fractional position of the particle within its - // region and store it in (fx,fy). We use this to compute an index - // (di,dj) of which subregion the particle is within. - unsigned int m1,m2; - con.frac_pos(x,y,ci,cj,fx,fy); - di=int(fx*xsp*wl_fgrid_2d);dj=int(fy*ysp*wl_fgrid_2d); - - // The indices (di,dj) tell us which worklist to use, to test the - // blocks in the optimal order. But we only store worklists for the - // eighth of the region where di, dj, and dk are all less than half the - // full grid. The rest of the cases are handled by symmetry. In this - // section, we detect for these cases, by reflecting high values of di, - // dj. For these cases, a mask is constructed in m1 and m2 - // which is used to flip the worklist information when it is loaded. - if(di>=wl_hgrid_2d) { - mxs=boxx-fx; - m1=127+(3<<21);m2=1+(1<<21);di=wl_fgrid_2d-1-di;if(di<0) di=0; - } else {m1=m2=0;mxs=fx;} - if(dj>=wl_hgrid_2d) { - mys=boxy-fy; - m1|=(127<<7)+(3<<24);m2|=(1<<7)+(1<<24);dj=wl_fgrid_2d-1-dj;if(dj<0) dj=0; - } else mys=fy; - - // Do a quick test to account for the case when the minimum radius is - // small enought that no other blocks need to be considered - rs=con.r_max_add(mrs); - if(mxs*mxs>rs&&mys*mys>rs) return; - - // Now compute which worklist we are going to use, and set radp and e to - // point at the right offsets - ij=di+wl_hgrid_2d*dj; - radp=mrad+ij*wl_seq_length_2d; - e=(const_cast (wl))+ij*wl_seq_length_2d; - - // Read in how many items in the worklist can be tested without having to - // worry about writing to the mask - f=e[0];g=0; - do { - - // If mrs is less than the minimum distance to any untested - // block, then we are done - if(con.r_max_add(mrs)>7)&127;dj-=64; - - // Check that the worklist position is in range - ei=di+i;if(ei<0||ei>=hx) continue; - ej=dj+j;if(ej<0||ej>=hy) continue; - - // Call the compute_min_max_radius() function. This returns - // true if the minimum distance to the block is bigger than the - // current mrs, in which case we skip this block and move on. - // Otherwise, it computes the maximum distance to the block and - // returns it in crs. - if(compute_min_radius(di,dj,fx,fy,mrs)) continue; - - // Now compute which region we are going to loop over, adding a - // displacement for the periodic cases - ij=con.region_index(ci,cj,ei,ej,qx,qy,disp); - - // If mrs is bigger than the maximum distance to the block, - // then we have to test all particles in the block for - // intersections. Otherwise, we do additional checks and skip - // those particles which can't possibly intersect the block. - scan_all(ij,x-qx,y-qy,di,dj,w,mrs); - } while(g>7)&127;dj-=64; - - // Compute the position in the mask of the current block. If - // this lies outside the mask, then skip it. Otherwise, mark - // it. - ei=di+i;if(ei<0||ei>=hx) continue; - ej=dj+j;if(ej<0||ej>=hy) continue; - mij=mask+ei+hx*ej; - *mij=mv; - - // Skip this block if it is further away than the current - // minimum radius - if(compute_min_radius(di,dj,fx,fy,mrs)) continue; - - // Now compute which region we are going to loop over, adding a - // displacement for the periodic cases - ij=con.region_index(ci,cj,ei,ej,qx,qy,disp); - scan_all(ij,x-qx,y-qy,di,dj,w,mrs); - - if(qu_e>qu_l-8) add_list_memory(qu_s,qu_e); - scan_bits_mask_add(q,mij,ei,ej,qu_e); - } - - // Do a check to see if we've reached the radius cutoff - if(con.r_max_add(mrs) -inline void voro_compute_2d::add_to_mask(int ei,int ej,int *&qu_e) { - unsigned int *mij=mask+ei+hx*ej; - if(ej>0) if(*(mij-hx)!=mv) {if(qu_e==qu_l) qu_e=qu;*(mij-hx)=mv;*(qu_e++)=ei;*(qu_e++)=ej-1;} - if(ei>0) if(*(mij-1)!=mv) {if(qu_e==qu_l) qu_e=qu;*(mij-1)=mv;*(qu_e++)=ei-1;*(qu_e++)=ej;} - if(ei -inline void voro_compute_2d::scan_bits_mask_add(unsigned int q,unsigned int *mij,int ei,int ej,int *&qu_e) { - const unsigned int b1=1<<21,b2=1<<22,b3=1<<24,b4=1<<25; - if((q&b2)==b2) { - if(ei>0) {*(mij-1)=mv;*(qu_e++)=ei-1;*(qu_e++)=ej;} - if((q&b1)==0&&ei0) {*(mij-hx)=mv;*(qu_e++)=ei;*(qu_e++)=ej-1;} - if((q&b3)==0&&ej -template -bool voro_compute_2d::compute_cell(v_cell_2d &c,int ij,int s,int ci,int cj) { - static const int count_list[8]={7,11,15,19,26,35,45,59},*count_e=count_list+8; - double x,y,x1,y1,qx=0,qy=0; - double xlo,ylo,xhi,yhi,x2,y2,rs; - int i,j,di,dj,ei,ej,f,g,l,disp; - double fx,fy,gxs,gys,*radp; - unsigned int q,*e,*mij; - - // Initialize the Voronoi cell to fill the entire container - if(!con.initialize_voronoicell(c,ij,s,ci,cj,i,j,x,y,disp)) return false; - con.r_init(ij,s); - if(!con.boundary_cuts(c,ij,x,y)) return false; - - double crs,mrs; - int next_count=3,*count_p=(const_cast (count_list)); - - // Test all particles in the particle's local region first - for(l=0;l=wl_hgrid_2d) { - gxs=fx; - m1=127+(3<<21);m2=1+(1<<21);di=wl_fgrid_2d-1-di;if(di<0) di=0; - } else {m1=m2=0;gxs=boxx-fx;} - if(dj>=wl_hgrid_2d) { - gys=fy; - m1|=(127<<7)+(3<<24);m2|=(1<<7)+(1<<24);dj=wl_fgrid_2d-1-dj;if(dj<0) dj=0; - } else gys=boxy-fy; - gxs*=gxs;gys*=gys; - - // Now compute which worklist we are going to use, and set radp and e to - // point at the right offsets - ij=di+wl_hgrid_2d*dj; - radp=mrad+ij*wl_seq_length_2d; - e=(const_cast (wl))+ij*wl_seq_length_2d; - - // Read in how many items in the worklist can be tested without having to - // worry about writing to the mask - f=e[0];g=0; - do { - - // At the intervals specified by count_list, we recompute the - // maximum radius squared - if(g==next_count) { - mrs=c.max_radius_squared(); - if(count_p!=count_e) next_count=*(count_p++); - } - - // If mrs is less than the minimum distance to any untested - // block, then we are done - if(con.r_ctest(radp[g],mrs)) return true; - g++; - - // Load in a block off the worklist, permute it with the - // symmetry mask, and decode its position. These are all - // integer bit operations so they should run very fast. - q=e[g];q^=m1;q+=m2; - di=q&127;di-=64; - dj=(q>>7)&127;dj-=64; - - // Check that the worklist position is in range - ei=di+i;if(ei<0||ei>=hx) continue; - ej=dj+j;if(ej<0||ej>=hy) continue; - - // Call the compute_min_max_radius() function. This returns - // true if the minimum distance to the block is bigger than the - // current mrs, in which case we skip this block and move on. - // Otherwise, it computes the maximum distance to the block and - // returns it in crs. - if(compute_min_max_radius(di,dj,fx,fy,gxs,gys,crs,mrs)) continue; - - // Now compute which region we are going to loop over, adding a - // displacement for the periodic cases - ij=con.region_index(ci,cj,ei,ej,qx,qy,disp); - if(!con.boundary_cuts(c,ij,x,y)) return false; - - // If mrs is bigger than the maximum distance to the block, - // then we have to test all particles in the block for - // intersections. Otherwise, we do additional checks and skip - // those particles which can't possibly intersect the block. - if(co[ij]>0) { - l=0;x2=x-qx;y2=y-qy; - if(!con.r_ctest(crs,mrs)) { - do { - if(con.skip(ij,l,x,y)) {l++;continue;} - x1=p[ij][ps*l]-x2; - y1=p[ij][ps*l+1]-y2; - rs=con.r_scale(x1*x1+y1*y1,ij,l); - if(!c.nplane(x1,y1,rs,id[ij][l])) return false; - l++; - } while (l>7)&127;dj-=64; - - // Compute the position in the mask of the current block. If - // this lies outside the mask, then skip it. Otherwise, mark - // it. - ei=di+i;if(ei<0||ei>=hx) continue; - ej=dj+j;if(ej<0||ej>=hy) continue; - mij=mask+ei+hx*ej; - *mij=mv; - - // Call the compute_min_max_radius() function. This returns - // true if the minimum distance to the block is bigger than the - // current mrs, in which case we skip this block and move on. - // Otherwise, it computes the maximum distance to the block and - // returns it in crs. - if(compute_min_max_radius(di,dj,fx,fy,gxs,gys,crs,mrs)) continue; - - // Now compute which region we are going to loop over, adding a - // displacement for the periodic cases - ij=con.region_index(ci,cj,ei,ej,qx,qy,disp); - if(!con.boundary_cuts(c,ij,x,y)) return false; - - // If mrs is bigger than the maximum distance to the block, - // then we have to test all particles in the block for - // intersections. Otherwise, we do additional checks and skip - // those particles which can't possibly intersect the block. - if(co[ij]>0) { - l=0;x2=x-qx;y2=y-qy; - if(!con.r_ctest(crs,mrs)) { - do { - if(con.skip(ij,l,x,y)) {l++;continue;} - x1=p[ij][ps*l]-x2; - y1=p[ij][ps*l+1]-y2; - rs=con.r_scale(x1*x1+y1*y1,ij,l); - if(!c.nplane(x1,y1,rs,id[ij][l])) return false; - l++; - } while (lqu_l-8) add_list_memory(qu_s,qu_e); - - // Test the parts of the worklist element which tell us what - // neighbors of this block are not on the worklist. Store them - // on the block list, and mark the mask. - scan_bits_mask_add(q,mij,ei,ej,qu_e); - } - - // Do a check to see if we've reached the radius cutoff - if(con.r_ctest(radp[g],mrs)) return true; - - // We were unable to completely compute the cell based on the blocks in - // the worklist, so now we have to go block by block, reading in items - // off the list - while(qu_s!=qu_e) { - - // If we reached the end of the list memory loop back to the - // start - if(qu_s==qu_l) qu_s=qu; - - // Read in a block off the list, and compute the upper and lower - // coordinates in each of the three dimensions - ei=*(qu_s++);ej=*(qu_s++); - xlo=(ei-i)*boxx-fx;xhi=xlo+boxx; - ylo=(ej-j)*boxy-fy;yhi=ylo+boxy; - - // Carry out plane tests to see if any particle in this block - // could possibly intersect the cell - if(ei>i) { - if(ej>j) { - if(corner_test(c,xlo,ylo,xhi,yhi)) continue; - } else if(ejj) { - if(corner_test(c,xhi,ylo,xlo,yhi)) continue; - } else if(ejj) { - if(edge_y_test(c,xlo,ylo,xhi)) continue; - } else if(ej0) { - l=0;x2=x-qx;y2=y-qy; - do { - if(con.skip(ij,l,x,y)) {l++;continue;} - x1=p[ij][ps*l]-x2; - y1=p[ij][ps*l+1]-y2; - rs=con.r_scale(x1*x1+y1*y1,ij,l); - if(!c.nplane(x1,y1,rs,id[ij][l])) return false; - l++; - } while (l -template -inline bool voro_compute_2d::corner_test(v_cell_2d &c,double xl,double yl,double xh,double yh) { - con.r_prime(xl*xl+yl*yl); - if(c.plane_intersects_guess(xl,yh,con.r_cutoff(xl*xl+yl*yh))) return false; -// if(c.plane_intersects(xl,yl,con.r_cutoff(xl*xl+yl*yl))) return false; XXX not needed? - if(c.plane_intersects(xh,yl,con.r_cutoff(xl*xh+yl*yl))) return false; - return true; -} - -/** This function checks to see whether a particular block can possibly have - * any intersection with a Voronoi cell, for the case when the closest point - * from the cell center to the block is on a face aligned with the x direction. - * \param[in,out] c a reference to a Voronoi cell. - * \param[in] xl the minimum distance from the cell center to the face. - * \param[in] (y0,y1) the minimum and maximum relative y coordinates of the - * block. - * \param[in] (z0,z1) the minimum and maximum relative z coordinates of the - * block. - * \return False if the block may intersect, true if does not. */ -template -template -inline bool voro_compute_2d::edge_x_test(v_cell_2d &c,double xl,double y0,double y1) { - con.r_prime(xl*xl); - if(c.plane_intersects_guess(xl,y0,con.r_cutoff(xl*xl))) return false; - if(c.plane_intersects(xl,y1,con.r_cutoff(xl*xl))) return false; - return true; -} - -/** This function checks to see whether a particular block can possibly have - * any intersection with a Voronoi cell, for the case when the closest point - * from the cell center to the block is on a face aligned with the y direction. - * \param[in,out] c a reference to a Voronoi cell. - * \param[in] yl the minimum distance from the cell center to the face. - * \param[in] (x0,x1) the minimum and maximum relative x coordinates of the - * block. - * \param[in] (z0,z1) the minimum and maximum relative z coordinates of the - * block. - * \return False if the block may intersect, true if does not. */ -template -template -inline bool voro_compute_2d::edge_y_test(v_cell_2d &c,double x0,double yl,double x1) { - con.r_prime(yl*yl); - if(c.plane_intersects_guess(x0,yl,con.r_cutoff(yl*yl))) return false; - if(c.plane_intersects(x1,yl,con.r_cutoff(yl*yl))) return false; - return true; -} - -/** This routine checks to see whether a point is within a particular distance - * of a nearby region. If the point is within the distance of the region, then - * the routine returns true, and computes the maximum distance from the point - * to the region. Otherwise, the routine returns false. - * \param[in] (di,dj) the position of the nearby region to be tested, - * relative to the region that the point is in. - * \param[in] (fx,fy) the displacement of the point within its region. - * \param[in] (gxs,gys) the maximum squared distances from the point to the - * sides of its region. - * \param[out] crs a reference in which to return the maximum distance to the - * region (only computed if the routine returns positive). - * \param[in] mrs the distance to be tested. - * \return False if the region is further away than mrs, true if the region in - * within mrs.*/ -template -bool voro_compute_2d::compute_min_max_radius(int di,int dj,double fx,double fy,double gxs,double gys,double &crs,double mrs) { - double xlo,ylo; - if(di>0) { - xlo=di*boxx-fx; - crs=xlo*xlo; - if(dj>0) { - ylo=dj*boxy-fy; - crs+=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=bxsq+2*xlo*boxx+2*ylo*boxy; - } else if(dj<0) { - ylo=(dj+1)*boxy-fy; - crs+=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=bxsq+2*xlo*boxx-2*ylo*boxy; - } else { - if(con.r_ctest(crs,mrs)) return true; - crs+=gys+boxx*(2*xlo+boxx); - } - } else if(di<0) { - xlo=(di+1)*boxx-fx; - crs=xlo*xlo; - if(dj>0) { - ylo=dj*boxy-fy; - crs+=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=bxsq-2*xlo*boxx+2*ylo*boxy; - } else if(dj<0) { - ylo=(dj+1)*boxy-fy; - crs+=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=bxsq-2*xlo*boxx-2*ylo*boxy; - } else { - if(con.r_ctest(crs,mrs)) return true; - crs+=gys+boxx*(-2*xlo+boxx); - } - } else { - if(dj>0) { - ylo=dj*boxy-fy; - crs=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=boxy*(2*ylo+boxy); - } else if(dj<0) { - ylo=(dj+1)*boxy-fy; - crs=ylo*ylo; - if(con.r_ctest(crs,mrs)) return true; - crs+=boxy*(-2*ylo+boxy); - } else voro_fatal_error("Min/max radius function called for central block, which should never\nhappen.",VOROPP_INTERNAL_ERROR); - crs+=gxs; - } - return false; -} - -template -bool voro_compute_2d::compute_min_radius(int di,int dj,double fx,double fy,double mrs) { - double t,crs; - - if(di>0) {t=di*boxx-fx;crs=t*t;} - else if(di<0) {t=(di+1)*boxx-fx;crs=t*t;} - else crs=0; - - if(dj>0) {t=dj*boxy-fy;crs+=t*t;} - else if(dj<0) {t=(dj+1)*boxy-fy;crs+=t*t;} - - return crs>con.r_max_add(mrs); -} - -/** Adds memory to the queue. - * \param[in,out] qu_s a reference to the queue start pointer. - * \param[in,out] qu_e a reference to the queue end pointer. */ -template -inline void voro_compute_2d::add_list_memory(int*& qu_s,int*& qu_e) { - qu_size<<=1; - int *qu_n=new int[qu_size],*qu_c=qu_n; -#if VOROPP_VERBOSE >=2 - fprintf(stderr,"List memory scaled up to %d\n",qu_size); -#endif - if(qu_s<=qu_e) { - while(qu_s::voro_compute_2d(container_2d&,int,int); -template voro_compute_2d::voro_compute_2d(container_poly_2d&,int,int); -template voro_compute_2d::voro_compute_2d(container_boundary_2d&,int,int); -template bool voro_compute_2d::compute_cell(voronoicell_2d&,int,int,int,int); -template bool voro_compute_2d::compute_cell(voronoicell_neighbor_2d&,int,int,int,int); -template void voro_compute_2d::find_voronoi_cell(double,double,int,int,int,particle_record_2d&,double&); -template bool voro_compute_2d::compute_cell(voronoicell_2d&,int,int,int,int); -template bool voro_compute_2d::compute_cell(voronoicell_neighbor_2d&,int,int,int,int); -template void voro_compute_2d::find_voronoi_cell(double,double,int,int,int,particle_record_2d&,double&); -template bool voro_compute_2d::compute_cell(voronoicell_nonconvex_2d&,int,int,int,int); -template bool voro_compute_2d::compute_cell(voronoicell_nonconvex_neighbor_2d&,int,int,int,int); -} diff -Nru voro++-0.5/2d/src/v_compute_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_compute_2d.hh --- voro++-0.5/2d/src/v_compute_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/v_compute_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,135 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file v_compute.hh - * \brief Header file for the 2D voro_compute template and related classes. */ - -#ifndef VOROPP_V_COMPUTE_2D_HH -#define VOROPP_V_COMPUTE_2D_HH - -#include -#include -#include -#include -using namespace std; - -#include "config.hh" -#include "worklist_2d.hh" -#include "cell_2d.hh" -#include "cell_nc_2d.hh" - -namespace voro { - -/** \brief Structure for holding information about a particle. - * - * This small structure holds information about a single particle, and is used - * by several of the routines in the voro_compute template for passing - * information by reference between functions. */ -struct particle_record_2d { - /** The index of the block that the particle is within. */ - int ij; - /** The number of particle within its block. */ - int l; - /** The x-index of the block. */ - int di; - /** The y-index of the block. */ - int dj; -}; - -/** \brief Template for carrying out Voronoi cell computations. */ -template -class voro_compute_2d { - public: - /** A reference to the container class on which to carry out*/ - c_class_2d &con; - /** The size of an internal computational block in the x - * direction. */ - const double boxx; - /** The size of an internal computational block in the y - * direction. */ - const double boxy; - /** The inverse box length in the x direction, set to - * nx/(bx-ax). */ - const double xsp; - /** The inverse box length in the y direction, set to - * ny/(by-ay). */ - const double ysp; - /** The number of boxes in the x direction for the searching mask. */ - const int hx; - /** The number of boxes in the y direction for the searching mask. */ - const int hy; - /** A constant, set to the value of hx multiplied by hy, which - * is used in the routines which step through mask boxes in - * sequence. */ - const int hxy; - /** The number of floating point entries to store for each - * particle. */ - const int ps; - /** This array holds the numerical IDs of each particle in each - * computational box. */ - int **id; - /** A two dimensional array holding particle positions. For the - * derived container_poly class, this also holds particle - * radii. */ - double **p; - /** An array holding the number of particles within each - * computational box of the container. */ - int *co; - voro_compute_2d(c_class_2d &con_,int hx_,int hy_); - /** The class destructor frees the dynamically allocated memory - * for the mask and queue. */ - ~voro_compute_2d() { - delete [] qu; - delete [] mask; - } - template - bool compute_cell(v_cell_2d &c,int ij,int s,int ci,int cj); - void find_voronoi_cell(double x,double y,int ci,int cj,int ij,particle_record_2d &w,double &mrs); - private: - /** A constant set to boxx*boxx+boxy*boxy+boxz*boxz, which is - * frequently used in the computation. */ - const double bxsq; - /** This sets the current value being used to mark tested blocks - * in the mask. */ - unsigned int mv; - /** The current size of the search list. */ - int qu_size; - /** A pointer to the array of worklists. */ - const unsigned int *wl; - /** An pointer to the array holding the minimum distances - * associated with the worklists. */ - double *mrad; - /** This array is used during the cell computation to determine - * which blocks have been considered. */ - unsigned int *mask; - /** An array is used to store the queue of blocks to test - * during the Voronoi cell computation. */ - int *qu; - /** A pointer to the end of the queue array, used to determine - * when the queue is full. */ - int *qu_l; - template - inline bool corner_test(v_cell_2d &c,double xl,double yl,double xh,double yh); - template - inline bool edge_x_test(v_cell_2d &c,double xl,double y0,double y1); - template - inline bool edge_y_test(v_cell_2d &c,double x0,double yl,double x1); - bool compute_min_max_radius(int di,int dj,double fx,double fy,double gx,double gy,double& crs,double mrs); - bool compute_min_radius(int di,int dj,double fx,double fy,double mrs); - inline void add_to_mask(int ei,int ej,int *&qu_e); - inline void scan_bits_mask_add(unsigned int q,unsigned int *mij,int ei,int ej,int *&qu_e); - inline void scan_all(int ij,double x,double y,int di,int dj,particle_record_2d &w,double &mrs); - void add_list_memory(int*& qu_s,int*& qu_e); - /** Resets the mask in cases where the mask counter wraps - * around. */ - inline void reset_mask() { - for(unsigned int *mp=mask;mp -#include - -namespace voro{ - -void v_connect::import(FILE *fp){ - bool neg_label=false,boundary_track=false,start=false; - char *buf(new char[512]); - int i=0,id; - double x, y,pad=.05; - - while(fgets(buf,512,fp)!=NULL) { - - if(strcmp(buf,"#Start\n")==0||strcmp(buf,"# Start\n")==0) { - - // Check that two consecutive start tokens haven't been - // encountered - if(boundary_track) voro_fatal_error("File import error - two consecutive start tokens found",VOROPP_FILE_ERROR); - start=true;boundary_track=true; - - } else if(strcmp(buf,"#End\n")==0||strcmp(buf,"# End\n")==0|| - strcmp(buf,"#End")==0||strcmp(buf,"# End")==0) { - - // Check that two consecutive end tokens haven't been - // encountered - if(start) voro_fatal_error("File import error - end token immediately after start token",VOROPP_FILE_ERROR); - if(!boundary_track) voro_fatal_error("File import error - found end token without start token",VOROPP_FILE_ERROR); - vbd[i-1]|=2;boundary_track=false; - } else { - if(!boundary_track && bd==-1) bd=i; - // Try and read three entries from the line - if(sscanf(buf,"%d %lg %lg",&id,&x,&y)!=3) voro_fatal_error("File import error #1",VOROPP_FILE_ERROR); - vid.push_back(id); - vpos.push_back(x); - vpos.push_back(y); - vbd.push_back(start?1:0); - i++; - - // Determine bounds - if(id<0) neg_label=true; - if(id>mid) mid=id; - if(xmaxx) maxx=x; - if(ymaxy) maxy=y; - - start=false; - } - } - - if(boundary_track) voro_fatal_error("File import error - boundary not finished",VOROPP_FILE_ERROR); - if(!feof(fp)) voro_fatal_error("File import error #2",VOROPP_FILE_ERROR); - delete [] buf; - - // Add small amount of padding to container bounds - double dx=maxx-minx,dy=maxy-miny; - minx-=pad*dx;maxx+=pad*dx;dx+=2*pad*dx; - miny-=pad*dy;maxy+=pad*dy;dy+=2*pad*dy; - - // Guess the optimal computationl grid, aiming at eight particles per - // grid square - double lscale=sqrt(8.0*dx*dy/i); - nx=(int)(dx/lscale)+1,ny=(int)(dy/lscale)+1; - ng=i; - gen_to_vert= new vector[i]; - gen_to_ed= new vector[i]; - gen_to_gen_e= new vector[i]; - gen_to_gen_v=new vector[i]; - generator_is_vertex=new int[i]; - for(int j=0;j gens; - vector *pvert_to_gen= new vector[pcurrent_vertices]; - vector *pgen_to_vert=new vector[ng]; - vector problem_verts; - vector problem_verts21; - vector problem_verts32; - vector problem_gen_to_vert; - double gx1,gy1,gx2,gy2; - double *pvertl=new double[2*pcurrent_vertices]; - unsigned int *globvertc=new unsigned int[2*(ng+1)*ng*ng]; - - for(int i=0;i<2*((ng+1)*ng*ng);i++){ - globvertc[i]=0; - } - - cout << "2.1" << endl; - - double x,y,vx,vy; - // Create container - container_boundary_2d con(minx,maxx,miny,maxy,nx,ny,false,false,16); - - // Import data - for(j=0;j-tolerance) && ((gx1*gy2)-(gy1*gx2))0){ - g1=gens[0]; g2=gens[1]; - }else{ - g1=gens[1]; g2=gens[0]; - } - if(globvertc[2*((ng*ng*g1)+(ng*g2))]!=0){ - seencv=true; - globvertc[2*((ng*ng*g1)+(ng*g2))]+=1; - cvi=globvertc[2*((ng*ng*g1)+(ng*g2))+1]; - pgen_to_vert[id].push_back(cvi); - if(cv==0) fvi=cvi; - }else{ - seencv=false; - if(pcurrent_vertices==vert_size){ - pcurrent_vertices<<=1; - add_memory_vector(pvert_to_gen,pcurrent_vertices); - add_memory_array(pvertl,pcurrent_vertices); - - } - pgen_to_vert[id].push_back(vert_size); - pvertl[2*vert_size]=vx; - pvertl[2*vert_size+1]=vy; - pvert_to_gen[vert_size]=gens; - globvertc[2*((ng*ng*g1)+(ng*g2))]=(unsigned int)1; - globvertc[2*((ng*ng*g1)+(ng*g2))+1]=vert_size; - cvi=vert_size; - if(cv==0) fvi=cvi; - vert_size++; - } - }else{ - arrange_cc_x_to_gen(gens,vx,vy); - g1=gens[0];g2=gens[1];g3=gens[2]; - if(g1-tolerance) && ((gx1*gy2)-(gy1*gx2))0){ - g1=gens[0]; g2=gens[1]; - }else{ - g1=gens[1]; g2=gens[0]; - } - if(globvertc[2*((ng*ng*g1)+(ng*g2))]!=2){ - problem_verts21.push_back(i); - } - else{ - if(j==current_vertices){ - add_memory_vertices(); - } - vertl[2*j]=pvertl[2*i]; - vertl[2*j+1]=pvertl[2*i+1]; - vert_to_gen[j]=pvert_to_gen[i]; - pmap[i]=j; - j++; - } - }else{ - g1=gens[0];g2=gens[1];g3=gens[2]; - if(g10){ - for(int i=0;i0){ - - if(nv==current_vertices) add_memory_vertices(); - gens=pvert_to_gen[problem_verts[0]]; - vx=pvertl[2*problem_verts[0]];vy=pvertl[2*problem_verts[0]+1]; - standard=pow(vx-vpos[2*mp[gens[0]]],2)+pow(vy-vpos[2*mp[gens[0]]+1],2); - g1=gens[0];g2=gens[1]; - pmap[problem_verts[0]]=nv; - problem_verts.erase(problem_verts.begin()); - i=0; - while(true){ - g3=not_these_two(pvert_to_gen[problem_verts[i]],g1,g2); - if(g3!=-1){ - distance=pow(vx-vpos[2*mp[g3]],2)+pow(vy-vpos[2*mp[g3]+1],2); - } - if(contains_two(pvert_to_gen[problem_verts[i]],g1,g2) && - (distance<(standard+tolerance) && (distance>(standard-tolerance)))){ - if(g3==gens[0]){ - pmap[problem_verts[i]]=nv; - problem_verts.erase(problem_verts.begin()+i); - break; - } - if(g3!=gens[2]) gens.push_back(g3); - pmap[problem_verts[i]]=nv; - g2=g3; - g1=pvert_to_gen[problem_verts[i]][0]; - if(problem_verts.size()>1){ - problem_verts.erase(problem_verts.begin()+i); - }else{ - break; - } - i=0; - }else{ - i++; - } - } - - vertl[2*nv]=vx; - vertl[2*nv+1]=vy; - arrange_cc_x_to_gen(gens,vx,vy); - vert_to_gen[nv]=gens; - nv++; - - } - delete [] pvert_to_gen; - delete [] pvertl; - delete [] globvertc; - cout << "2.4" << endl; - //assemble edge data structures - ed_to_vert=new int[2*pne]; - vert_to_ed=new vector[nv]; - unsigned int* globedgec=new unsigned int[nv*nv]; - for(int i=0;i<(nv*nv);i++){ - globedgec[i]=0; - } - for(int i=0;i[ne]; - //though neither ed_on_bd or vert_on_bd are modified during this method, they are initialized here in case the user - //does not require boundary information and will not be calling assemble_boundary - ed_on_bd=new vector[ne]; - vert_on_bd=new vector[nv]; - vector gens; - int g1,g2,v1,v2,j,vi; - double gx1,gy1,gx2,gy2,vx1,vy1,vx2,vy2; - cout << "gen_ed 2" << endl; - for(int i=0;i v_connect::groom_vertexg_help(double x,double y,double vx, double vy,vector &g){ - if(g.size()<2) return g; - bool rightside=false; - int g0=g[0],g1,bestg,besti; - double d1; - double standard=pow((vpos[2*mp[g0]]-vx),2)+pow((vpos[2*mp[g0]+1]-vy),2); - double gx0,gy0,gx1,gy1,best,current; - vector newg,temp; - temp.push_back(g0); - for(int i=1;i0){ - rightside=true; - } - best=dot_product(gx0-vx,gy0-vy,gx1-vx,gy1-vy); - bestg=g1; - besti=1; - for(int i=2;i0){ - if(!rightside){ - rightside=true; - best=dot_product(gx0-vx,gy0-vy,gx1-vx,gy1-vy); - bestg=g1; - besti=i; - }else{ - current=dot_product(gx0-vx,gy0-vy,gx1-vx,gy1-vy); - if(current>best){ - best=current; - bestg=g1; - besti=i; - } - } - }else{ - if(rightside) continue; - else{ - current=dot_product(gx0-vx,gy0-vy,gx1-vx,gy1-vy); - if(currentbest){ - best=current; - bestg=g1; - } - } - }else{ - if(rightside) continue; - else{ - current=dot_product(gx0-vx,gy0-vx,gx1-vx,gy1-vy); - if(current v_connect::groom_vertexg_help2(double x,double y,double vx,double vy,vector &g){ - if(g.size()<2) return g; - int m0=g[0],m1=g[1],m2,p,i=1; - double d0=pow((vpos[2*mp[m0]]-x),2)+pow((vpos[2*mp[m0]+1]-y),2); - double d1=pow((vpos[2*mp[m1]]-vx),2)+pow((vpos[2*mp[m1]+1]-vy),2); - double d2; - double standard=pow((vpos[2*mp[m0]]-vx),2)+pow((vpos[2*mp[m0]+1]-vy),2); - double dp,dcompare, temp; - vector newg; - while(d1>=standard+tolerance){ - if(i==g.size()-1){ - newg.push_back(m0); - return newg; - } - i++; - m1=g[i]; - d1=pow((vpos[2*mp[m1]]-vx),2)+pow((vpos[2*mp[m1]+1]-vy),2); - } - if(i==g.size()-1){ - newg.push_back(m0); - newg.push_back(m1); - return newg; - } - i++; - m2=g[i]; - d2=pow((vpos[2*mp[m2]]-vx),2)+pow((vpos[2*mp[m2]+1]-vy),2); - while(d2>=standard+tolerance){ - if(i==g.size()-1){ - newg.push_back(m0); - newg.push_back(m1); - return newg; - } - i++; - m2=g[i]; - d2=pow((vpos[2*mp[m2]]-vx),2)+pow((vpos[2*mp[m2]+1]-vy),2); - } - if(i==g.size()-1){ - newg.push_back(m0); - newg.push_back(m1); - newg.push_back(m2); - return newg; - } - i++; - d1=pow((vpos[2*mp[m1]]-x),2)+pow((vpos[2*mp[m1]+1]-y),2); - d2=pow((vpos[2*mp[m2]]-x),2)+pow((vpos[2*mp[m2]+1]-y),2); - if(d0 &list,double cx,double cy){ - if(list.size()==0) return; - bool wrongside; - int g1,ng,ni; - double x1,y1,x2,y2,best,current; - vector newlist; - vector potential; - newlist.push_back(list[0]); - x1=vpos[2*mp[list[0]]];y1=vpos[2*mp[list[0]]+1]; - list.erase(list.begin()); - while(list.size()>0){ - wrongside=true; - for(int i=0;i=0){ - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(wrongside){ - ng=g1; - ni=i; - best=current; - wrongside=false; - }else if(current>best){ - best=current; - ng=g1; - ni=i; - } - }else{ - if(!wrongside) continue; - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(i==0){ - best=current; - ng=g1; - ni=i; - }else if(current &list,double cx,double cy){ - if(list.size()==0) return; - bool wrongside; - int g1,ng,ni; - double x1,y1,x2,y2,best,current; - vector newlist; - vector potential; - newlist.push_back(list[0]); - x1=vertl[2*list[0]];y1=vertl[2*list[0]+1]; - list.erase(list.begin()); - while(list.size()>0){ - wrongside=true; - for(int i=0;i=0){ - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(wrongside){ - ng=g1; - ni=i; - best=current; - wrongside=false; - }else if(current>best){ - best=current; - ng=g1; - ni=i; - } - }else{ - if(!wrongside) continue; - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(i==0){ - best=current; - ng=g1; - ni=i; - }else if(current &list){ - vector newlist; - int v1,v2,ed,i=0; - newlist.push_back(list[0]); - list.erase(list.begin()); - if(newlist[0]<0){ - ed=~newlist[0]; - v1=ed_to_vert[2*ed]; - }else{ - ed=newlist[0]; - v1=ed_to_vert[2*ed+1]; - } - while(list.size()>0){ - if(list[i]>=0){ - v2=ed_to_vert[2*list[i]]; - if(v2==v1){ - v1=ed_to_vert[2*list[i]+1]; - newlist.push_back(list[i]); - list.erase(list.begin()+i); - i=0; - }else i++; - }else{ - v2=ed_to_vert[2*(~list[i])+1]; - - if(v2==v1){ - v1=ed_to_vert[2*(~list[i])]; - newlist.push_back(list[i]); - list.erase(list.begin()+i); - i=0; - }else i++; - } - } - list=newlist; -} - -void v_connect::arrange_cc_vert_to_ed(vector &list,double cx, double cy,int id){ - - if(list.size()==0) return; - bool wrongside; - int g1,ng,ni,index; - double x1,y1,x2,y2,best,current; - vector newlist; - vector potential; - newlist.push_back(list[0]); - if(ed_to_vert[2*list[0]]==id) index=ed_to_vert[2*list[0]+1]; - else index=ed_to_vert[2*list[0]]; - x1=vertl[2*index];y1=vertl[2*index+1]; - list.erase(list.begin()); - while(list.size()>0){ - wrongside=true; - for(int i=0;i=0){ - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(wrongside){ - ng=g1; - ni=i; - best=current; - wrongside=false; - }else if(current>best){ - best=current; - ng=g1; - ni=i; - } - }else{ - if(!wrongside) continue; - current=dot_product(cx-x1,cy-y1,cx-x2,cy-y2); - if(i==0){ - best=current; - ng=g1; - ni=i; - }else if(current=0) fprintf(fp,"\t %i\n",gen_to_ed[i][k]); - else fprintf(fp,"\t -%i\n",~gen_to_ed[i][k]); - } - fprintf(fp,"\n\n"); - } -} - -void v_connect::print_gen_to_vert_table(FILE *fp){ - fprintf(fp,"generator to vertex connectivity, arranged conterclockwise\n\n"); - for(int i=0;i *nvert_to_gen(new vector[current_vertices]); - for(int i=0;i<(current_vertices>>1);i++){ - nvert_to_gen[i]=vert_to_gen[i]; - } - delete [] vert_to_gen;vert_to_gen=nvert_to_gen; - cout << "2.2.3" << endl; - //copy vertex_is_generator - int *nvertex_is_generator(new int[current_vertices]),*nvig(nvertex_is_generator),*vig(vertex_is_generator),*nvige(nvertex_is_generator+current_vertices); - while(vig[ng]; - cout << "2" << endl; - delete [] gen_to_gen_v; - gen_to_gen_v=new vector[ng]; - cout << "3" << endl; - delete [] gen_to_ed; - gen_to_ed=new vector[ng]; - cout << "4" << endl; - delete [] gen_to_vert; - gen_to_vert=new vector[ng]; - cout << "5" << endl; - delete [] vertl; - vertl=new double[2*init_vertices]; - cout << "6" << endl; - delete [] vert_to_gen; - vert_to_gen=new vector[init_vertices]; - cout << "7" << endl; - delete [] vertex_is_generator; - cout << "7.1" << endl; - vertex_is_generator=new int[init_vertices]; - cout << "7.2" << endl; - for(int k=0;kepsilon); - fclose(fp); - delete [] outfn1; -} - -void v_connect::draw_median_mesh(FILE *fp){ - double ex,ey,cx,cy; - int e; - for(int i=0;i -#include -#include -#include -namespace voro{ - -class v_connect{ - public: - double minx,maxx,miny,maxy; - int nx,ny; - vector vid; - vector vpos; - vector vbd; - int bd; - //# of generators - int ng; - //middle generator id - int mid; - //current size of vertl array/2 - int current_vertices; - //number of vertices - int nv; - //for all i>=degenerate_vertices, the ith vertex is degenerate - int degenerate_vertices; - //current size of ed_to_vert array - int current_edges; - //number of edges - int ne; - //maps a generator's id to the place it was recieved in the input file - //i.e. if the first particle in the input file has id 20, then mp[20]=0; - int *mp; - //vertl[2*i]=x coordinate of ith vertex - double *vertl; - //vert_to_gen[i]= vector containing list of generators that ith vertex is touching - vector *vert_to_gen; - //vert_to_ed[i]= vector containing list of edges that the i'th vertex is a member of - vector *vert_to_ed; - //vert_on_bd[i].size()==0 if vertex i is not on boundary. if vertex i is on boundary it is a size 2 vector of the generators that define the part of the boundary it is on - vector *vert_on_bd; - //gen_to_vert[i]= list of vertices that ith generatos is touching in cc order - vector *gen_to_vert; - //gen_to_edge[i]= list of edges that the ith generator is touching in cc order (- edge number means ~edge number with reverse orientation - vector *gen_to_ed; - //gen_to_gen_e[i]= list of neighbors of ith generator through edges in cc order - vector *gen_to_gen_e; - //gen_to_gen_v[i]= list of neighbors of ith generator through degenerate vertices in cc order - vector *gen_to_gen_v; - //ed_to_vert[2*i(+1)]=the vertex with the lower(higher) id constituting edge i - int *ed_to_vert; - //ed_to_gen[2*i(+1)]=the generator with the left-hand(right-hand) orientation touching the edge - vector *ed_to_gen; - //ed_on_bd[i].size()==0 if edge i is not on the boundary. if it is, ed_on_bd[i] is a 2 element list of the generators that define that part of the boundary that it is on - vector *ed_on_bd; - //vertex_is_generator[i]=(-1 if ith vertex is not a generator)(j if ith vertex is generator j) - int *vertex_is_generator; - //see above - int *generator_is_vertex; - - v_connect(){ - bd=-1; - nv=0; - ne=0; - //ng initialized during import routine. - minx=large_number; - maxx=-minx; - miny=minx; - maxy=maxx; - current_vertices=init_vertices; - current_edges=init_vertices; - vertl=new double[2*current_vertices]; - vert_to_gen= new vector[current_vertices]; - vertex_is_generator=new int[current_vertices]; - for(int i=0;i groom_vertexg_help(double x, double y,double vx, double vy, vector &g); - vector groom_vertexg_help2(double x,double y,double vx,double vy,vector &g); - inline void groom_vertexg(voronoicell_nonconvex_neighbor_2d &c){ - double x=vpos[2*mp[c.my_id]],y=vpos[2*mp[c.my_id]+1]; - for(int i=0;i* &old,int size){ - vector *newv=new vector[size]; - for(int i=0;i<(size>>1);i++){ - newv[i]=old[i]; - } - delete [] old; - old=newv; - } - inline void add_memory_array(double* &old,int size){ - double *newa= new double[2*size]; - for(int i=0;i<(size);i++){ - newa[i]=old[i]; - } - delete [] old; - old=newa; - } - inline void add_memory_array(int* &old,int size){ - int *newa=new int[2*size]; - for(int i=0;i>1)*(size>>1))/32)+1);i++){ - newt[i]=old[i]; - } - delete [] old; - old=newt; - } - //return true if vector contains the two elements - inline bool contains_two(vector &a,int b, int c){ - int i=0,j=0; - for(int k=0;k &a,int b){ - for(int i=0;i &a,int b, int c){ - int d=-1; - for(int i=0;i a,vector b,int &g1,int &g2){ - g1=g2=-1; - for(int i=0;i a,vector b,int &g1){ - g1=-1; - for(int i=0;i a,vector b){ - for(int i=0;i a, int b){ - for(int i=0;i a,vector b){ - for(int i=0;i &list,double cx,double cy); - void arrange_cc_gen_to_vert(vector &list,double cx,double cy); - void arrange_cc_gen_to_ed(vector &list); - void arrange_cc_vert_to_ed(vector &list,double cx,double cy,int id); - void assemble_vertex(); - void assemble_gen_ed(); - void assemble_boundary(); - void draw_gnu(FILE *fp=stdout); - inline void draw_gnu(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - draw_gnu(fp); - fclose(fp); - } - void draw_vtg_gnu(FILE *fp=stdout); - inline void draw_vtg_gnu(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - draw_vtg_gnu(fp); - fclose(fp); - } - void draw_gen_gen(FILE *fp=stdout); - inline void draw_gen_gen(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - draw_gen_gen(fp); - fclose(fp); - } - void label_vertices(FILE *fp=stdout); - inline void label_vertices(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - label_vertices(fp); - fclose(fp); - } - void label_generators(FILE *fp=stdout); - inline void label_generators(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - label_generators(fp); - fclose(fp); - } - void label_edges(FILE *fp=stdout); - inline void label_edges(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - label_edges(fp); - fclose(fp); - } - void label_centroids(FILE *fp=stdout); - inline void label_centroids(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - label_centroids(fp); - fclose(fp); - } - void print_gen_to_ed_table(FILE *fp=stdout); - inline void print_gen_to_ed_table(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_gen_to_ed_table(fp); - fclose(fp); - } - void print_gen_to_vert_table(FILE *fp=stdout); - inline void print_gen_to_vert_table(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_gen_to_vert_table(fp); - fclose(fp); - } - void print_vert_to_gen_table(FILE *fp=stdout); - inline void print_vert_to_gen_table(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_vert_to_gen_table(fp); - fclose(fp); - } - void print_ed_to_gen_table(FILE *fp=stdout); - inline void print_ed_to_gen_table(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_ed_to_gen_table(fp); - fclose(fp); - } - void print_vert_to_ed_table(FILE *fp=stdout); - inline void print_vert_to_ed_table(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_vert_to_ed_table(fp); - fclose(fp); - } - void print_vert_boundary(FILE *fp=stdout); - inline void print_vert_boundary(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_vert_boundary(fp); - fclose(fp); - } - void print_ed_boundary(FILE *fp=stdout); - inline void print_ed_boundary(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - print_ed_boundary(fp); - fclose(fp); - } - void add_memory_vertices(); - void ascii_output(FILE *fp=stdout); - inline void ascii_output(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - ascii_output(fp); - fclose(fp); - } - double signed_area(int g); - void centroid(int g,double &x,double &y); - void lloyds(double epsilon); - void draw_median_mesh(FILE *fp=stdout); - inline void draw_median_mesh(const char *filename){ - FILE *fp=safe_fopen(filename,"w"); - draw_median_mesh(fp); - fclose(fp); - } - void draw_closest_generator(FILE *fp,double x,double y); - inline void draw_closest_generator(const char *filename,double x,double y){ - FILE *fp=safe_fopen(filename,"w"); - draw_closest_generator(fp,x,y); - fclose(fp); - } -}; - -} -#endif diff -Nru voro++-0.5/2d/src/voro++_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/voro++_2d.cc --- voro++-0.5/2d/src/voro++_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/voro++_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -#include "common.cc" -#include "cell_2d.cc" -#include "c_loops_2d.cc" -#include "v_base_2d.cc" -#include "container_2d.cc" -#include "v_compute_2d.cc" -#include "wall_2d.cc" -#include "cell_nc_2d.cc" -#include "ctr_boundary_2d.cc" diff -Nru voro++-0.5/2d/src/voro++_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/voro++_2d.hh --- voro++-0.5/2d/src/voro++_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/voro++_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -#ifndef VOROPP_VOROPP_2D_HH -#define VOROPP_VOROPP_2D_HH - -#include "config.hh" -#include "common.hh" -#include "cell_2d.hh" -#include "v_base_2d.hh" -#include "rad_option.hh" -#include "container_2d.hh" -#include "v_compute_2d.hh" -#include "c_loops_2d.hh" -#include "wall_2d.hh" -#include "cell_nc_2d.hh" -#include "ctr_boundary_2d.hh" -#include "ctr_quad_2d.hh" - -#endif diff -Nru voro++-0.5/2d/src/wall_2d.cc voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/wall_2d.cc --- voro++-0.5/2d/src/wall_2d.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/wall_2d.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file wall_2d.cc - * \brief Function implementations for the 2D derived wall classes. */ - -#include "wall_2d.hh" - -namespace voro { - -/** Tests to see whether a point is inside the sphere wall object. - * \param[in,out] (x,y,z) the vector to test. - * \return True if the point is inside, false if the point is outside. */ -bool wall_circle_2d::point_inside(double x,double y) { - return (x-xc)*(x-xc)+(y-yc)*(y-yc) -bool wall_circle_2d::cut_cell_base(v_cell_2d &c,double x,double y) { - double xd=x-xc,yd=y-yc,dq; - dq=xd*xd+yd*yd; - if(dq>1e-5) { - dq=2*(sqrt(dq)*rc-dq); - return c.nplane(xd,yd,dq,w_id); - } - return true; -} - -/** Tests to see whether a point is inside the plane wall object. - * \param[in] (x,y,z) the vector to test. - * \return True if the point is inside, false if the point is outside. */ -bool wall_plane_2d::point_inside(double x,double y) { - return x*xc+y*yc -bool wall_plane_2d::cut_cell_base(v_cell_2d &c,double x,double y) { - double dq=2*(ac-x*xc-y*yc); - return c.nplane(xc,yc,dq,w_id); -} - -// Explicit instantiation -template bool wall_circle_2d::cut_cell_base(voronoicell_2d &c,double x,double y); -template bool wall_circle_2d::cut_cell_base(voronoicell_neighbor_2d &c,double x,double y); -template bool wall_plane_2d::cut_cell_base(voronoicell_2d &c,double x,double y); -template bool wall_plane_2d::cut_cell_base(voronoicell_neighbor_2d &c,double x,double y); - -} diff -Nru voro++-0.5/2d/src/wall_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/wall_2d.hh --- voro++-0.5/2d/src/wall_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/wall_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,65 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file wall_2d.hh - * \brief Header file for the 2D derived wall classes. */ - -#ifndef VOROPP_WALL_2D_HH -#define VOROPP_WALL_2D_HH - -#include "cell_2d.hh" -#include "container_2d.hh" - -namespace voro { - -/** \brief A class representing a circular wall object. - * - * This class represents a circular wall object. */ -struct wall_circle_2d : public wall_2d { - public: - /** Constructs a spherical wall object. - * \param[in] w_id_ an ID number to associate with the wall for - * neighbor tracking. - * \param[in] (xc_,yc_) a position vector for the circle's - * center. - * \param[in] rc_ the radius of the circle. */ - wall_circle_2d(double xc_,double yc_,double rc_,int w_id_=-99) - : w_id(w_id_), xc(xc_), yc(yc_), rc(rc_) {} - bool point_inside(double x,double y); - template - bool cut_cell_base(v_cell_2d &c,double x,double y); - bool cut_cell(voronoicell_2d &c,double x,double y) {return cut_cell_base(c,x,y);} - bool cut_cell(voronoicell_neighbor_2d &c,double x,double y) {return cut_cell_base(c,x,y);} - private: - const int w_id; - const double xc,yc,rc; -}; - -/** \brief A class representing a plane wall object. - * - * This class represents a single plane wall object. */ -struct wall_plane_2d : public wall_2d { - public: - /** Constructs a plane wall object - * \param[in] (xc_,yc_) a normal vector to the plane. - * \param[in] ac_ a displacement along the normal vector. - * \param[in] w_id_ an ID number to associate with the wall for - * neighbor tracking. */ - wall_plane_2d(double xc_,double yc_,double ac_,int w_id_=-99) - : w_id(w_id_), xc(xc_), yc(yc_), ac(ac_) {} - bool point_inside(double x,double y); - template - bool cut_cell_base(v_cell_2d &c,double x,double y); - bool cut_cell(voronoicell_2d &c,double x,double y) {return cut_cell_base(c,x,y);} - bool cut_cell(voronoicell_neighbor_2d &c,double x,double y) {return cut_cell_base(c,x,y);} - private: - const int w_id; - const double xc,yc,ac; -}; - -} - -#endif diff -Nru voro++-0.5/2d/src/worklist_2d.hh voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/worklist_2d.hh --- voro++-0.5/2d/src/worklist_2d.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/worklist_2d.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -// Voro++, a 2D and 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -/** \file worklist_2d.hh - * \brief Header file for setting constants used in the block worklists that are - * used during cell computation. - * - * This file is automatically generated by worklist_gen.pl and it is not - * intended to be edited by hand. */ - -#ifndef VOROPP_WORKLIST_2D_HH -#define VOROPP_WORKLIST_2D_HH - -namespace voro { - -/** Each region is divided into a grid of subregions, and a worklist is -# constructed for each. This parameter sets is set to half the number of -# subregions that the block is divided into. */ -const int wl_hgrid_2d=4; -/** The number of subregions that a block is subdivided into, which is twice -the value of hgrid. */ -const int wl_fgrid_2d=8; -/** The total number of worklists, set to the cube of hgrid. */ -const int wl_hgridsq_2d=16; -/** The number of elements in each worklist. */ -const int wl_seq_length_2d=64; - -} -#endif diff -Nru voro++-0.5/2d/src/worklist_gen.pl voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/worklist_gen.pl --- voro++-0.5/2d/src/worklist_gen.pl 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/2d/src/worklist_gen.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -#!/usr/bin/perl -# Voro++, a 2D and 3D cell-based Voronoi library -# -# Author : Chris H. Rycroft (LBL / UC Berkeley) -# Email : chr@alum.mit.edu -# Date : August 30th 2011 -# -# worklist_gen.pl - this perl script is used to automatically generate the -# worklists of blocks that are stored in worklist.cc, that are used by the -# compute_cell() routine to ensure maximum efficiency - -# Each region is divided into a grid of subregions, and a worklist is -# constructed for each. This parameter sets is set to half the number of -# subregions that the block is divided into. -$hr=4; - -# This parameter is automatically set to the the number of subregions that the -# block is divided into -$r=$hr*2; - -# This parameter sets the total number of block entries in each worklist -$ls=63; - -# When the worklists are being constructed, a mask array is made use of. To -# prevent the creation of array elements with negative indices, this parameter -# sets an arbitrary displacement. -$dis=8; - -# Constants used mask indexing -$d=2*$dis+1;$d0=(1+$d)*$dis; - -use Math::Trig; - -# Construct the worklist header file, based on the parameters above -open W,">worklist_2d.hh"; -print W <v_base_wl_2d.cc"; -print W < $l $xp $yp $zp\n" if $l<4; - push @b,(splice @a,2*$nx,2);$ac--; - } - - # Mark all blocks that are on this worklist entry - $m[$d0]=++$v; - for($i=0;$i<$#b;$i+=2) { - $xt=$b[$i];$yt=$b[$i+1]; - #print "$xt $yt\n"; - $m[$d0+$xt+$d*$yt]=$v; - } - - # Find which neighboring outside blocks need to be marked when - # considering this block, being as conservative as possible by - # overwriting the marks, so that the last possible entry that can reach - # a block is used - for($i=$j=0;$i<$#b;$i+=2,$j++) { - $xt=$b[$i];$yt=$b[$i+1]; - $k=$d0+$xt+$yt*$d; - $la[$k+1]=$j, $m[$k+1]=$v+1 if $xt>=0 && $m[$k+1]!=$v; - $la[$k+$d]=$j, $m[$k+$d]=$v+1 if $yt>=0 && $m[$k+$d]!=$v; - $la[$k-1]=$j, $m[$k-1]=$v+1 if $xt<=0 && $m[$k-1]!=$v; - $la[$k-$d]=$j, $m[$k-$d]=$v+1 if $yt<=0 && $m[$k-$d]!=$v; - } - - # Scan to ensure that no neighboring blocks have been missed by the - # outwards-looking logic in the above section - for($i=0;$i<$#b;$i+=2) { - wl_check($d0+$b[$i]+$b[$i+1]*$d); - } - - # Compute the number of entries where outside blocks do not need to be - # consider - for($i=$j=0;$i<$#b;$i+=2,$j++) { - $k=$d0+$b[$i]+$b[$i+1]*$d; - last if $m[$k+1]!=$v; - last if $m[$k+$d]!=$v; - last if $m[$k-1]!=$v; - last if $m[$k-$d]!=$v; - } - print W "\t$j"; - - # Create worklist entry and save to file - $j=0; - while ($#b>0) { - $xt=shift @b;$yt=shift @b; - $k=$d0+$xt+$yt*$d; - $o=0; - $o|=1 if $m[$k+1]!=$v && $la[$k+1]==$j; - $o^=3 if $m[$k-1]!=$v && $la[$k-1]==$j; - $o|=8 if $m[$k+$d]!=$v && $la[$k+$d]==$j; - $o^=24 if $m[$k-$d]!=$v && $la[$k-$d]==$j; - printf W ",%#x",(($xt+64)|($yt+64)<<7|$o<<21); - $j++; - } - print W "," unless $ind==$hr*$hr-1; - print W "\n"; - - # Remove list memory - undef @a; - undef @b; -} - -sub add { - if ($m[$d0+@_[0]+$d*@_[1]]!=$v) { - $ac++; - push @a,@_[0],@_[1]; - $m[$d0+@_[0]+$d*@_[1]]=$v; - } -} - -sub adis { - $xco=$yco=0; - $xco=@_[0]-@_[2] if @_[2]>0; - $xco=@_[0]-@_[2]-1 if @_[2]<0; - $yco=@_[1]-@_[3] if @_[3]>0; - $yco=@_[1]-@_[3]-1 if @_[3]<0; - return sqrt $xco*$xco+$yco*$yco; -} - -sub wl_check { - die "Failure in worklist construction\n" if $m[@_[0]+1]<$v||$m[@_[0]-1]<$v - ||$m[@_[0]+$d]<$v||$m[@_[0]-$d]<$v; -} diff -Nru voro++-0.5/CMakeLists.txt voro++-0.5+revert-to-0.4.6+dfsg1/CMakeLists.txt --- voro++-0.5/CMakeLists.txt 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -project(voro++ VERSION 0.4.6 LANGUAGES CXX) -set(SOVERSION "0") - -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) - #release comes with -O3 by default - set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) -endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) - -######################################################################## -# User input options # -######################################################################## -option(BUILD_SHARED_LIBS "Build shared libs" ON) -include(GNUInstallDirs) - -######################################################################## -#Find external packages -######################################################################## -find_package(Doxygen) - -###################################### -# Include the following subdirectory # -###################################### - -file(GLOB VORO_SOURCES src/*.cc) -file(GLOB NOT_VORO_SOURCES src/v_base_wl.cc src/cmd_line.cc src/voro++.cc) -list(REMOVE_ITEM VORO_SOURCES ${NOT_VORO_SOURCES}) -add_library(voro++ ${VORO_SOURCES}) -set_target_properties(voro++ PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src" - SOVERSION ${SOVERSION}) -install(TARGETS voro++ EXPORT VORO_Targets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -#for voto++.hh -target_include_directories(voro++ PUBLIC $ $) - -add_executable(cmd_line src/cmd_line.cc) -target_link_libraries(cmd_line PRIVATE voro++) -#cannot have two targets with the same name, so renaming cmd_line -set_target_properties(cmd_line PROPERTIES OUTPUT_NAME voro++ - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/src") -install(TARGETS cmd_line RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -file(GLOB EXAMPLE_SOURCES examples/*/*.cc) -foreach(SOURCE ${EXAMPLE_SOURCES}) - string(REGEX REPLACE "^.*/([^/]*)\\.cc$" "\\1" PROGNAME "${SOURCE}") - if (NOT PROGNAME STREQUAL ellipsoid) #ellipsoid is broken - string(REGEX REPLACE "^.*/(examples/.*)/${PROGNAME}\\.cc$" "\\1" DIRNAME "${SOURCE}") - add_executable(${PROGNAME} ${SOURCE}) - target_link_libraries(${PROGNAME} PRIVATE voro++) - set_target_properties(${PROGNAME} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${DIRNAME}" ) - endif() -endforeach(SOURCE) - -file(GLOB_RECURSE VORO_HEADERS src/voro++.hh) -install(FILES ${VORO_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -install(FILES ${CMAKE_SOURCE_DIR}/man/voro++.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) -# no external deps for we can use target file as config file -install(EXPORT VORO_Targets FILE VOROConfig.cmake NAMESPACE VORO:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VORO) -include(CMakePackageConfigHelpers) -write_basic_package_version_file("VOROConfigVersion.cmake" VERSION ${PROJECT_VERSION} COMPATIBILITY ExactVersion) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/VOROConfigVersion.cmake" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/VORO) - -if (DOXYGEN_FOUND) - add_custom_target(doxygen COMMAND ${DOXYGEN_EXECUTABLE} src/Doxyfile - COMMENT "Build doxygen documentation") -endif (DOXYGEN_FOUND) diff -Nru voro++-0.5/debian/changelog voro++-0.5+revert-to-0.4.6+dfsg1/debian/changelog --- voro++-0.5/debian/changelog 2021-02-08 15:00:36.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/debian/changelog 2021-03-01 19:19:07.000000000 +0000 @@ -1,3 +1,10 @@ +voro++ (0.5+revert-to-0.4.6+dfsg1-1) unstable; urgency=medium + + * New upstream version 0.5+revert-to-0.4.6+dfsg1 + * restored old patchs for v0.4.6 + + -- Roger Wesson Mon, 01 Mar 2021 20:19:07 +0100 + voro++ (0.5-1) unstable; urgency=medium * new upstream release diff -Nru voro++-0.5/debian/patches/cmd_line.cc.patch voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/cmd_line.cc.patch --- voro++-0.5/debian/patches/cmd_line.cc.patch 2021-02-08 15:00:36.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/cmd_line.cc.patch 2021-03-01 19:19:07.000000000 +0000 @@ -6,8 +6,8 @@ // This message gets displayed if the user requests the help flag void help_message() { -- puts("Voro++ version 0.4.6, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" -+ puts("Voro++ version 0.5, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" +- puts("Voro++ version 0.4.5, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" ++ puts("Voro++ version 0.4.6, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" "Syntax: voro++ [options] \n" " \n\n" "By default, the utility reads in the input file of particle IDs and positions,\n" @@ -15,8 +15,8 @@ // Ths message is displayed if the user requests version information void version_message() { -- puts("Voro++ version 0.4.6 (October 17th 2013)"); -+ puts("Voro++ version 0.5 (February 15th 2015)"); +- puts("Voro++ version 0.4.5 (July 27th 2012)"); ++ puts("Voro++ version 0.4.6 (October 17th 2013)"); } // Prints an error message. This is called when the program is unable to make diff -Nru voro++-0.5/debian/patches/examples_Makefile.patch voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/examples_Makefile.patch --- voro++-0.5/debian/patches/examples_Makefile.patch 2021-02-08 15:00:36.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/examples_Makefile.patch 2021-03-01 19:19:07.000000000 +0000 @@ -43,7 +43,7 @@ -include ../../config.mk - # List of executables - EXECUTABLES=single_cell platonic random_points import convex_test + EXECUTABLES=single_cell platonic random_points import --- a/examples/custom/Makefile +++ b/examples/custom/Makefile @@ -79,7 +79,7 @@ -include ../../config.mk - # List of executables - EXECUTABLES=box_cut cut_region superellipsoid irregular l_shape + EXECUTABLES=box_cut cut_region superellipsoid irregular --- a/examples/interface/Makefile +++ b/examples/interface/Makefile diff -Nru voro++-0.5/debian/patches/man.patch voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/man.patch --- voro++-0.5/debian/patches/man.patch 1970-01-01 00:00:00.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/man.patch 2021-03-01 19:19:07.000000000 +0000 @@ -0,0 +1,275 @@ +Author: Roger Wesson +Description: fixes spelling error and encloses .IP entries in quotes +--- a/man/voro++.1 ++++ b/man/voro++.1 +@@ -82,14 +82,14 @@ + The utility accepts the following basic options: + + .B +-.IP \-c ++.IP "\-c " + This option allows the format of the output file to be customized to hold a + variety of statistics about the computed Voronoi cells. The specified string + can contain regular characters, plus control sequences beginning with + percentage signs that are expanded to contain different Voronoi cell + statistics. See below for a full custom output reference. + .B +-.IP \-g ++.IP "\-g" + If this option is specified, then an additional output file is generated with + the ".gnu" extension, which contains a description of all the cells in a format + that can be viewed using gnuplot using the +@@ -97,15 +97,15 @@ + command. Caution: For large input files, the gnuplot output file will be + extremely large, so this option is best used on smaller systems. + .B +-.IP \-h or \-\-help ++.IP "\-h or \-\-help" + This option prints out a summary of the command syntax and the available + options. + .B +-.IP \-hc ++.IP "\-hc" + This option prints out all the available control sequences for the customized + output. + .B +-.IP -l ++.IP "-l " + Manually specify a typical length scale between particles, with which to + configure the internal grid size. For example, if the particles represent + densely-packed hard spheres of diameter d, then d would be an appropriate value +@@ -114,62 +114,62 @@ + can be set up immediately, and it is not necessary to temporarily store the + input file contents while estimating the grid size. + .B +-.IP -m ++.IP "-m " + Manually specify the initial number of particles that can be stored in each + block. By default a value of 8 is used. For any block where this limit is +-reached, the code will dynamically allocate more memory as neccessary, so ++reached, the code will dynamically allocate more memory as necessary, so + usually it is not necessary to alter this. + .B +-.IP -n ++.IP "-n " + Manually specify the internal computational grid to have nx, ny, and nz blocks + in the x, y, and z directions respectively, giving nx*ny*nz blocks in total. + Manually specifying the size will result in a small performance boost, since + the internal grid can be set up immediately, and it is not necessary to + temporarily store the input file contents while estimating the size. + .B +-.IP \-o ++.IP "\-o" + Ensure that particles in the output file are in the same order as those in the + input file. This may result in a very small increase in memory usage and + execution time, and is turned off by default. + .B + .B +-.IP \-p ++.IP "\-p" + Make the container periodic in all three coordinate directions. + .B +-.IP \-px ++.IP "\-px" + Make container periodic in the x direction. + .B +-.IP \-py ++.IP "\-py" + Make container periodic in the y direction. + .B +-.IP \-pz ++.IP "\-pz" + Make container periodic in the z direction. + .B +-.IP \-r ++.IP "\-r" + Carry out a Voronoi tessellation for a polydisperse particle arrangement using + the radical Voronoi tessellation. For this case, an extra column is required in + the input file, that contains the particle radii. The radii are also included + in the output file. + .B +-.IP \-v ++.IP "\-v" + Verbose output. After the computation is completed, some statistics are printed + about the container geometry, the internal computational grid, the number of + particles imported, the number Voronoi cells computed, and the volume of the + computed Voronoi cells. + .B +-.IP \-\-version ++.IP "\-\-version" + Print version information. + .B +-.IP \-y ++.IP "\-y" + Save the particles in POV-Ray format to "filename_p.pov" and the Voronoi cells + in POV-Ray format to "filename_v.pov". Caution: For large input files, the + POV-Ray Voronoi cell file will be extremely large, so this option is best used + on smaller systems. + .B +-.IP \-yp ++.IP "\-yp" + Save the particles in POV-Ray format to "filename_p.pov". + .B +-.IP \-yv ++.IP "\-yv" + Save the Voronoi cells in POV-Ray format to "filename_v.pov". + + .SH OPTIONS FOR WALLS +@@ -178,26 +178,26 @@ + process. At present, four wall types are supported: + + .B +-.IP \-wb ++.IP "\-wb " + Add six plane wall objects to make a box containing the space x1 ++.IP "\-wc " + Add a cylindrical wall object, where (x1,x2,x3) is a point on the cylinder + axis, (x4,x5,x6) is a vector along the cylinder axis, and x7 is the cylinder + radius. + .B +-.IP \-wo ++.IP "\-wo " + Add a conical wall object, with apex at (x1,x2,x3), axis along (x4,x5,x6), and + half angle x7 (specified in radians). + .B +-.IP \-ws ++.IP "\-ws " + Add a spherical wall object, centered on (x1,x2,x3), with radius x4. + .B +-.IP \-wp ++.IP "\-wp " + Add a plane wall object, with normal (x1,x2,x3), and displacement x4. + + Each wall is accounted for using a single approximating plane; several of the +@@ -219,22 +219,22 @@ + Particle-related entries: + + .B +-.IP %i ++.IP "%i" + The particle ID number. + .B +-.IP %x ++.IP "%x" + The x coordinate of the particle. + .B +-.IP %y ++.IP "%y" + The y coordinate of the particle. + .B +-.IP %z ++.IP "%z" + The z coordinate of the particle. + .B +-.IP %q ++.IP "%q" + The position vector of the particle, short for "%x %y %z". + .B +-.IP %r ++.IP "%r" + The radius of the particle (only printed if the polydisperse information is + available). + +@@ -242,21 +242,21 @@ + Vertex-related entries: + + .B +-.IP %w ++.IP "%w" + The number of vertices in the Voronoi cell. + .B +-.IP %p ++.IP "%p" + A list of the vertices of the Voronoi cell in the format (x,y,z), relative to + the particle center. + .B +-.IP %P ++.IP "%P" + A list of the vertices of the Voronoi cell in the format (x,y,z), relative to + the global coordinate system. + .B +-.IP %o ++.IP "%o" + A list of the orders of each vertex. + .B +-.IP %m ++.IP "%m" + The maximum radius squared of a vertex position, relative to the particle + center. + +@@ -264,41 +264,41 @@ + Edge-related entries: + + .B +-.IP %g ++.IP "%g" + The number of edges of the Voronoi cell. + .B +-.IP %E ++.IP "%E" + The total edge distance. + .B +-.IP %e ++.IP "%e" + A list of perimeters of each face. + + .PP + Face-related entries: + + .B +-.IP %s ++.IP "%s" + The number of faces of the Voronoi cell. + .B +-.IP %F ++.IP "%F" + The total surface area of the Voronoi cell. + .B +-.IP %A ++.IP "%A" + A frequency table of the orders of the faces. + .B +-.IP %a ++.IP "%a" + A list of the orders of the faces, showing how many edges make up each face. + .B +-.IP %f ++.IP "%f" + A list of areas of each face. + .B +-.IP %t ++.IP "%t" + A list of bracketed sequences of vertices that make up each face. + .B +-.IP %l ++.IP "%l" + A list of normal vectors for each face. + .B +-.IP %n ++.IP "%n" + A list of the neighboring particle or wall IDs corresponding to each face. The + list can contain negative numbers. For the non-periodic case these correspond + to when the particles have faces created by the edges of the computational +@@ -324,13 +324,13 @@ + .PP + Volume-related entries: + .B +-.IP %v ++.IP "%v" + The volume of the Voronoi cell. + .B +-.IP %c ++.IP "%c" + The centroid of the Voronoi cell, relative to the particle center. + .B +-.IP %C ++.IP "%C" + The centroid of the Voronoi cell, in the global coordinate system. + + diff -Nru voro++-0.5/debian/patches/series voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/series --- voro++-0.5/debian/patches/series 2021-02-08 15:00:36.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/debian/patches/series 2021-03-01 19:19:07.000000000 +0000 @@ -1,5 +1,6 @@ Makefile.patch config.mk.patch +man.patch cmd_line.cc.patch src_Makefile.patch examples_Makefile.patch diff -Nru voro++-0.5/examples/basic/convex_test.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/convex_test.cc --- voro++-0.5/examples/basic/convex_test.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/convex_test.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -// Single Voronoi cell example code -// -// Author : Chris H. Rycroft (Harvard SEAS / LBL) -// Email : chr@alum.mit.edu -// Date : February 16th 2014 - -#include "voro++.hh" -using namespace voro; - -// This function returns a random floating point number between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { -// double x,y,z,rsq,r; - voronoicell v; - - v.init_l_shape(); - v.draw_gnuplot(0,0,0,"single_cell.gnu"); - int lp=-1,ls=-1; - double l=1e-20,u=1e-20; - //bool suc=v.search_upward(-1,3,0,0.5,lp,ls,l,u); - v.plane(-1,3,0,0.5); - v.draw_gnuplot(0,0,0,"single_cell2.gnu"); - v.plane(-1,3,0.4,0.53); - v.plane(-1,3,-0.4,0.54); - puts("cr"); - v.check_relations(); - v.check_duplicates(); - puts("fi"); -// v.plane(-1,3,-0.2,0.54); - bool suc=true; - - printf("%s lp=%d ls=%d l=%g u=%g up=%d\n",suc?"True":"False",lp,ls,l,u,v.up); - - v.draw_gnuplot(0,0,0,"single_cell3.gnu"); -} diff -Nru voro++-0.5/examples/basic/import.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/import.cc --- voro++-0.5/examples/basic/import.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/import.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // File import example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/basic/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/Makefile --- voro++-0.5/examples/basic/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 @@ -8,7 +8,7 @@ include ../../config.mk # List of executables -EXECUTABLES=single_cell platonic random_points import convex_test +EXECUTABLES=single_cell platonic random_points import # Makefile rules all: $(EXECUTABLES) @@ -25,9 +25,6 @@ import: import.cc $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o import import.cc -lvoro++ -convex_test: convex_test.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o convex_test convex_test.cc -lvoro++ - clean: rm -f $(EXECUTABLES) diff -Nru voro++-0.5/examples/basic/platonic.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/platonic.cc --- voro++-0.5/examples/basic/platonic.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/platonic.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Platonic solids example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -20,6 +20,7 @@ v.plane(1,-1,-1); v.plane(-1,1,-1); v.plane(-1,-1,1); + v.draw_gnuplot(0,0,0,"tetrahedron.gnu"); // Create a cube. Since this is the default shape @@ -37,6 +38,7 @@ v.plane(-1,1,-1); v.plane(1,-1,-1); v.plane(-1,-1,-1); + v.draw_gnuplot(0,0,0,"octahedron.gnu"); // Create a dodecahedron diff -Nru voro++-0.5/examples/basic/random_points.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/random_points.cc --- voro++-0.5/examples/basic/random_points.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/random_points.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voronoi calculation example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -11,7 +11,7 @@ const double x_min=-1,x_max=1; const double y_min=-1,y_max=1; const double z_min=-1,z_max=1; -const double cvol=(x_max-x_min)*(y_max-y_min)*(z_max-z_min); +const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); // Set up the number of blocks that the container is divided into const int n_x=6,n_y=6,n_z=6; diff -Nru voro++-0.5/examples/basic/single_cell.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/single_cell.cc --- voro++-0.5/examples/basic/single_cell.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/basic/single_cell.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Single Voronoi cell example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/custom/cell_statistics.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/cell_statistics.cc --- voro++-0.5/examples/custom/cell_statistics.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/cell_statistics.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Simple cell statistics demonstration code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/custom/custom_output.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/custom_output.cc --- voro++-0.5/examples/custom/custom_output.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/custom_output.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Custom output example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/custom/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/Makefile --- voro++-0.5/examples/custom/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 diff -Nru voro++-0.5/examples/custom/radical.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/radical.cc --- voro++-0.5/examples/custom/radical.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/custom/radical.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Radical Voronoi tessellation example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/degenerate/degenerate2.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/degenerate2.cc --- voro++-0.5/examples/degenerate/degenerate2.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/degenerate2.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Degenerate vertex example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/degenerate/degenerate.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/degenerate.cc --- voro++-0.5/examples/degenerate/degenerate.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/degenerate.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Degenerate Voronoi cell example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/degenerate/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/Makefile --- voro++-0.5/examples/degenerate/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/degenerate/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 diff -Nru voro++-0.5/examples/extra/box_cut.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/box_cut.cc --- voro++-0.5/examples/extra/box_cut.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/box_cut.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Box cutting example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/extra/cut_region.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/cut_region.cc --- voro++-0.5/examples/extra/cut_region.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/cut_region.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Cell cutting region example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/extra/irregular.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/irregular.cc --- voro++-0.5/examples/extra/irregular.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/irregular.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Irregular packing example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/extra/l_shape.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/l_shape.cc --- voro++-0.5/examples/extra/l_shape.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/l_shape.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -// Irregular packing example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -// 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;} - -// Create a wall class that will initialize the Voronoi cell to fill the -// L-shaped domain -class wall_l_shape : public wall { - public: - wall_l_shape() { - v.init_l_shape(); - v.draw_gnuplot(0,0,0,"l_shape_init.gnu"); - }; - bool point_inside(double x,double y,double z) {return true;} - bool cut_cell(voronoicell &c,double x,double y,double z) { - - // Set the cell to be equal to the L-shape - c=v; - c.translate(-x,-y,-z); - - // Set the tolerance to 100, to make the code search - // for cases where non-convex cells are cut in multiple - // places - c.big_tol=100; - return true; - } - bool cut_cell(voronoicell_neighbor &c,double x,double y,double z) { - - // Set the cell to be equal to the L-shape - c=v; - c.translate(-x,-y,-z); - - // Set the tolerance to 100, to make the code search - // for cases where non-convex cells are cut in multiple - // places - c.big_tol=100; - return true; - } - private: - voronoicell v; -}; - -int main() { - int i=0; - double x,y,z; - - // Create a container - container con(-1,1,-1,1,-1,1,5,5,5,false,false,false,8); - - // Create the L-shape wall class and add it to the container - wall_l_shape(wls); - con.add_wall(wls); - - // Add particles, making sure not to place any outside of the L-shape - while(i0) continue; - z=2*rnd()-1; - con.put(i,x,y,z); - i++; - } - - // Check the Voronoi cell volume; it should be 6 - printf("Voronoi cell volume: %.8g\n",con.sum_cell_volumes()); - - // Save the particles and Voronoi cells in gnuplot format - con.draw_particles("l_shape_p.gnu"); - con.draw_cells_gnuplot("l_shape_v.gnu"); -} diff -Nru voro++-0.5/examples/extra/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/Makefile --- voro++-0.5/examples/extra/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 @@ -8,7 +8,7 @@ include ../../config.mk # List of executables -EXECUTABLES=box_cut cut_region superellipsoid irregular l_shape +EXECUTABLES=box_cut cut_region superellipsoid irregular # Makefile rules all: $(EXECUTABLES) @@ -25,9 +25,6 @@ irregular: irregular.cc $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o irregular irregular.cc -lvoro++ -l_shape: l_shape.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o l_shape l_shape.cc -lvoro++ - finite_sys: finite_sys.cc $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o finite_sys finite_sys.cc -lvoro++ diff -Nru voro++-0.5/examples/extra/superellipsoid.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/superellipsoid.cc --- voro++-0.5/examples/extra/superellipsoid.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/extra/superellipsoid.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Superellipsoid example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/interface/find_voro_cell.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/find_voro_cell.cc --- voro++-0.5/examples/interface/find_voro_cell.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/find_voro_cell.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Example code demonstrating find_voronoi_cell function // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/interface/loops.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/loops.cc --- voro++-0.5/examples/interface/loops.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/loops.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Example code demonstrating the loop classes // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/interface/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/Makefile --- voro++-0.5/examples/interface/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 diff -Nru voro++-0.5/examples/interface/odd_even.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/odd_even.cc --- voro++-0.5/examples/interface/odd_even.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/odd_even.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Odd/even face coloring code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/interface/polygons.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/polygons.cc --- voro++-0.5/examples/interface/polygons.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/interface/polygons.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Direct C++ interface example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/no_release/cylinder_inv.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/cylinder_inv.cc --- voro++-0.5/examples/no_release/cylinder_inv.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/cylinder_inv.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ -// Cylindrical wall example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-6,x_max=6; -const double y_min=-6,y_max=6; -const double z_min=-6,z_max=6; - -// Set the computational grid size -const int n_x=6,n_y=6,n_z=6; - -struct wall_cylinder_inv : public wall { - public: - wall_cylinder_inv(double xc_,double yc_,double zc_,double xa_,double ya_,double za_,double rc_,int w_id_=-99) - : w_id(w_id_), xc(xc_), yc(yc_), zc(zc_), xa(xa_), ya(ya_), za(za_), - asi(1/(xa_*xa_+ya_*ya_+za_*za_)), rc(rc_) {} - bool point_inside(double x,double y,double z) { - double xd=x-xc,yd=y-yc,zd=z-zc; - double pa=(xd*xa+yd*ya+zd*za)*asi; - xd-=xa*pa;yd-=ya*pa;zd-=za*pa; - return xd*xd+yd*yd+zd*zd>rc*rc; - } - template - bool cut_cell_base(v_cell &c,double x,double y,double z) { - double xd=x-xc,yd=y-yc,zd=z-zc; - double pa=(xd*xa+yd*ya+zd*za)*asi; - xd-=xa*pa;yd-=ya*pa;zd-=za*pa; - pa=xd*xd+yd*yd+zd*zd; - if(pa>1e-5) { - pa=2*(sqrt(pa)*rc-pa); - return c.nplane(-xd,-yd,-zd,-pa,w_id); - } - return true; - } - bool cut_cell(voronoicell &c,double x,double y,double z) {return cut_cell_base(c,x,y,z);} - bool cut_cell(voronoicell_neighbor &c,double x,double y,double z) {return cut_cell_base(c,x,y,z);} - private: - const int w_id; - const double xc,yc,zc,xa,ya,za,asi,rc; -}; - -int main() { - int i;double x,y,z; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - // Add a cylindrical wall to the container - wall_cylinder_inv cyl(0,0,0,0,1,0,4.2); - con.add_wall(cyl); - - // Place particles in a regular grid within the frustum, for points - // which are within the wall boundaries - for(z=-5.5;z<6;z+=1) for(y=-5.5;y<6;y+=1) for(x=-5.5;x<6;x+=1) - if (con.point_inside(x,y,z)) {con.put(i,x,y,z);i++;} - - // Output the particle positions in POV-Ray format - con.draw_particles_pov("cylinder_inv_p.pov"); - - // Output the Voronoi cells in POV-Ray format - con.draw_cells_pov("cylinder_inv_v.pov"); - - // Output the particle positions in gnuplot format - con.draw_particles("cylinder_inv.par"); - - // Output the Voronoi cells in gnuplot format - con.draw_cells_gnuplot("cylinder_inv.gnu"); -} diff -Nru voro++-0.5/examples/no_release/cylinder_inv.pov voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/cylinder_inv.pov --- voro++-0.5/examples/no_release/cylinder_inv.pov 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/cylinder_inv.pov 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -#version 3.6; - -#include "colors.inc" -#include "metals.inc" -#include "textures.inc" - -// Right-handed coordinate system in which the z axis points upwards -camera { - location <20,-50,20> - sky z - right -0.34*x*image_width/image_height - up 0.34*z - look_at <0,0,0> -} - -// White background -background{rgb 1} - -// Two lights with slightly different colors -light_source{<-8,-20,30> color rgb <0.77,0.75,0.75>} -light_source{<20,-15,5> color rgb <0.38,0.40,0.40>} - -// Radius of the Voronoi cell network, and the particle radius -#declare r=0.06; -#declare s=0.48; - -// Particles -union{ -#include "cylinder_inv_p.pov" - pigment{rgb <0.5,0.8,0.7>} finish{reflection 0.12 specular 0.3 ambient 0.42} -} - -// Voronoi cells -union{ -#include "cylinder_inv_v.pov" - pigment{rgb <0.1,0.3,0.9>} finish{specular 0.3 ambient 0.42} -} diff -Nru voro++-0.5/examples/no_release/ellipsoid.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/ellipsoid.cc --- voro++-0.5/examples/no_release/ellipsoid.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/ellipsoid.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,104 +0,0 @@ -// Ellipsoidal wall example -// -// Author : Simon Konstandin (UMM Mannheim) - -#include "voro++.hh" -using namespace voro; - -#include "quartic/quartic.hpp" -using namespace magnet::math; - -// Set up constants for the container geometry -const double x_min=-6,x_max=6; -const double y_min=-6,y_max=6; -const double z_min=-6,z_max=6; - -// Golden ratio constants -const double Phi=0.5*(1+sqrt(5.0)); -const double phi=0.5*(1-sqrt(5.0)); - -// Set up the number of blocks that the container is divided -// into. -const int n_x=5,n_y=5,n_z=5; - -// Set the number of particles that are going to be randomly introduced -const int particles=500; - -// This function returns a random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -// Ellipsoidal wall object -class wall_ellipsoid : public wall { - public: - const double a; - const double aa; - const double aa_inv; - const double a_cal; - const double rr; - const double rr_inv; - const double xc; - const double yc; - const double zc; - const int w_id; - wall_ellipsoid(double a_,double r_,double xc_,double yc_,double zc_) - : a(a_), aa(a_*a_), aa_inv(1/aa), a_cal(2.0+2.0/aa), rr(r_*r_), - rr_inv(1/rr), xc(xc_), yc(yc_), zc(zc_), w_id(99) {} - bool point_inside(double x,double y,double z) { - return x*x+y*y+z*z*a*a - bool cut_cell_base(v_cell &c,double x,double y,double z) { - x-=xc;y-=yc;z-=zc; - double xx=x*x,yy=y*y,zz=z*z,s[4], - b_cal=1.0-(xx+yy)*rr_inv+(4.0-zz*rr_inv)*aa_inv+aa_inv*aa_inv, - c_cal=2.0*(1.0-(xx+yy+zz)*rr_inv)*aa_inv+2.0*aa_inv*aa_inv, - d_cal=(1.0-(xx+yy+zz*aa)*rr_inv)*aa_inv*aa_inv, - xell[4],yell[4],zell[4],d2[4]; - int i,j=0,q=quarticSolve(a_cal,b_cal,c_cal,d_cal,s[0],s[1],s[2],s[3]); - - for (i=0;i -using namespace std; - -// Set up constants for the container geometry -const double x_min=-15,x_max=15; -const double y_min=-7,y_max=7; -const double z_min=-15,z_max=15; - -// Golden ratio constants -const double Phi=0.5*(1+sqrt(5.0)); -const double phi=0.5*(1-sqrt(5.0)); - -// Set up the number of blocks that the container is divided -// into. -const int n_x=8,n_y=8,n_z=8; - -// ID for dodecahedron faces -const int wid=-10; - -// Create a wall class that, whenever called, will replace the Voronoi cell -// with a prescribed shape, in this case a dodecahedron -class wall_initial_shape : public wall { - public: - wall_initial_shape() { - - // Create a dodecahedron with neighbor information all - // set to -10 - v.init(-2,2,-2,2,-2,2); - v.nplane(0,Phi,1,wid);v.nplane(0,-Phi,1,wid);v.nplane(0,Phi,-1,wid); - v.nplane(0,-Phi,-1,wid);v.nplane(1,0,Phi,wid);v.nplane(-1,0,Phi,wid); - v.nplane(1,0,-Phi,wid);v.nplane(-1,0,-Phi,wid);v.nplane(Phi,1,0,wid); - v.nplane(-Phi,1,0,wid);v.nplane(Phi,-1,0,wid);v.nplane(-Phi,-1,0,wid); - }; - bool point_inside(double x,double y,double z) {return true;} - bool cut_cell(voronoicell &c,double x,double y,double z) { - - // Just ignore this case - return true; - } - bool cut_cell(voronoicell_neighbor &c,double x,double y,double z) { - - // Set the cell to be equal to the dodecahedron - c=v; - return true; - } - private: - voronoicell_neighbor v; -}; - -// Determines whether any of the sides in the neighbor information are from the -// initial dodecahedron -bool has_dodec_sides(vector &vi) { - for(unsigned int i=0;i vi; - voronoicell_neighbor c; - c_loop_all cl(con); - if(cl.start()) do { - - // Get particle position - cl.pos(x,y,z); - - // Remove half of the particles to see a cross-section - if(y<0) continue; - - if(con.compute_cell(c,cl)) { - - // Get the neighboring IDs of all the faces - c.neighbors(vi); - - // Depending on whether any of the faces are - // from the original dodecahedron, print to - // the "inside" or "outside" file - fprintf(has_dodec_sides(vi)?foutside:finside, - "sphere{<%g,%g,%g>,s}\n",x,y,z); - } - } while(cl.inc()); - - // Close the output files - fclose(finside); - fclose(foutside); -} diff -Nru voro++-0.5/examples/no_release/finite_sys.pov voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/finite_sys.pov --- voro++-0.5/examples/no_release/finite_sys.pov 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/finite_sys.pov 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -#version 3.6; -#include "colors.inc" -#include "metals.inc" -#include "textures.inc" - -camera { - location <5,-50,0> - sky z - right -0.62*x*image_width/image_height - up 0.62*y - look_at <5,0,0> -} - -background{rgb 1} - -light_source{<-16,-30,30> color rgb <0.77,0.75,0.75>} -light_source{<25,-16,8> color rgb <0.43,0.45,0.45>} - -#declare r=0.05; -#declare s=0.5; - -union { -#include "finite_sys_out.pov" - pigment{rgb <0.9,0.9,0.3>} finish{reflection 0.2 specular 0.25 ambient 0.28 metallic} -} - -union{ -#include "finite_sys_in.pov" - pigment{rgb <0.3,0.5,0.9>} finish{reflection 0.2 specular 0.25 ambient 0.28 metallic} -} diff -Nru voro++-0.5/examples/no_release/ghost_test.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/ghost_test.cc --- voro++-0.5/examples/no_release/ghost_test.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/ghost_test.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; -const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -// 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; - - // 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_periodic_poly con(2,0.5,2,0,0,2,n_x,n_y,n_z,8); - - // Randomly add particles into the container - for(i=0;i<4;i++) { - x=x_min+rnd()*(x_max-x_min); - y=y_min+rnd()*(y_max-y_min); - z=z_min+rnd()*(z_max-z_min); - con.put(i,x,y,0,1); - } - - // Output the particle positions in gnuplot format - con.draw_particles("ghost_test_p.gnu"); - - // Output the Voronoi cells in gnuplot format - con.draw_cells_gnuplot("ghost_test_v.gnu"); - - // Open file for test ghost cell - FILE *fp=safe_fopen("ghost_test_c.gnu","w"); - voronoicell c; - - // Compute a range of ghost cells -// for(y=-3.5;y<3.5;y+=0.05) if(con.compute_ghost_cell(c,1,y,0,1)) -// c.draw_gnuplot(1,y,0,fp); - - // Compute a single ghost cell - if(con.compute_ghost_cell(c,1.56,0.67,0,1)) c.draw_gnuplot(1.56,0.67,0,fp); - - // Close ghost cell file - fclose(fp); - - // Draw the domain - con.draw_domain_gnuplot("ghost_test_d.gnu"); -} diff -Nru voro++-0.5/examples/no_release/import_freeman.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/import_freeman.cc --- voro++-0.5/examples/no_release/import_freeman.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/import_freeman.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -// File import example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.cc" -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-50000,x_max=50000; -const double y_min=-50000,y_max=50000; -const double z_min=-50000,z_max=50000; - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -int main() { - FILE * outputFile; - int id; - double x,y,z; - voronoicell c; - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - //Randomly add particles into the container - con.import("pointlist.txt"); - - // Save the Voronoi network of all the particles to text files - // in gnuplot and POV-Ray formats - /* con.draw_cells_gnuplot("pack_ten_cube.gnu"); - con.draw_cells_pov("pack_ten_cube_v.pov"); - - // Output the particles in POV-Ray format - con.draw_particles_pov("pack_ten_cube_p.pov");*/ - - outputFile = fopen("MESH2","w"); - printf("STARING FIRST LOOP"); - c_loop_all cl(con); - //FIRST LOOP START - if(cl.start()) do if(con.compute_cell(c,cl)) { - cl.pos(x,y,z);id=cl.pid(); - printf("%d %e %e %e\n", id,x,y,z); - fflush(stdout); - fprintf(outputFile,"%d %e %e %e\n", id,x,y,z); - } while (cl.inc()); -} diff -Nru voro++-0.5/examples/no_release/import_nguyen.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/import_nguyen.cc --- voro++-0.5/examples/no_release/import_nguyen.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/import_nguyen.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -// File import example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -#include -using namespace std; - -// Set up constants for the container geometry -const double x_min=-5,x_max=5; -const double y_min=-5,y_max=5; -const double z_min=-5,z_max=5; - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -int main() { - - // Construct container - container con(-5,5,-5,5,0,10,6,6,6,false,false,false,8); - - // Import particles - con.import("../basic/pack_ten_cube"); - - // Loop over all the particles and compute the Voronoi cell for each - unsigned int i; - int id; - double x,y,z; - vector vd; - voronoicell c; - c_loop_all cl(con); - if(cl.start()) do if(con.compute_cell(c,cl)) { - - // Get particle position and ID - cl.pos(x,y,z);id=cl.pid(); - - // Get face areas - c.face_areas(vd); - - // Output information (additional diagnostics could be done - // here) - printf("ID %d (%.3f,%.3f,%.3f) :",id,x,y,z); - for(i=0;i -using namespace std; - -// Set up constants for the container geometry -const double boxl=1; - -// Set up the number of blocks that the container is divided into -const int bl=10; - -// Set the number of particles that are going to be randomly introduced -const int particles=4000; - -// Set the number of Voronoi faces to bin -const int nface=40; - -// This function returns a random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i,l; - double x,y,z,r,dx,dy,dz; - int faces[nface],*fp; - double p[3*particles]; - - // 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(-boxl,boxl,-boxl,boxl,-boxl,boxl,bl,bl,bl,false,false,false,8); - - // Randomly add particles into the container - for(i=0;i=nface) i=nface-1; - faces[i]++; - } while (vl.inc()); - con.clear(); - for(i=0;i vi; - voronoicell_neighbor c; - c_loop_all vl(con); - if(vl.start()) do if(con.compute_cell(c,vl)) { - i=vl.pid(); - c.neighbors(vi); - for(l=0;l<(signed int) vi.size();l++) if(vi[l]>i) - fprintf(ff,"%g %g %g\n%g %g %g\n\n\n", - p[3*i],p[3*i+1],p[3*i+2], - p[3*vi[l]],p[3*vi[l]+1],p[3*vi[l]+2]); - } while (vl.inc()); - fclose(ff); -} diff -Nru voro++-0.5/examples/no_release/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/Makefile --- voro++-0.5/examples/no_release/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/Makefile 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -# Voro++ makefile -# -# Author : Chris H. Rycroft (Harvard University / LBL) -# Email : chr@alum.mit.edu -# Date : August 30th 2011 - -# Load the common configuration file -include ../../config.mk - -# List of executables -EXECUTABLES=rad_test finite_sys cylinder_inv single_cell_2d period sphere_mesh lloyd_box import_rahman import_nguyen polycrystal_rahman random_points_10 random_points_200 import_freeman voro_lf split_cell ghost_test neigh_test tri_mesh sphere r_pts_interface minkowski - -# Makefile rules -all: $(EXECUTABLES) - -%: %.cc - $(CXX) $(CFLAGS) $(E_INC) $(E_LIB) -o $@ $< -lvoro++ - -clean: - rm -f $(EXECUTABLES) - -.PHONY: all clean diff -Nru voro++-0.5/examples/no_release/minkowski.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/minkowski.cc --- voro++-0.5/examples/no_release/minkowski.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/minkowski.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -// 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; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - // Randomly add particles into the container - for(i=0;i neigh; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - true,true,true,8); - - // Randomly add particles into the container - for(i=0;i -#include -#include -using namespace std; - -#include "voro++.hh" -using namespace voro; - -const double pi=3.1415926535897932384626433832795; - -// Box geometry -const double x_min=0,x_max=81; -const double y_min=0,y_max=81; -const double z_min=0,z_max=81; -const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); - -// Total number of particles -const int particles=24; - -// Lattice size -const double h=4; - -// Function for random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i,j=0,c_id; - double x,y,z,x1,y1,z1,x2,y2,z2,x3,y3,z3,xt,yt,zt,rx,ry,rz; - double theta,cth,sth,r,v,xc,yc,zc,vx,vy,vz; - - // Create the container class - container con(x_min,x_max,y_min,y_max,z_min,z_max,10,10,10, - false,false,false,8); - - // Add generators to the box - for(i=1;i<=particles;i++) { - x=x_min+rnd()*(x_max-x_min); - y=y_min+rnd()*(y_max-y_min); - z=z_min+rnd()*(z_max-z_min); - con.put(i,x,y,z); - } - - // Open the file for the particle positions - FILE *fp=safe_fopen("lammps_input","w"); - - // Create a loop class to iterate over all of the generators - // in the box - c_loop_all cl(con); - voronoicell c; - if(cl.start()) do if(con.compute_cell(c,cl)) { - - // Generate the first vector of an orthonormal basis - x1=2*rnd()-1;y1=2*rnd()-1;z1=2*rnd()-1;r=1/sqrt(x1*x1+y1*y1+z1*z1); - x1*=r;y1*=r;z1*=r; - - // Construct a second perpendicular vector - if(abs(x1)>0.5||abs(y1)>0.5) {r=1/sqrt(x1*x1+y1*y1);x2=-y1*r;y2=x1*r;z2=0;} - else {r=1/sqrt(x1*x1+z1*z1);x2=-z1*r;y2=0;z2=x1*r;} - - // Construct a third perpendicular vector using the vector product - x=y2*z1-z2*y1;y=z2*x1-x2*z1;z=x2*y1-y2*x1; - - // Take a random rotation of the second and third vectors - theta=2*pi*rnd();cth=cos(theta);sth=sin(theta); - x3=x*cth+x2*sth;x2=-x*sth+x2*cth; - y3=y*cth+y2*sth;y2=-y*sth+y2*cth; - z3=z*cth+z2*sth;z2=-z*sth+z2*cth; - - // Get a bound on how far to search - r=sqrt(0.25*c.max_radius_squared()); - v=(int(r/h)+2)*h; - - // Add small random displacement to lattice positioning, - // so that it's not always perfectly aligned with the generator - vx=-v+h*rnd();vy=-v+h*rnd();vz=-v+h*rnd(); - - // Print diagnostic information about this generator - c_id=cl.pid();cl.pos(xc,yc,zc); - printf("Generator %d at (%g,%g,%g), random basis:\n",c_id,xc,yc,zc); - printf("%g %g %g\n",x1,y1,z1); - printf("%g %g %g\n",x2,y2,z2); - printf("%g %g %g\n\n",x3,y3,z3); - - // Loop over a local region of points - for(z=vx;z<=v;z+=h) for(y=vy;y<=v;y+=h) for(x=vz;x<=v;x+=h) { - - // Construct points rotated into the random basis - xt=xc+x*x1+y*x2+z*x3; - yt=yc+x*y1+y*y2+z*y3; - zt=zc+x*z1+y*z2+z*z3; - - // Skip if this lies outside the container - if(xtx_max||yty_max||ztz_max) continue; - - // Find the nearest generator - con.find_voronoi_cell(xt,yt,zt,rx,ry,rz,i); - - // If the nearest generator matches, then save this point - if(i==c_id) {fprintf(fp,"%d %g %g %g\n",j,xt,yt,zt);j++;} - } - } while(cl.inc()); - - // Close the output file - fclose(fp); - - // Output files for diagnosic purposes - con.draw_particles("lammps_generators"); - con.draw_cells_gnuplot("lammps_cells"); -} diff -Nru voro++-0.5/examples/no_release/rad_test.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/rad_test.cc --- voro++-0.5/examples/no_release/rad_test.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/rad_test.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,67 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; -const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); - -// Set up the number of blocks that the container is divided into -const int n_x=3,n_y=3,n_z=3; - -// Set the number of particles that are going to be randomly introduced -const int particles=1000; - -// This function returns a random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i; - double pos[particles*4],*posp=pos; - - for(i=0;itemp.pov"; - - while() { - s/FRAME/rad_test_out\/fr$f.pov/; - print B; - } - - close A; - close B; - system "povray +H600 +W800 +A0.01 -J +R5 +Ofr_$f.png temp.pov"; -} diff -Nru voro++-0.5/examples/no_release/rad_test.pov voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/rad_test.pov --- voro++-0.5/examples/no_release/rad_test.pov 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/rad_test.pov 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#version 3.6; - -// Right-handed coordinate system in which the z-axis points upwards -camera { - location <30,-50,25> - sky z - right -0.05*x*image_width/image_height - up 0.05*z - look_at <0,0,0> -} - -// White background -background{rgb 1} - -// Two lights with slightly different colors -light_source{<-8,-20,30> color rgb <0.77,0.75,0.75>} -light_source{<25,-12,12> color rgb <0.38,0.40,0.40>} - -// Radius of the Voronoi cell network -#declare r=0.008; - -// Voronoi cells -union{ -#include "FRAME" - pigment{rgb <1,0.4,0.45>} finish{specular 0.5 ambient 0.42} -} diff -Nru voro++-0.5/examples/no_release/random_points_10.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/random_points_10.cc --- voro++-0.5/examples/no_release/random_points_10.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/random_points_10.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -#include -#include -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; -const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -// Set the number of particles that are going to be randomly introduced -//const int particles=20; -const int particles=10; - -// 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; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - // Randomly add particles into the container - for(i=0;i -#include -using namespace voro; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; -const double cvol=(x_max-x_min)*(y_max-y_min)*(x_max-x_min); - -// Set up the number of blocks that the container is divided into -const int n_x=60,n_y=60,n_z=60; - -// Set the number of particles that are going to be randomly introduced -//const int particles=20; -const int particles=200; - -// 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; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - // Randomly add particles into the container - for(i=0;i0.01&&rsq<1) { - r=1/sqrt(rsq);x*=r;y*=r; - v.plane(x,y,0,1); - } - } - - // Output the Voronoi cell to a file, in the gnuplot format - v.draw_gnuplot(0,0,0,"single_cell_2d.gnu"); -} diff -Nru voro++-0.5/examples/no_release/sphere.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/sphere.cc --- voro++-0.5/examples/no_release/sphere.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/sphere.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -// Sphere example code -// -// Author : Chris H. Rycroft (Harvard SEAS) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -const double pi=3.1415926535897932384626433832795; - -int main() { - int i=0; - double x,y,z,evol,vvol; - - // 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(-5,5,-5,5,-5,5,6,6,6, - false,false,false,8); - - // Add a cylindrical wall to the container - wall_sphere sph(0,0,0,4); - con.add_wall(sph); - - // Place particles in a regular grid within the frustum, for points - // which are within the wall boundaries - for(z=-4.5;z<5;z+=1) for(y=-4.5;y<5;y+=1) for(x=-4.5;x<5;x+=1) { - if (con.point_inside(x,y,z)) { - con.put(i,x,y,z);i++; - } - } - - // Output the particle positions and Voronoi cells in Gnuplot format - con.draw_particles("sphere_p.gnu"); - con.draw_cells_gnuplot("sphere_v.gnu"); - - // Compute the volume of the Voronoi cells and compare it to the - // exact frustum volume - evol=4/3.0*pi*4*4*4; - vvol=con.sum_cell_volumes(); - printf("Exact sphere volume : %g\n" - "Voronoi cell volume : %g\n" - "Difference : %g\n",evol,vvol,vvol-evol); -} diff -Nru voro++-0.5/examples/no_release/sphere_mesh.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/sphere_mesh.cc --- voro++-0.5/examples/no_release/sphere_mesh.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/sphere_mesh.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,219 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -#include -using namespace std; - -// Set up constants for the container geometry -const double boxl=1.2; - -// Set up the number of blocks that the container is divided into -const int bl=14; - -// Set the number of particles that are going to be randomly introduced -const int particles=2000; - -const int nface=11; - -// This function returns a random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -struct wall_shell : public wall { - public: - wall_shell(double xc_,double yc_,double zc_,double rc,double sc,int w_id_=-99) - : w_id(w_id_), xc(xc_), yc(yc_), zc(zc_), lc(rc-sc), uc(rc+sc) {} - bool point_inside(double x,double y,double z) { - double rsq=(x-xc)*(x-xc)+(y-yc)*(y-yc)+(z-zc)*(z-zc); - return rsq>lc*lc&&rsq - bool cut_cell_base(v_cell &c,double x,double y,double z) { - double xd=x-xc,yd=y-yc,zd=z-zc,dq=xd*xd+yd*yd+zd*zd,dq2; - if (dq>1e-5) { - dq2=2*(sqrt(dq)*lc-dq); - dq=2*(sqrt(dq)*uc-dq); - return c.nplane(xd,yd,zd,dq,w_id)&&c.nplane(-xd,-yd,-zd,-dq2,w_id); - } - return true; - } - bool cut_cell(voronoicell &c,double x,double y,double z) {return cut_cell_base(c,x,y,z);} - bool cut_cell(voronoicell_neighbor &c,double x,double y,double z) {return cut_cell_base(c,x,y,z);} - private: - const int w_id; - const double xc,yc,zc,lc,uc; -}; - - -int main() { - int i=0,j,k,l,ll,o; - double x,y,z,r,dx,dy,dz; - int faces[nface],*fp; - double p[3*particles]; - - // 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(-boxl,boxl,-boxl,boxl,-boxl,boxl,bl,bl,bl,false,false,false,8); - - wall_shell ws(0,0,0,1,0.00001); - con.add_wall(ws); - - // Randomly add particles into the container - while(i1e-5) { - r=1/sqrt(r);x*=r;y*=r;z*=r; - con.put(i,x,y,z); - i++; - } - } - - for(l=0;l<100;l++) { - c_loop_all vl(con); - voronoicell c; - for(fp=faces;fp=nface) i=nface-1; - faces[i]++; - } while (vl.inc()); - con.clear(); - double fac=0;//l<9000?0.1/sqrt(double(l)):0; - for(i=0;i vi; - voronoicell_neighbor c; - c_loop_all vl(con); - if(vl.start()) do if(con.compute_cell(c,vl)) { - i=vl.pid();qp=q+i*nface; - c.neighbors(vi); - if(vi.size()>nface+2) voro_fatal_error("Too many faces; boost nface",5); - - for(l=0;l<(signed int) vi.size();l++) if(vi[l]>=0) qp[qn[i]++]=vi[l]; - } while (vl.inc()); - - // Sort the connections in anti-clockwise order - bool connect; - int tote=0; - for(l=0;l %d,%d\n",i,o); - j=i+1; - while(j %d %d\n",j,ll); - connect=false; - for(k=0;k0.01&&rsq<1) { - r=1/sqrt(rsq);x*=r;y*=r;z*=r; - v.plane(x,y,z,1); - } - } - - // Make copy of the Voronoi cell - v2=v; - - // Cut one copy in one direction, and the other copy in the other direction - v.plane(1,0,0,0); - v2.plane(-1,0,0,0); - - // Output the Voronoi cell to a file, in the gnuplot format - v.draw_gnuplot(-0.05,0,0,"split_cell1.gnu"); - v2.draw_gnuplot(0.05,0,0,"split_cell2.gnu"); -} diff -Nru voro++-0.5/examples/no_release/tri_mesh.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/tri_mesh.cc --- voro++-0.5/examples/no_release/tri_mesh.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/no_release/tri_mesh.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,84 +0,0 @@ -// Voronoi calculation example code -// -// Author : Chris H. Rycroft (Harvard University / LBL) -// Email : chr@alum.mit.edu -// Date : August 30th 2011 - -#include "voro++.hh" -using namespace voro; - -#include -using namespace std; - -// Set up constants for the container geometry -const double x_min=-1,x_max=1; -const double y_min=-1,y_max=1; -const double z_min=-1,z_max=1; - -// Set up the number of blocks that the container is divided into -const int n_x=6,n_y=6,n_z=6; - -// Set the number of particles that are going to be randomly introduced -const int particles=1; - -// This function returns a random double between 0 and 1 -double rnd() {return double(rand())/RAND_MAX;} - -int main() { - int i,j,id,nv; - double x,y,z; - - // 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(x_min,x_max,y_min,y_max,z_min,z_max,n_x,n_y,n_z, - false,false,false,8); - - // Randomly add particles into the container - for(i=0;i f_vert; - vector v; - voronoicell c; - if(cl.start()) do if(con.compute_cell(c,cl)) { - cl.pos(x,y,z);id=cl.pid(); - printf("Particle %d:\n",id); - - // Gather information about the computed Voronoi cell - c.face_vertices(f_vert); - c.vertices(x,y,z,v); - - // Print vertex positions - for(i=0;i -using namespace std; - -// Set up constants for the container geometry -const double ax=-0.5,bx=25.5; -const double ay=-0.5,by=25.5; -const double az=-0.5,bz=25.5; - -int main() { - - // Manually import the file - int i,j,id,max_id=0,n; - double x,y,z; - vector vid,neigh,f_order; - vector vx,vy,vz,vd; - FILE *fp=safe_fopen("liq-900K.dat","r"),*fp2,*fp3; - while((j=fscanf(fp,"%d %lg %lg %lg",&id,&x,&y,&z))==4) { - vid.push_back(id);if(id>max_id) max_id=id; - vx.push_back(x); - vy.push_back(y); - vz.push_back(z); - } - if(j!=EOF) voro_fatal_error("File import error",VOROPP_FILE_ERROR); - n=vid.size(); - fclose(fp); - - // Compute optimal size for container, and then construct the container - double dx=bx-ax,dy=by-ay,dz=bz-az; - double l(pow(n/(5.6*dx*dy*dz),1/3.0)); - int nx=int(dx*l+1),ny=int(dy*l+1),nz=int(dz*l+1); - container con(ax,bx,ay,by,az,bz,nx,ny,nz,false,false,false,8); - - // Print status message - printf("Read %d particles, max ID is %d\n" - "Container grid is %d by %d by %d\n",n,max_id,nx,ny,nz); - - // Import the particles, and create ID lookup tables - double *xi=new double[max_id+1],*yi=new double[max_id+1],*zi=new double[max_id+1]; - for(j=0;j1% total surface. In addition, - // skip negative indices, since they correspond to faces - // against the container boundaries - for(i=0;i<(signed int) vd.size();i++) - if(vd[i]>0.01*c.surface_area()&&neigh[i]>=0) { - j=neigh[i]; - c2.nplane(xi[j]-x,yi[j]-y,zi[j]-z,j); - } - - // Get information of c2 cell - c2.face_areas(vd);c2.face_orders(f_order); - - // Output information to file - i=vd.size(); - fprintf(fp,"%d %d",id,i); - for(j=0;j using namespace std; -#include "voro++.cc" +#include "voro++.hh" using namespace voro; // Set up constants for the container geometry diff -Nru voro++-0.5/examples/timing/timing_test.pl voro++-0.5+revert-to-0.4.6+dfsg1/examples/timing/timing_test.pl --- voro++-0.5/examples/timing/timing_test.pl 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/timing/timing_test.pl 2013-10-17 17:54:13.000000000 +0000 @@ -15,7 +15,7 @@ # Compile the code with the current grid size system "g++ $opt -I../../src -DNNN=$r -o timing_test " - ."-L../../src timing_test.cc"; + ."-L../../src timing_test.cc -lvoro++"; # Carry out the trials for this grid size $st=$stt=0; diff -Nru voro++-0.5/examples/walls/cylinder.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/cylinder.cc --- voro++-0.5/examples/walls/cylinder.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/cylinder.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Cylindrical wall example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/walls/frustum.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/frustum.cc --- voro++-0.5/examples/walls/frustum.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/frustum.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Frustum example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -9,8 +9,6 @@ const double pi=3.1415926535897932384626433832795; -double rnd() {return 0.001*double(rand())/RAND_MAX;} - int main() { int i=0; double x,y,z,evol,vvol; diff -Nru voro++-0.5/examples/walls/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/Makefile --- voro++-0.5/examples/walls/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 diff -Nru voro++-0.5/examples/walls/tetrahedron.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/tetrahedron.cc --- voro++-0.5/examples/walls/tetrahedron.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/tetrahedron.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Tetrahedron example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/examples/walls/torus.cc voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/torus.cc --- voro++-0.5/examples/walls/torus.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/examples/walls/torus.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Custom wall class example code // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -59,9 +59,9 @@ double odis=orad-mjr; double ot=odis*odis+z*z; - // Unless the particle is within 1% of the minor + // Unless the particle is within 1% of the major // radius, then a plane cut is made - if(ot>0.01*mnr*mnr) { + if(ot>0.01*mnr) { ot=2*mnr/sqrt(ot)-2; z*=ot; odis*=ot/orad; diff -Nru voro++-0.5/man/voro++.1 voro++-0.5+revert-to-0.4.6+dfsg1/man/voro++.1 --- voro++-0.5/man/voro++.1 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/man/voro++.1 2013-10-17 18:13:38.000000000 +0000 @@ -82,14 +82,14 @@ The utility accepts the following basic options: .B -.IP "\-c " +.IP \-c This option allows the format of the output file to be customized to hold a variety of statistics about the computed Voronoi cells. The specified string can contain regular characters, plus control sequences beginning with percentage signs that are expanded to contain different Voronoi cell statistics. See below for a full custom output reference. .B -.IP "\-g" +.IP \-g If this option is specified, then an additional output file is generated with the ".gnu" extension, which contains a description of all the cells in a format that can be viewed using gnuplot using the @@ -97,15 +97,15 @@ command. Caution: For large input files, the gnuplot output file will be extremely large, so this option is best used on smaller systems. .B -.IP "\-h or \-\-help" +.IP \-h or \-\-help This option prints out a summary of the command syntax and the available options. .B -.IP "\-hc" +.IP \-hc This option prints out all the available control sequences for the customized output. .B -.IP "-l " +.IP -l Manually specify a typical length scale between particles, with which to configure the internal grid size. For example, if the particles represent densely-packed hard spheres of diameter d, then d would be an appropriate value @@ -114,62 +114,62 @@ can be set up immediately, and it is not necessary to temporarily store the input file contents while estimating the grid size. .B -.IP "-m " +.IP -m Manually specify the initial number of particles that can be stored in each block. By default a value of 8 is used. For any block where this limit is -reached, the code will dynamically allocate more memory as necessary, so +reached, the code will dynamically allocate more memory as neccessary, so usually it is not necessary to alter this. .B -.IP "-n " +.IP -n Manually specify the internal computational grid to have nx, ny, and nz blocks in the x, y, and z directions respectively, giving nx*ny*nz blocks in total. Manually specifying the size will result in a small performance boost, since the internal grid can be set up immediately, and it is not necessary to temporarily store the input file contents while estimating the size. .B -.IP "\-o" +.IP \-o Ensure that particles in the output file are in the same order as those in the input file. This may result in a very small increase in memory usage and execution time, and is turned off by default. .B .B -.IP "\-p" +.IP \-p Make the container periodic in all three coordinate directions. .B -.IP "\-px" +.IP \-px Make container periodic in the x direction. .B -.IP "\-py" +.IP \-py Make container periodic in the y direction. .B -.IP "\-pz" +.IP \-pz Make container periodic in the z direction. .B -.IP "\-r" +.IP \-r Carry out a Voronoi tessellation for a polydisperse particle arrangement using the radical Voronoi tessellation. For this case, an extra column is required in the input file, that contains the particle radii. The radii are also included in the output file. .B -.IP "\-v" +.IP \-v Verbose output. After the computation is completed, some statistics are printed about the container geometry, the internal computational grid, the number of particles imported, the number Voronoi cells computed, and the volume of the computed Voronoi cells. .B -.IP "\-\-version" +.IP \-\-version Print version information. .B -.IP "\-y" +.IP \-y Save the particles in POV-Ray format to "filename_p.pov" and the Voronoi cells in POV-Ray format to "filename_v.pov". Caution: For large input files, the POV-Ray Voronoi cell file will be extremely large, so this option is best used on smaller systems. .B -.IP "\-yp" +.IP \-yp Save the particles in POV-Ray format to "filename_p.pov". .B -.IP "\-yv" +.IP \-yv Save the Voronoi cells in POV-Ray format to "filename_v.pov". .SH OPTIONS FOR WALLS @@ -178,26 +178,26 @@ process. At present, four wall types are supported: .B -.IP "\-wb " +.IP \-wb Add six plane wall objects to make a box containing the space x1 " +.IP \-wc Add a cylindrical wall object, where (x1,x2,x3) is a point on the cylinder axis, (x4,x5,x6) is a vector along the cylinder axis, and x7 is the cylinder radius. .B -.IP "\-wo " +.IP \-wo Add a conical wall object, with apex at (x1,x2,x3), axis along (x4,x5,x6), and half angle x7 (specified in radians). .B -.IP "\-ws " +.IP \-ws Add a spherical wall object, centered on (x1,x2,x3), with radius x4. .B -.IP "\-wp " +.IP \-wp Add a plane wall object, with normal (x1,x2,x3), and displacement x4. Each wall is accounted for using a single approximating plane; several of the @@ -219,22 +219,22 @@ Particle-related entries: .B -.IP "%i" +.IP %i The particle ID number. .B -.IP "%x" +.IP %x The x coordinate of the particle. .B -.IP "%y" +.IP %y The y coordinate of the particle. .B -.IP "%z" +.IP %z The z coordinate of the particle. .B -.IP "%q" +.IP %q The position vector of the particle, short for "%x %y %z". .B -.IP "%r" +.IP %r The radius of the particle (only printed if the polydisperse information is available). @@ -242,21 +242,21 @@ Vertex-related entries: .B -.IP "%w" +.IP %w The number of vertices in the Voronoi cell. .B -.IP "%p" +.IP %p A list of the vertices of the Voronoi cell in the format (x,y,z), relative to the particle center. .B -.IP "%P" +.IP %P A list of the vertices of the Voronoi cell in the format (x,y,z), relative to the global coordinate system. .B -.IP "%o" +.IP %o A list of the orders of each vertex. .B -.IP "%m" +.IP %m The maximum radius squared of a vertex position, relative to the particle center. @@ -264,41 +264,41 @@ Edge-related entries: .B -.IP "%g" +.IP %g The number of edges of the Voronoi cell. .B -.IP "%E" +.IP %E The total edge distance. .B -.IP "%e" +.IP %e A list of perimeters of each face. .PP Face-related entries: .B -.IP "%s" +.IP %s The number of faces of the Voronoi cell. .B -.IP "%F" +.IP %F The total surface area of the Voronoi cell. .B -.IP "%A" +.IP %A A frequency table of the orders of the faces. .B -.IP "%a" +.IP %a A list of the orders of the faces, showing how many edges make up each face. .B -.IP "%f" +.IP %f A list of areas of each face. .B -.IP "%t" +.IP %t A list of bracketed sequences of vertices that make up each face. .B -.IP "%l" +.IP %l A list of normal vectors for each face. .B -.IP "%n" +.IP %n A list of the neighboring particle or wall IDs corresponding to each face. The list can contain negative numbers. For the non-periodic case these correspond to when the particles have faces created by the edges of the computational @@ -324,13 +324,13 @@ .PP Volume-related entries: .B -.IP "%v" +.IP %v The volume of the Voronoi cell. .B -.IP "%c" +.IP %c The centroid of the Voronoi cell, relative to the particle center. .B -.IP "%C" +.IP %C The centroid of the Voronoi cell, in the global coordinate system. diff -Nru voro++-0.5/NEWS voro++-0.5+revert-to-0.4.6+dfsg1/NEWS --- voro++-0.5/NEWS 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/NEWS 2013-10-17 18:01:20.000000000 +0000 @@ -1,24 +1,3 @@ -Version 0.5 (...) -=================== -* Fixed typo in random_points.cc example. Thanks to Guo-Jie Gao (Osaka - University) and Jose Adsuara (Universit of Valencia) for pointing this out. -* Fixed documentation error in normals routine. Thanks to Jean Farago - (Université de Strasbourg) for pointing this out. -* Fixed bug in the initialization of stacke2 in voronoicell_base. It was set - based on current_delete_size and not current_delete2_size. By default these - are the same in config.hh, so this would not cause a problem. However, - changing config.hh could create a problem. -* Updated plane cutting routine to handle non-convex cases. This should remove - some extremely rare errors where cells can accidentally be deleted. -* Fixed a typo in the delete_connection routine in cell.cc that could cause - segmentation faults in extremely rare cases. Thanks to Francesco Biscani (Max - Planck institute for Astronomy, Heidelberg) for pointing this out. -* Fixed typo and length scale issue in torus.cc example. Thanks to Eric Lluch - for pointing this out. -* Incorporated Roger Wesson's fix to cmd_line.cc and the man page -* Cleaned up comments -* Updated Doxyfile to 1.8.9.1 - Version 0.4.6 (October 17th 2013) ================================= * Fixed an issue with template instantiation in wall.cc that was causing diff -Nru voro++-0.5/README voro++-0.5+revert-to-0.4.6+dfsg1/README --- voro++-0.5/README 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/README 2013-10-17 17:54:13.000000000 +0000 @@ -1,5 +1,5 @@ Voro++, a 3D cell-based Voronoi library (http://math.lbl.gov/voro++/) -By Chris H. Rycroft (Harvard University / Lawrence Berkeley Laboratory) +By Chris H. Rycroft (UC Berkeley / Lawrence Berkeley Laboratory) ================================================================ Voro++ is a software library for carrying out three-dimensional computations of the Voronoi tessellation. A distinguishing feature of the Voro++ library @@ -7,8 +7,8 @@ for each particle individually, rather than computing the Voronoi tessellation as a global network of vertices and edges. It is particularly well-suited for applications that rely on cell-based statistics, where -features of Voronoi cells (e.g. volume, centroid, number of faces) can be -used to analyze a system of particles. +features of Voronoi cells (eg. volume, centroid, number of faces) can be +used to analyze a system of particles Voro++ comprises of several C++ classes that can be built as a static library and linked to. A command-line utility is also provided that can analyze text @@ -112,7 +112,7 @@ - Chris H. Rycroft, "Multiscale Modeling in Granular Flow", PhD thesis submitted to the Massachusetts Institute of Technology, September 2007. - (http://seas.harvard.edu/~chr/publish/phd.html) + (http://math.berkeley.edu/~chr/publish/phd.html) The first reference contains a one-page overview of the library. The second reference contains some of the initial images that were made using a very early @@ -120,7 +120,8 @@ particle simulation. The third reference discusses the use of 3D Voronoi cells, and describes the algorithms that were employed in the early version of this code. Since the publication of the above references, the algorithms in Voro++ -have been significantly improved. +have been significantly improved, and a paper specifically devoted to the +current code architecture will be published during 2012. Copyright Notice diff -Nru voro++-0.5/src/cell.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/cell.cc --- voro++-0.5/src/cell.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/cell.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -17,21 +17,16 @@ namespace voro { /** Constructs a Voronoi cell and sets up the initial memory. */ -voronoicell_base::voronoicell_base(double max_len_sq) : +voronoicell_base::voronoicell_base() : current_vertices(init_vertices), current_vertex_order(init_vertex_order), current_delete_size(init_delete_size), current_delete2_size(init_delete2_size), - current_xsearch_size(init_xsearch_size), ed(new int*[current_vertices]), nu(new int[current_vertices]), - mask(new unsigned int[current_vertices]), - pts(new double[current_vertices<<2]), tol(tolerance*max_len_sq), - tol_cu(tol*sqrt(tol)), big_tol(big_tolerance_fac*tol), mem(new int[current_vertex_order]), - mec(new int[current_vertex_order]), - mep(new int*[current_vertex_order]), ds(new int[current_delete_size]), - stacke(ds+current_delete_size), ds2(new int[current_delete2_size]), - stacke2(ds2+current_delete2_size), xse(new int[current_xsearch_size]), - stacke3(xse+current_xsearch_size), maskc(0) { + pts(new double[3*current_vertices]), mem(new int[current_vertex_order]), + mec(new int[current_vertex_order]), mep(new int*[current_vertex_order]), + ds(new int[current_delete_size]), stacke(ds+current_delete_size), + ds2(new int[current_delete2_size]), stacke2(ds2+current_delete_size), + current_marginal(init_marginal), marg(new int[current_marginal]) { int i; - for(i=0;i=0;i--) if(mem[i]>0) delete [] mep[i]; - delete [] xse; + delete [] marg; delete [] ds2;delete [] ds; delete [] mep;delete [] mec; delete [] mem;delete [] pts; - delete [] mask; delete [] nu;delete [] ed; } @@ -61,7 +55,7 @@ template void voronoicell_base::check_memory_for_copy(vc_class &vc,voronoicell_base* vb) { while(current_vertex_ordercurrent_vertex_order) add_memory_vorder(vc); - for(int i=0;imec[i]) add_memory(vc,i); + for(int i=0;imec[i]) add_memory(vc,i,ds2); while(current_verticesp) add_memory_vertices(vc); } @@ -77,7 +71,7 @@ for(j=0;jnu[i]; - for(i=0;i<(p<<2);i++) pts[i]=vb->pts[i]; + for(i=0;i<3*p;i++) pts[i]=vb->pts[i]; } /** Copies the information from another voronoicell class into this @@ -111,8 +105,8 @@ void voronoicell_base::translate(double x,double y,double z) { x*=2;y*=2;z*=2; double *ptsp=pts; - while(ptsp -void voronoicell_base::add_memory(vc_class &vc,int i) { +void voronoicell_base::add_memory(vc_class &vc,int i,int *stackp2) { int s=(i<<1)+1; if(mem[i]==0) { vc.n_allocate(i,init_n_vertices); @@ -161,16 +155,7 @@ break; } } - if(dsp==stackp2) { - for(dsp=xse;dsp=3 fputs("Relocated dangling pointer",stderr); #endif @@ -192,7 +177,6 @@ template void voronoicell_base::add_memory_vertices(vc_class &vc) { int i=(current_vertices<<1),j,**pp,*pnu; - unsigned int* pmask; if(i>max_vertices) voro_fatal_error("Vertex memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); #if VOROPP_VERBOSE >=2 fprintf(stderr,"Vertex memory scaled up to %d\n",i); @@ -205,12 +189,8 @@ pnu=new int[i]; for(j=0;jmax_delete_size) voro_fatal_error("Delete stack 1 memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); #if VOROPP_VERBOSE >=2 @@ -260,7 +238,7 @@ /** Doubles the size allocation of the auxiliary delete stack. If the * allocation exceeds the absolute maximum set in max_delete2_size, then the * routine causes a fatal error. */ -void voronoicell_base::add_memory_ds2() { +void voronoicell_base::add_memory_ds2(int *&stackp2) { current_delete2_size<<=1; if(current_delete2_size>max_delete2_size) voro_fatal_error("Delete stack 2 memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); #if VOROPP_VERBOSE >=2 @@ -272,37 +250,21 @@ stacke2=ds2+current_delete2_size; } -/** Doubles the size allocation of the auxiliary delete stack. If the - * allocation exceeds the absolute maximum set in max_delete2_size, then the - * routine causes a fatal error. */ -void voronoicell_base::add_memory_xse() { - current_xsearch_size<<=1; - if(current_xsearch_size>max_xsearch_size) voro_fatal_error("Extra search stack memory allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); -#if VOROPP_VERBOSE >=2 - fprintf(stderr,"Extra search stack memory scaled up to %d\n",current_xsearch_size); -#endif - int *dsn=new int[current_xsearch_size],*dsnp=dsn,*dsp=xse; - while(dsp +inline bool voronoicell_base::search_for_outside_edge(vc_class &vc,int &up) { + int i,lp,lw,*j(ds2),*stackp2(ds2); double l; *(stackp2++)=up; while(j +inline void voronoicell_base::add_to_stack(vc_class &vc,int lp,int *&stackp2) { + for(int *k(ds2);kl) break; - } - if(ls==nu[lp]) if(definite_max(lp,ls,l,u,uw)) { - up=lp; - return false; - } - - while(uw==0) { - //if(++count>=p) failsafe_find(lp,ls,us,l,u); - - // Test all the neighbors of the current point - // and find the one which is closest to the - // plane - vs=ed[lp][nu[lp]+ls];lp=up;l=u; - for(ls=0;lsl) break; - } - if(ls==nu[lp]&&definite_max(lp,ls,l,u,uw)) { - up=lp; - return false; - } - } - us=ed[lp][nu[lp]+ls]; - return true; -} - -/** Checks whether a particular point lp is a definite maximum, searching - * through any possible minor non-convexities, for a better maximum. - * \param[in] (x,y,z) the normal vector to the plane. */ -bool voronoicell_base::definite_max(int &lp,int &ls,double &l,double &u,unsigned int &uw) { - int tp=lp,ts,qp=0; - unsigned int qw; - double q; - - // Check to see whether point up is a well-defined maximum. Otherwise - // any neighboring vertices of up that are marginal need to be - // followed, to see if they lead to a better maximum. - for(ts=0;tsl-big_tol) break; - } - if(ts==nu[tp]) return true; - - // The point tp is marginal, so it will be necessary to do the - // flood-fill search. Mark the point tp and the point qp, and search - // any remaining neighbors of the point tp. - int *stackp=ds+1; - flip(lp); - flip(qp); - *ds=qp; - ts++; - while(tsl-big_tol) { - if(stackp==stacke) add_memory_ds(); - *(stackp++)=up; - flip(up); - } - ts++; - } - - // Consider additional marginal points, starting with the original - // point qp - int *spp=ds; - while(sppl) { - flip(lp); - lp=tp; - ls=ts; - m_test(lp,l); - up=qp; - uw=qw; - u=q; - while(stackp>ds) flip(*(--stackp)); - return false; - } - - // The point is marginal and therefore must also be - // considered - if(q>l-big_tol) { - if(stackp==stacke) { - int nn=stackp-spp; - add_memory_ds(); - spp=stackp-nn; - } - *(stackp++)=qp; - flip(qp); - } - } - } - - // Reset markers and return false - flip(lp); - while(stackp>ds) flip(*(--stackp)); - return true; -} - -inline bool voronoicell_base::search_downward(unsigned int &lw,int &lp,int &ls,int &us,double &l,double &u) { - int vs; - - // The test point is outside of the cutting space - for(us=0;usl) break; - } - if(us==nu[up]) if(definite_min(lp,us,l,u,lw)) return false; - - while(lw==2) { - //if(++count>=p) failsafe_find(lp,ls,us,l,u); - - // Test all the neighbors of the current point - // and find the one which is closest to the - // plane - vs=ed[up][nu[up]+us];up=lp;u=l; - for(us=0;usl) break; - } - if(us==nu[up]&&definite_min(lp,us,l,u,lw)) return false; - } - ls=ed[up][nu[up]+us]; - return true; -} - -bool voronoicell_base::definite_min(int &lp,int &us,double &l,double &u,unsigned int &lw) { - int tp=up,ts,qp=0; - unsigned int qw; - double q; - - // Check to see whether point up is a well-defined maximum. Otherwise - // any neighboring vertices of up that are marginal need to be - // followed, to see if they lead to a better maximum. - for(ts=0;tsds) flip(*(--stackp)); - return false; - } - - // The point is marginal and therefore must also be - // considered - if(qds) flip(*(--stackp)); - return true; -} - /** Cuts the Voronoi cell by a particle whose center is at a separation of * (x,y,z) from the cell center. The value of rsq should be initially set to * \f$x^2+y^2+z^2\f$. @@ -717,200 +402,214 @@ * \return False if the plane cut deleted the cell entirely, true otherwise. */ template bool voronoicell_base::nplane(vc_class &vc,double x,double y,double z,double rsq,int p_id) { - int i,j,lp=up,cp,qp,*dsp; - int us=0,ls=0; - unsigned int uw,lw; - int *edp,*edd;stackp=ds; - double u,l=0;up=0; + int count=0,i,j,k,lp=up,cp,qp,rp,*stackp(ds),*stackp2(ds2),*dsp; + int us=0,ls=0,qs,iqs,cs,uw,qw,lw; + int *edp,*edd; + double u,l,r,q;bool complicated_setup=false,new_double_edge=false,double_edge=false; // Initialize the safe testing routine - px=x;py=y;pz=z;prsq=rsq; - maskc+=4; - if(maskc<4) reset_mask(); + n_marg=0;px=x;py=y;pz=z;prsq=rsq; + // Test approximately sqrt(n)/4 points for their proximity to the plane + // and keep the one which is closest uw=m_test(up,u); - if(uw==2) { - if(!search_downward(lw,lp,ls,us,l,u)) return false; - if(lw==1) {up=lp;lp=-1;} - } else if(uw==0) { - if(!search_upward(uw,lp,ls,us,l,u)) return true; - if(uw==1) lp=-1; - } else { - lp=-1; - } - // Set stack pointers - stackp=ds;stackp2=ds2;stackp3=xse; + // Starting from an initial guess, we now move from vertex to vertex, + // to try and find an edge which intersects the cutting plane, + // or a vertex which is on the plane + try { + if(uw==1) { - // Store initial number of vertices - int op=p; + // The test point is inside the cutting plane. + us=0; + do { + lp=ed[up][us]; + lw=m_test(lp,l); + if(l=op) continue; - - if(uw==0) { - if(u>-big_tol&&ed[up][nu[up]<<1]!=-1) { - ed[up][nu[up]<<1]=-1; - if(stackp3==stacke3) add_memory_xse(); - *(stackp3++)=up; + if(us==nu[up]) { + return false; + } + + ls=ed[up][nu[up]+us]; + while(lw==1) { + if(++count>=p) throw true; + u=l;up=lp; + for(us=0;us=p) throw true; + u=q;up=qp; + for(us=0;us=1 + fputs("Bailed out of convex calculation\n",stderr); +#endif + qw=1;lw=0; + for(qp=0;qpds) { - --p; - while(ed[p][nu[p]]==-1) { - j=nu[p]; - edp=ed[p];edd=(mep[j]+((j<<1)+1)*--mec[j]); - while(edp0) voro_fatal_error("Zero order vertex formed",VOROPP_INTERNAL_ERROR); - - // Collapse any order 2 vertices and exit - return collapse_order2(vc); -} - -/** Creates a new facet. - * \return True if cell deleted, false otherwise. */ -template -bool voronoicell_base::create_facet(vc_class &vc,int lp,int ls,double l,int us,double u,int p_id) { - int i,j,k,qp,qs,iqs,cp,cs,rp,*edp,*edd; - unsigned int lw,qw; - bool new_double_edge=false,double_edge=false; - double q,r; - // We're about to add the first point of the new facet. In either // routine, we have to add a point, so first check there's space for // it. if(p==current_vertices) add_memory_vertices(vc); - if(lp==-1) { + if(complicated_setup) { // We want to be strict about reaching the conclusion that the // cell is entirely within the cutting plane. It's not enough // to find a vertex that has edges which are all inside or on // the plane. If the vertex has neighbors that are also on the // plane, we should check those too. - if(!search_for_outside_edge(up)) return true; + if(!search_for_outside_edge(vc,up)) return false; // The search algorithm found a point which is on the cutting // plane. We leave that point in place, and create a new one at // the same location. - pts[(p<<2)]=pts[(up<<2)]; - pts[(p<<2)+1]=pts[(up<<2)+1]; - pts[(p<<2)+2]=pts[(up<<2)+2]; + pts[3*p]=pts[3*up]; + pts[3*p+1]=pts[3*up+1]; + pts[3*p+2]=pts[3*up+2]; // Search for a collection of edges of the test vertex which // are outside of the cutting space. Begin by testing the // zeroth edge. i=0; lp=*ed[up]; - lw=m_testx(lp,l); - if(lw!=0) { + lw=m_test(lp,l); + if(lw!=-1) { // The first edge is either inside the cutting space, // or lies within the cutting plane. Test the edges // sequentially until we find one that is outside. - unsigned int rw=lw; + rp=lw; do { i++; @@ -918,10 +617,10 @@ // then all of the vertices are inside // or on the plane, so the cell is completely // deleted - if(i==nu[up]) return true; + if(i==nu[up]) return false; lp=ed[up][i]; - lw=m_testx(lp,l); - } while (lw!=0); + lw=m_test(lp,l); + } while (lw!=-1); j=i+1; // We found an edge outside the cutting space. Keep @@ -929,8 +628,8 @@ // inside or on the plane. while(j=current_vertex_order) add_memory_vorder(vc); - if(mec[nu[p]]==mem[nu[p]]) add_memory(vc,nu[p]); + if(mec[nu[p]]==mem[nu[p]]) add_memory(vc,nu[p],stackp2); vc.n_set_pointer(p,nu[p]); ed[p]=mep[nu[p]]+((nu[p]<<1)+1)*mec[nu[p]]++; ed[p][nu[p]<<1]=p; @@ -978,26 +677,26 @@ // edge until we find an edge which isn't outside. i=nu[up]-1; lp=ed[up][i]; - lw=m_testx(lp,l); - while(lw==0) { + lw=m_test(lp,l); + while(lw==-1) { i--; // If i reaches zero, then we have a point in // the plane all of whose edges are outside // the cutting space, so we just exit - if(i==0) return false; + if(i==0) return true; lp=ed[up][i]; - lw=m_testx(lp,l); + lw=m_test(lp,l); } // Now search forwards from zero j=1; qp=ed[up][j]; - qw=m_testx(qp,q); - while(qw==0) { + qw=m_test(qp,q); + while(qw==-1) { j++; qp=ed[up][j]; - qw=m_testx(qp,l); + qw=m_test(qp,l); } // Compute the number of edges for the new vertex. In @@ -1007,7 +706,7 @@ // the remaining one is on the plane. For that case we // have to reduce the edge count by one to prevent // doubling up. - if(i==j&&qw==1) { + if(i==j&&qw==0) { double_edge=true; nu[p]=nu[up]; } else { @@ -1018,7 +717,7 @@ // already k=1; while(nu[p]>=current_vertex_order) add_memory_vorder(vc); - if(mec[nu[p]]==mem[nu[p]]) add_memory(vc,nu[p]); + if(mec[nu[p]]==mem[nu[p]]) add_memory(vc,nu[p],stackp2); // Copy the edges of the original vertex into the new // one. Delete the edges of the original vertex, and @@ -1058,7 +757,7 @@ } else vc.n_copy(p,0,up,qs); // Add this point to the auxiliary delete stack - if(stackp2==stacke2) add_memory_ds2(); + if(stackp2==stacke2) add_memory_ds2(stackp2); *(stackp2++)=up; // Look at the edges on either side of the group that was @@ -1078,17 +777,17 @@ // points lp and up. Create a new vertex between them which // lies on the cutting plane. Since u and l differ by at least // the tolerance, this division should never screw up. - if(stackp==stacke) add_memory_ds(); + if(stackp==stacke) add_memory_ds(stackp); *(stackp++)=up; r=u/(u-l);l=1-r; - pts[p<<2]=pts[lp<<2]*r+pts[up<<2]*l; - pts[(p<<2)+1]=pts[(lp<<2)+1]*r+pts[(up<<2)+1]*l; - pts[(p<<2)+2]=pts[(lp<<2)+2]*r+pts[(up<<2)+2]*l; + pts[3*p]=pts[3*lp]*r+pts[3*up]*l; + pts[3*p+1]=pts[3*lp+1]*r+pts[3*up+1]*l; + pts[3*p+2]=pts[3*lp+2]*r+pts[3*up+2]*l; // This point will always have three edges. Connect one of them // to lp. nu[p]=3; - if(mec[3]==mem[3]) add_memory(vc,3); + if(mec[3]==mem[3]) add_memory(vc,3,stackp2); vc.n_set_pointer(p,3); vc.n_set(p,0,p_id); vc.n_copy(p,1,up,us); @@ -1116,19 +815,19 @@ // moving around it until we find a point or edge which // intersects the plane. lp=ed[qp][qs]; - lw=m_testx(lp,l); + lw=m_test(lp,l); - if(lw==2) { + if(lw==1) { // The point is still in the cutting space. Just add it // to the delete stack and keep moving. qs=cycle_up(ed[qp][nu[qp]+qs],lp); qp=lp; q=l; - if(stackp==stacke) add_memory_ds(); + if(stackp==stacke) add_memory_ds(stackp); *(stackp++)=qp; - } else if(lw==0) { + } else if(lw==-1) { // The point is outside of the cutting space, so we've // found an intersected edge. Introduce a regular point @@ -1137,11 +836,11 @@ // new point in the facet we're constructing. if(p==current_vertices) add_memory_vertices(vc); r=q/(q-l);l=1-r; - pts[p<<2]=pts[lp<<2]*r+pts[qp<<2]*l; - pts[(p<<2)+1]=pts[(lp<<2)+1]*r+pts[(qp<<2)+1]*l; - pts[(p<<2)+2]=pts[(lp<<2)+2]*r+pts[(qp<<2)+2]*l; + pts[3*p]=pts[3*lp]*r+pts[3*qp]*l; + pts[3*p+1]=pts[3*lp+1]*r+pts[3*qp+1]*l; + pts[3*p+2]=pts[3*lp+2]*r+pts[3*qp+2]*l; nu[p]=3; - if(mec[3]==mem[3]) add_memory(vc,3); + if(mec[3]==mem[3]) add_memory(vc,3,stackp2); ls=ed[qp][qs+nu[qp]]; vc.n_set_pointer(p,3); vc.n_set(p,0,p_id); @@ -1182,8 +881,8 @@ k++; qs=cycle_up(qs,qp); lp=ed[qp][qs]; - lw=m_testx(lp,l); - } while (lw==0); + lw=m_test(lp,l); + } while (lw==-1); // Now we need to find out whether this marginal vertex // we are on has been visited before, because if that's @@ -1212,7 +911,7 @@ // going to move to next is also a // marginal point, so test for that // first. - if(lw==1) { + if(lw==0) { // Now see whether this marginal point // has been visited before. @@ -1244,7 +943,7 @@ // The vertex hasn't been visited // before, but let's see if it's // marginal - if(lw==1) { + if(lw==0) { // If it is, we need to check // for the case that it's a @@ -1264,7 +963,7 @@ // we are forming. Add memory for it if it doesn't exist // already. while(k>=current_vertex_order) add_memory_vorder(vc); - if(mec[k]==mem[k]) add_memory(vc,k); + if(mec[k]==mem[k]) add_memory(vc,k,stackp2); // Now create a new vertex with order k, or augment // the existing one @@ -1274,7 +973,6 @@ // actually need any more edges, just skip this // routine to avoid memory confusion if(nu[j]!=k) { - // Allocate memory and copy the edges // of the previous instance into it vc.n_set_aux1(k); @@ -1293,7 +991,7 @@ // structure edd=mep[nu[j]]+((nu[j]<<1)+1)*--mec[nu[j]]; if(edd!=ed[j]) { - for(int lll=0;lll<=(nu[j]<<1);lll++) ed[j][lll]=edd[lll]; + for(lw=0;lw<=(nu[j]<<1);lw++) ed[j][lw]=edd[lw]; vc.n_set_aux2_copy(j,nu[j]); vc.n_copy_pointer(edd[nu[j]<<1],j); ed[edd[nu[j]<<1]]=ed[j]; @@ -1307,11 +1005,11 @@ vc.n_set_pointer(p,k); ed[p]=mep[k]+((k<<1)+1)*mec[k]++; ed[p][k<<1]=p; - if(stackp2==stacke2) add_memory_ds2(); + if(stackp2==stacke2) add_memory_ds2(stackp2); *(stackp2++)=qp; - pts[p<<2]=pts[qp<<2]; - pts[(p<<2)+1]=pts[(qp<<2)+1]; - pts[(p<<2)+2]=pts[(qp<<2)+2]; + pts[3*p]=pts[3*qp]; + pts[3*p+1]=pts[3*qp+1]; + pts[3*p+2]=pts[3*qp+2]; ed[qp][nu[qp]<<1]=-p; j=p++; i=0; @@ -1360,7 +1058,89 @@ *ed[rp]=cp; ed[cp][nu[cp]+cs]=0; ed[rp][nu[rp]]=cs; - return false; + + // Delete points: first, remove any duplicates + dsp=ds; + while(dspds) { + --p; + while(ed[p][nu[p]]==-1) { + j=nu[p]; + edp=ed[p];edd=(mep[j]+((j<<1)+1)*--mec[j]); + while(edp0) voro_fatal_error("Zero order vertex formed",VOROPP_INTERNAL_ERROR); + + // Collapse any order 2 vertices and exit + return collapse_order2(vc); } /** During the creation of a new facet in the plane routine, it is possible @@ -1413,9 +1193,9 @@ if(up==i) up=0; if(p!=i) { if(up==p) up=i; - pts[i<<2]=pts[p<<2]; - pts[(i<<2)+1]=pts[(p<<2)+1]; - pts[(i<<2)+2]=pts[(p<<2)+2]; + pts[3*i]=pts[3*p]; + pts[3*i+1]=pts[3*p+1]; + pts[3*i+2]=pts[3*p+2]; for(k=0;k -bool voronoicell_base::collapse_order1(vc_class &vc) { +inline bool voronoicell_base::collapse_order1(vc_class &vc) { int i,j,k; while(mec[1]>0) { up=0; @@ -1450,9 +1230,9 @@ if(up==i) up=0; if(p!=i) { if(up==p) up=i; - pts[i<<2]=pts[p<<2]; - pts[(i<<2)+1]=pts[(p<<2)+1]; - pts[(i<<2)+2]=pts[(p<<2)+2]; + pts[3*i]=pts[3*p]; + pts[3*i+1]=pts[3*p+1]; + pts[3*i+2]=pts[3*p+2]; for(k=0;k -bool voronoicell_base::delete_connection(vc_class &vc,int j,int k,bool hand) { +inline bool voronoicell_base::delete_connection(vc_class &vc,int j,int k,bool hand) { int q=hand?k:cycle_up(k,j); int i=nu[j]-1,l,*edp,*edd,m; #if VOROPP_VERBOSE >=1 @@ -1479,7 +1259,7 @@ return false; } #endif - if(mec[i]==mem[i]) add_memory(vc,i); + if(mec[i]==mem[i]) add_memory(vc,i,ds2); vc.n_set_aux1(i); for(l=0;l=0) { ed[i][j]=-1-k; l=cycle_up(ed[i][nu[i]+j],k); - vx=pts[k<<2]-*pts; - vy=pts[(k<<2)+1]-pts[1]; - vz=pts[(k<<2)+2]-pts[2]; + vx=pts[3*k]-*pts; + vy=pts[3*k+1]-pts[1]; + vz=pts[3*k+2]-pts[2]; m=ed[k][l];ed[k][l]=-1-m; while(m!=i) { n=cycle_up(ed[k][nu[k]+l],m); - wx=pts[(m<<2)]-*pts; - wy=pts[(m<<2)+1]-pts[1]; - wz=pts[(m<<2)+2]-pts[2]; + wx=pts[3*m]-*pts; + wy=pts[3*m+1]-pts[1]; + wz=pts[3*m+2]-pts[2]; vol+=ux*vy*wz+uy*vz*wx+uz*vx*wy-uz*vy*wx-uy*vx*wz-ux*vz*wy; k=m;l=n;vx=wx;vy=wy;vz=wz; m=ed[k][l];ed[k][l]=-1-m; @@ -1615,112 +1330,6 @@ return vol*fe; } -/** Calculates the contributions to the Minkowski functionals for this Voronoi cell. - * \param[in] r the radius to consider. - * \param[out] ar the area functional. - * \param[out] vo the volume functional. */ -void voronoicell_base::minkowski(double r,double &ar,double &vo) { - int i,j,k,l,m,n; - ar=vo=0;r*=2; - for(i=1;i=0) { - ed[i][j]=-1-k; - l=cycle_up(ed[i][nu[i]+j],k); - m=ed[k][l];ed[k][l]=-1-m; - while(m!=i) { - n=cycle_up(ed[k][nu[k]+l],m); - minkowski_contrib(i,k,m,r,ar,vo); - k=m;l=n; - m=ed[k][l];ed[k][l]=-1-m; - } - } - } - vo*=0.125; - ar*=0.25; - reset_edges(); -} - -inline void voronoicell_base::minkowski_contrib(int i,int k,int m,double r,double &ar,double &vo) { - double ix=pts[4*i],iy=pts[4*i+1],iz=pts[4*i+2], - kx=pts[4*k],ky=pts[4*k+1],kz=pts[4*k+2], - mx=pts[4*m],my=pts[4*m+1],mz=pts[4*m+2], - ux=kx-ix,uy=ky-iy,uz=kz-iz,vx=mx-kx,vy=my-ky,vz=mz-kz, - e1x=uz*vy-uy*vz,e1y=ux*vz-uz*vx,e1z=uy*vx-ux*vy,e2x,e2y,e2z, - wmag=e1x*e1x+e1y*e1y+e1z*e1z; - if(wmag0.5) { - e2x=-e1y;e2y=e1x;e2z=0; - } else if(fabs(e1y)>0.5) { - e2x=0;e2y=-e1z;e2z=e1y; - } else { - e2x=e1z;e2y=0;e2z=-e1x; - } - wmag=1/sqrt(e2x*e2x+e2y*e2y+e2z*e2z); - e2x*=wmag;e2y*=wmag;e2z*=wmag; - - // Compute third orthonormal vector - double e3x=e1z*e2y-e1y*e2z, - e3y=e1x*e2z-e1z*e2x, - e3z=e1y*e2x-e1x*e2y, - x0=e1x*ix+e1y*iy+e1z*iz; - if(x0=0) { ed[i][j]=-1-k; l=cycle_up(ed[i][nu[i]+j],k); - vx=pts[4*k]-*pts; - vy=pts[4*k+1]-pts[1]; - vz=pts[4*k+2]-pts[2]; + vx=pts[3*k]-*pts; + vy=pts[3*k+1]-pts[1]; + vz=pts[3*k+2]-pts[2]; m=ed[k][l];ed[k][l]=-1-m; while(m!=i) { n=cycle_up(ed[k][nu[k]+l],m); - wx=pts[4*m]-*pts; - wy=pts[4*m+1]-pts[1]; - wz=pts[4*m+2]-pts[2]; + wx=pts[3*m]-*pts; + wy=pts[3*m+1]-pts[1]; + wz=pts[3*m+2]-pts[2]; tvol=ux*vy*wz+uy*vz*wx+uz*vx*wy-uz*vy*wx-uy*vx*wz-ux*vz*wy; vol+=tvol; cx+=(wx+vx-ux)*tvol; @@ -1828,7 +1439,7 @@ } } reset_edges(); - if(vol>tol_cu) { + if(vol>tolerance_sq) { vol=0.125/vol; cx=cx*vol+0.5*(*pts); cy=cy*vol+0.5*pts[1]; @@ -1841,12 +1452,12 @@ * all planes that could cut the cell have been considered. * \return The maximum radius squared of a vertex.*/ double voronoicell_base::max_radius_squared() { - double r,s,*ptsp=pts+4,*ptse=pts+(p<<2); + double r,s,*ptsp=pts+3,*ptse=pts+3*p; r=*pts*(*pts)+pts[1]*pts[1]+pts[2]*pts[2]; while(ptspr) r=s; } return r; @@ -1860,9 +1471,9 @@ for(i=0;ii) { - dx=pts[k<<2]-pts[i<<2]; - dy=pts[(k<<2)+1]-pts[(i<<2)+1]; - dz=pts[(k<<2)+2]-pts[(i<<2)+2]; + dx=pts[3*k]-pts[3*i]; + dy=pts[3*k+1]-pts[3*i+1]; + dz=pts[3*k+2]-pts[3*i+2]; dis+=sqrt(dx*dx+dy*dy+dz*dz); } } @@ -1876,13 +1487,13 @@ void voronoicell_base::draw_pov(double x,double y,double z,FILE* fp) { int i,j,k;double *ptsp=pts,*pt2; char posbuf1[128],posbuf2[128]; - for(i=0;i,r}\n",posbuf1); for(j=0;j,<%s>,r}\n",posbuf1,posbuf2); } @@ -1898,13 +1509,13 @@ for(i=1;i=0) { - fprintf(fp,"%g %g %g\n",x+0.5*pts[i<<2],y+0.5*pts[(i<<2)+1],z+0.5*pts[(i<<2)+2]); + fprintf(fp,"%g %g %g\n",x+0.5*pts[3*i],y+0.5*pts[3*i+1],z+0.5*pts[3*i+2]); l=i;m=j; do { ed[k][ed[l][nu[l]+m]]=-1-l; ed[l][m]=-1-k; l=k; - fprintf(fp,"%g %g %g\n",x+0.5*pts[k<<2],y+0.5*pts[(k<<2)+1],z+0.5*pts[(k<<2)+2]); + fprintf(fp,"%g %g %g\n",x+0.5*pts[3*k],y+0.5*pts[3*k+1],z+0.5*pts[3*k+2]); } while (search_edge(l,m,k)); fputs("\n\n",fp); } @@ -1924,7 +1535,7 @@ * 1.3.2.2 of the POV-Ray documentation. The mesh2 output consists of a list of * vertex vectors, followed by a list of triangular faces. The routine also * makes use of the optional inside_vector specification, which makes the mesh - * object solid, so that the POV-Ray Constructive Solid Geometry (CSG) can be + * object solid, so the the POV-Ray Constructive Solid Geometry (CSG) can be * applied. * \param[in] (x,y,z) a displacement vector to be added to the cell's position. * \param[in] fp a file handle to write to. */ @@ -1932,7 +1543,7 @@ int i,j,k,l,m,n; double *ptsp=pts; fprintf(fp,"mesh2 {\nvertex_vectors {\n%d\n",p); - for(i=0;i\n",x+*ptsp*0.5,y+ptsp[1]*0.5,z+ptsp[2]*0.5); + for(i=0;i\n",x+*ptsp*0.5,y+ptsp[1]*0.5,z+ptsp[2]*0.5); fprintf(fp,"}\nface_indices {\n%d\n",(p-2)<<1); for(i=1;i=maskc) { - ans=pts[4*n+3]; - return mask[n]&3; - } else return m_calc(n,ans); -} - -unsigned int voronoicell_base::m_calc(int n,double &ans) { - double *pp=pts+4*n; +inline int voronoicell_base::m_test(int n,double &ans) { + double *pp=pts+n+(n<<1); ans=*(pp++)*px; ans+=*(pp++)*py; - ans+=*(pp++)*pz-prsq; - *pp=ans; - unsigned int maskr=ans<-tol?0:(ans>tol?2:1); - mask[n]=maskc|maskr; - return maskr; + ans+=*pp*pz-prsq; + if(ans<-tolerance2) { + return -1; + } else if(ans>tolerance2) { + return 1; + } + return check_marginal(n,ans); } /** Checks to see if a given vertex is inside, outside or within the test - * plane. If the point is far away from the test plane, the routine immediately - * returns whether it is inside or outside. If the routine is close the the - * plane and within the specified tolerance, then the special check_marginal() - * routine is called. + * plane, for the case when the point has been detected to be very close to the + * plane. The routine ensures that the returned results are always consistent + * with previous tests, by keeping a table of any marginal results. The routine + * first sees if the vertex is in the table, and if it finds a previously + * computed result it uses that. Otherwise, it computes a result for this + * vertex and adds it the table. * \param[in] n the vertex to test. - * \param[out] ans the result of the scalar product used in evaluating the - * location of the point. + * \param[in] ans the result of the scalar product used in evaluating + * the location of the point. * \return -1 if the point is inside the plane, 1 if the point is outside the * plane, or 0 if the point is within the plane. */ -inline unsigned int voronoicell_base::m_testx(int n,double &ans) { - unsigned int maskr; - if(mask[n]>=maskc) { - ans=pts[4*n+3]; - maskr=mask[n]&3; - } else maskr=m_calc(n,ans); - if(maskr==0&&ans>-big_tol&&ed[n][nu[n]<<1]!=-1) { - ed[n][nu[n]<<1]=-1; - if(stackp3==stacke3) add_memory_xse(); - *(stackp3++)=n; - } - return maskr; +int voronoicell_base::check_marginal(int n,double &ans) { + int i; + for(i=0;imax_marginal) + voro_fatal_error("Marginal case buffer allocation exceeded absolute maximum",VOROPP_MEMORY_ERROR); +#if VOROPP_VERBOSE >=2 + fprintf(stderr,"Marginal cases buffer scaled up to %d\n",i); +#endif + int *pmarg=new int[current_marginal]; + for(int j=0;jtolerance?1:(ans<-tolerance?-1:0); + return marg[n_marg-1]; } -/** This routine calculates the unit normal vectors for every face. +/** For each face of the Voronoi cell, this routine prints the out the normal + * vector of the face, and scales it to the distance from the cell center to + * that plane. * \param[out] v the vector to store the results in. */ void voronoicell_base::normals(std::vector &v) { int i,j,k; @@ -2047,18 +1663,18 @@ double ux,uy,uz,vx,vy,vz,wx,wy,wz,wmag; do { m=ed[k][l];ed[k][l]=-1-m; - ux=pts[4*m]-pts[4*k]; - uy=pts[4*m+1]-pts[4*k+1]; - uz=pts[4*m+2]-pts[4*k+2]; + ux=pts[3*m]-pts[3*k]; + uy=pts[3*m+1]-pts[3*k+1]; + uz=pts[3*m+2]-pts[3*k+2]; // Test to see if the length of this edge is above the tolerance - if(ux*ux+uy*uy+uz*uz>tol) { + if(ux*ux+uy*uy+uz*uz>tolerance_sq) { while(m!=i) { l=cycle_up(ed[k][nu[k]+l],m); k=m;m=ed[k][l];ed[k][l]=-1-m; - vx=pts[4*m]-pts[4*k]; - vy=pts[4*m+1]-pts[4*k+1]; - vz=pts[4*m+2]-pts[4*k+2]; + vx=pts[3*m]-pts[3*k]; + vy=pts[3*m+1]-pts[3*k+1]; + vz=pts[3*m+2]-pts[3*k+2]; // Construct the vector product of this edge with // the previous one @@ -2069,7 +1685,7 @@ // Test to see if this vector product of the // two edges is above the tolerance - if(wmag>tol) { + if(wmag>tolerance_sq) { // Construct the normal vector and print it wmag=1/sqrt(wmag); @@ -2099,6 +1715,7 @@ v.push_back(0); } + /** Returns the number of faces of a computed Voronoi cell. * \return The number of faces. */ int voronoicell_base::number_of_faces() { @@ -2146,7 +1763,7 @@ for(int i=0;i<3*p;i+=3) { v[i]=*(ptsp++)*0.5; v[i+1]=*(ptsp++)*0.5; - v[i+2]=*ptsp*0.5;ptsp+=2; + v[i+2]=*(ptsp++)*0.5; } } @@ -2155,10 +1772,11 @@ void voronoicell_base::output_vertices(FILE *fp) { if(p>0) { fprintf(fp,"(%g,%g,%g)",*pts*0.5,pts[1]*0.5,pts[2]*0.5); - for(double *ptsp=pts+4;ptsp0) { fprintf(fp,"(%g,%g,%g)",x+*pts*0.5,y+pts[1]*0.5,z+pts[2]*0.5); - for(double *ptsp=pts+4;ptsp=0) { - dx=pts[k<<2]-pts[i<<2]; - dy=pts[(k<<2)+1]-pts[(i<<2)+1]; - dz=pts[(k<<2)+2]-pts[(i<<2)+2]; + dx=pts[3*k]-pts[3*i]; + dy=pts[3*k+1]-pts[3*i+1]; + dz=pts[3*k+2]-pts[3*i+2]; perim=sqrt(dx*dx+dy*dy+dz*dz); ed[i][j]=-1-k; l=cycle_up(ed[i][nu[i]+j],k); do { m=ed[k][l]; - dx=pts[m<<2]-pts[k<<2]; - dy=pts[(m<<2)+1]-pts[(k<<2)+1]; - dz=pts[(m<<2)+2]-pts[(k<<2)+2]; + dx=pts[3*m]-pts[3*k]; + dy=pts[3*m+1]-pts[3*k+1]; + dz=pts[3*m+2]-pts[3*k+2]; perim+=sqrt(dx*dx+dy*dy+dz*dz); ed[k][l]=-1-m; l=cycle_up(ed[k][nu[k]+l],m); @@ -2300,7 +1918,7 @@ * \param[in] rsq the distance along this vector of the plane. * \return False if the plane does not intersect the plane, true if it does. */ bool voronoicell_base::plane_intersects(double x,double y,double z,double rsq) { - double g=x*pts[up<<2]+y*pts[(up<<2)+1]+z*pts[(up<<2)+2]; + double g=x*pts[3*up]+y*pts[3*up+1]+z*pts[3*up+2]; if(g>3,mp=1; double m; while(cag) { if(m>rsq) return true; g=m;up=mp; @@ -2331,37 +1949,21 @@ return true; } -/* This routine tests to see if a cell intersects a plane, by tracing over the - * cell from vertex to vertex, starting at up. It is meant to be called either - * by plane_intersects() or plane_intersects_track(), when those routines - * cannot immediately resolve the case. +/* This routine tests to see if a cell intersects a plane, by tracing over the cell from + * vertex to vertex, starting at up. It is meant to be called either by plane_intersects() + * or plane_intersects_track(), when those routines cannot immediately resolve the case. * \param[in] (x,y,z) the normal vector to the plane. * \param[in] rsq the distance along this vector of the plane. * \param[in] g the distance of up from the plane. * \return False if the plane does not intersect the plane, true if it does. */ inline bool voronoicell_base::plane_intersects_track(double x,double y,double z,double rsq,double g) { - - for(int tp=0;tprsq) return true; - return false; -/* - int ls,us,lp; - double l,u; - unsigned int uw; - - // Initialize the safe testing routine - px=x;py=y;pz=z;prsq=rsq; - maskc+=4; - if(maskc<4) reset_mask(); - - return search_upward(uw,lp,ls,us,l,u); -}*/ - /* int count=0,ls,us,tp; double t; + // The test point is outside of the cutting space for(us=0;usg) { ls=ed[up][nu[up]+us]; up=tp; @@ -2370,7 +1972,7 @@ #if VOROPP_VERBOSE >=1 fputs("Bailed out of convex calculation",stderr); #endif - for(tp=0;tprsq) return true; + for(tp=0;tprsq) return true; return false; } @@ -2378,15 +1980,15 @@ // and find the one which is closest to the // plane for(us=0;ust) break; } if(us==ls) { us++; while(ust) break; us++; } @@ -2397,7 +1999,7 @@ return true; } } - return false;*/ + return false; } /** Counts the number of edges of the Voronoi cell. @@ -2575,7 +2177,7 @@ } /** The class constructor allocates memory for storing neighbor information. */ -void voronoicell_neighbor::memory_setup() { +voronoicell_neighbor::voronoicell_neighbor() { int i; mne=new int*[current_vertex_order]; ne=new int*[current_vertices]; @@ -2618,7 +2220,7 @@ void voronoicell_base::print_edges() { int j; double *ptsp=pts; - for(int i=0;i &v); void output_vertices(double x,double y,double z,FILE *fp=stdout); void face_areas(std::vector &v); - void minkowski(double r,double &ar,double &vo); /** Outputs the areas of the faces. * \param[in] fp the file handle to write to. */ inline void output_face_areas(FILE *fp=stdout) { @@ -250,13 +243,19 @@ /** This is the delete stack, used to store the vertices which * are going to be deleted during the plane cutting procedure. */ - int *ds,*stackp,*stacke; + int *ds,*stacke; /** This is the auxiliary delete stack, which has size set by * current_delete2_size. */ - int *ds2,*stackp2,*stacke2; - /** This is the extra search stack. */ - int *xse,*stackp3,*stacke3; - unsigned int maskc; + int *ds2,*stacke2; + /** This stores the current memory allocation for the marginal + * cases. */ + int current_marginal; + /** This stores the total number of marginal points which are + * currently in the buffer. */ + int n_marg; + /** This array contains a list of the marginal points, and also + * the outcomes of the marginal tests. */ + int *marg; /** The x coordinate of the normal vector to the test plane. */ double px; /** The y coordinate of the normal vector to the test plane. */ @@ -266,43 +265,27 @@ /** The magnitude of the normal vector to the test plane. */ double prsq; template - void add_memory(vc_class &vc,int i); + void add_memory(vc_class &vc,int i,int *stackp2); template void add_memory_vertices(vc_class &vc); template void add_memory_vorder(vc_class &vc); - void add_memory_ds(); - void add_memory_ds2(); - void add_memory_xse(); - bool failsafe_find(int &lp,int &ls,int &us,double &l,double &u); + void add_memory_ds(int *&stackp); + void add_memory_ds2(int *&stackp2); template - bool create_facet(vc_class &vc,int lp,int ls,double l,int us,double u,int p_id); - template - bool collapse_order1(vc_class &vc); + inline bool collapse_order1(vc_class &vc); template inline bool collapse_order2(vc_class &vc); template - bool delete_connection(vc_class &vc,int j,int k,bool hand); - inline bool search_for_outside_edge(int &up); - inline void add_to_stack(int sc2,int lp); - inline void reset_mask() { - for(int i=0;i + inline bool search_for_outside_edge(vc_class &vc,int &up); + template + inline void add_to_stack(vc_class &vc,int lp,int *&stackp2); inline bool plane_intersects_track(double x,double y,double z,double rs,double g); inline void normals_search(std::vector &v,int i,int j,int k); inline bool search_edge(int l,int &m,int &k); - inline unsigned int m_test(int n,double &ans); - inline unsigned int m_testx(int n,double &ans); - unsigned int m_calc(int n,double &ans); - inline void flip(int tp) {ed[tp][nu[tp]<<1]=-1-ed[tp][nu[tp]<<1];} + inline int m_test(int n,double &ans); int check_marginal(int n,double &ans); friend class voronoicell; friend class voronoicell_neighbor; @@ -317,10 +300,6 @@ class voronoicell : public voronoicell_base { public: using voronoicell_base::nplane; - voronoicell() : voronoicell_base(default_length*default_length) {} - voronoicell(double max_len_sq_) : voronoicell_base(max_len_sq_) {} - template - voronoicell(c_class &con) : voronoicell_base(con.max_len_sq) {} /** Copies the information from another voronoicell class into * this class, extending memory allocation if necessary. * \param[in] c the class to copy. */ @@ -392,7 +371,6 @@ inline void init_tetrahedron(double x0,double y0,double z0,double x1,double y1,double z1,double x2,double y2,double z2,double x3,double y3,double z3) { init_tetrahedron_base(x0,y0,z0,x1,y1,z1,x2,y2,z2,x3,y3,z3); } - void init_l_shape(); private: inline void n_allocate(int i,int m) {}; inline void n_add_memory_vertices(int i) {}; @@ -437,16 +415,7 @@ * i. It is set to the ID number of the plane that made the * face that is clockwise from the jth edge. */ int **ne; - voronoicell_neighbor() : voronoicell_base(default_length*default_length) { - memory_setup(); - } - voronoicell_neighbor(double max_len_sq_) : voronoicell_base(max_len_sq_) { - memory_setup(); - } - template - voronoicell_neighbor(c_class &con) : voronoicell_base(con.max_len_sq) { - memory_setup(); - } + voronoicell_neighbor(); ~voronoicell_neighbor(); void operator=(voronoicell &c); void operator=(voronoicell_neighbor &c); @@ -507,7 +476,6 @@ private: int *paux1; int *paux2; - void memory_setup(); inline void n_allocate(int i,int m) {mne[i]=new int[m*i];} inline void n_add_memory_vertices(int i) { int **pp=new int*[i]; diff -Nru voro++-0.5/src/c_loops.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/c_loops.cc --- voro++-0.5/src/c_loops.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/c_loops.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/c_loops.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/c_loops.hh --- voro++-0.5/src/c_loops.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/c_loops.hh 2013-10-17 18:18:28.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/cmd_line.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/cmd_line.cc --- voro++-0.5/src/cmd_line.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/cmd_line.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -24,7 +24,7 @@ // This message gets displayed if the user requests the help flag void help_message() { - puts("Voro++ version 0.4.6, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" + puts("Voro++ version 0.4.5, by Chris H. Rycroft (UC Berkeley/LBL)\n\n" "Syntax: voro++ [options] \n" " \n\n" "By default, the utility reads in the input file of particle IDs and positions,\n" @@ -111,7 +111,7 @@ // Ths message is displayed if the user requests version information void version_message() { - puts("Voro++ version 0.4.6 (October 17th 2013)"); + puts("Voro++ version 0.4.5 (July 27th 2012)"); } // Prints an error message. This is called when the program is unable to make @@ -126,7 +126,7 @@ void cmd_line_output(c_loop &vl,c_class &con,const char* format,FILE* outfile,FILE* gnu_file,FILE* povp_file,FILE* povv_file,bool verbose,double &vol,int &vcc,int &tp) { int pid,ps=con.ps;double x,y,z,r; if(con.contains_neighbor(format)) { - voronoicell_neighbor c(con); + voronoicell_neighbor c; if(vl.start()) do if(con.compute_cell(c,vl)) { vl.pos(pid,x,y,z,r); if(outfile!=NULL) c.output_custom(format,pid,x,y,z,r,outfile); @@ -143,7 +143,7 @@ if(verbose) {vol+=c.volume();vcc++;} } while(vl.inc()); } else { - voronoicell c(con); + voronoicell c; if(vl.start()) do if(con.compute_cell(c,vl)) { vl.pos(pid,x,y,z,r); if(outfile!=NULL) c.output_custom(format,pid,x,y,z,r,outfile); @@ -265,12 +265,12 @@ double w0=atof(argv[i++]),w1=atof(argv[i++]); double w2=atof(argv[i++]),w3=atof(argv[i++]); double w4=atof(argv[i++]),w5=atof(argv[i]); - wl.add_wall(new wall_plane(-1,0,0,-w0,j));j--; - wl.add_wall(new wall_plane(1,0,0,w1,j));j--; - wl.add_wall(new wall_plane(0,-1,0,-w2,j));j--; - wl.add_wall(new wall_plane(0,1,0,w3,j));j--; - wl.add_wall(new wall_plane(0,0,-1,-w4,j));j--; - wl.add_wall(new wall_plane(0,0,1,w5,j));j--; + wl.add_wall(new wall_plane(-1,0,0,-w0,j));j--; + wl.add_wall(new wall_plane(1,0,0,w1,j));j--; + wl.add_wall(new wall_plane(0,-1,0,-w2,j));j--; + wl.add_wall(new wall_plane(0,1,0,w3,j));j--; + wl.add_wall(new wall_plane(0,0,-1,-w4,j));j--; + wl.add_wall(new wall_plane(0,0,1,w5,j));j--; } else if(strcmp(argv[i],"-ws")==0) { if(i>=argc-11) {error_message();wl.deallocate();return VOROPP_CMD_LINE_ERROR;} i++; @@ -487,7 +487,7 @@ "Total V. cell volume : %g\n",tp,((double) tp)/(nx*ny*nz), vcc,(bx-ax)*(by-ay)*(bz-az),vol); } - + // Close output files fclose(outfile); if(gnu_file!=NULL) fclose(gnu_file); @@ -495,3 +495,4 @@ if(povv_file!=NULL) fclose(povv_file); return 0; } + diff -Nru voro++-0.5/src/common.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/common.cc --- voro++-0.5/src/common.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/common.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -11,54 +11,6 @@ namespace voro { -void check_duplicate(int n,double x,double y,double z,int id,double *qp) { - double dx=*qp-x,dy=qp[1]-y,dz=qp[2]-z; - if(dx*dx+dy*dy+dz*dz<1e-10) { - printf("Duplicate: %d (%g,%g,%g) matches %d (%g,%g,%g)\n",n,x,y,z,id,*qp,qp[1],qp[2]); - exit(1); - } -} - -/** \brief Function for printing fatal error messages and exiting. - * - * Function for printing fatal error messages and exiting. - * \param[in] p a pointer to the message to print. - * \param[in] status the status code to return with. */ -void voro_fatal_error(const char *p,int status) { - fprintf(stderr,"voro++: %s\n",p); - exit(status); -} - -/** \brief Prints a vector of positions. - * - * Prints a vector of positions as bracketed triplets. - * \param[in] v the vector to print. - * \param[in] fp the file stream to print to. */ -void voro_print_positions(std::vector &v,FILE *fp) { - if(v.size()>0) { - fprintf(fp,"(%g,%g,%g)",v[0],v[1],v[2]); - for(int k=3;(unsigned int) k &v,FILE *fp=stdout) { + if(v.size()>0) { + fprintf(fp,"(%g,%g,%g)",v[0],v[1],v[2]); + for(int k=3;(unsigned int) k &v,FILE *fp=stdout); -FILE* safe_fopen(const char *filename,const char *mode); void voro_print_vector(std::vector &v,FILE *fp=stdout); void voro_print_vector(std::vector &v,FILE *fp=stdout); void voro_print_face_vertices(std::vector &v,FILE *fp=stdout); diff -Nru voro++-0.5/src/config.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/config.hh --- voro++-0.5/src/config.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/config.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -10,8 +10,6 @@ #ifndef VOROPP_CONFIG_HH #define VOROPP_CONFIG_HH -#include - namespace voro { // These constants set the initial memory allocation for the Voronoi cell @@ -25,12 +23,12 @@ /** The initial memory allocation for the number of vertices of higher order. */ const int init_n_vertices=8; +/** The initial buffer size for marginal cases used by the suretest class. */ +const int init_marginal=64; /** The initial size for the delete stack. */ const int init_delete_size=256; /** The initial size for the auxiliary delete stack. */ const int init_delete2_size=256; -/** The initial size for the extra search stack. */ -const int init_xsearch_size=32; /** The initial size for the wall pointer array. */ const int init_wall_size=32; /** The default initial size for the ordering class. */ @@ -46,12 +44,12 @@ const int max_vertex_order=2048; /** The maximum memory allocation for the any particular order of vertex. */ const int max_n_vertices=16777216; +/** The maximum buffer size for marginal cases used by the suretest class. */ +const int max_marginal=16777216; /** The maximum size for the delete stack. */ const int max_delete_size=16777216; /** The maximum size for the auxiliary delete stack. */ const int max_delete2_size=16777216; -/** The maximum size for the extra search stack. */ -const int max_xsearch_size=16777216; /** The maximum amount of particle memory allocated for a single region. */ const int max_particle_memory=16777216; /** The maximum size for the wall pointer array. */ @@ -72,19 +70,25 @@ * plane routine bails out due to floating point problems. At level 2, general * messages about memory expansion are printed. At level 3, technical details * about memory management are printed. */ -#define VOROPP_VERBOSE 2 +#define VOROPP_VERBOSE 0 #endif /** If a point is within this distance of a cutting plane, then the code * assumes that point exactly lies on the plane. */ -const double tolerance=10.*std::numeric_limits::epsilon(); - -const double big_tolerance_fac=20.; +const double tolerance=1e-11; -const double default_length=1000.; +/** If a point is within this distance of a cutting plane, then the code stores + * whether this point is inside, outside, or exactly on the cutting plane in + * the marginal cases buffer, to prevent the test giving a different result on + * a subsequent evaluation due to floating point rounding errors. */ +const double tolerance2=2e-11; + +/** The square of the tolerance, used when deciding whether some squared + * quantities are large enough to be used. */ +const double tolerance_sq=tolerance*tolerance; /** A large number that is used in the computation. */ -const double large_number=std::numeric_limits::max(); +const double large_number=1e30; /** A radius to use as a placeholder when no other information is available. */ const double default_radius=0.5; diff -Nru voro++-0.5/src/container.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/container.cc --- voro++-0.5/src/container.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/container.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -31,11 +31,8 @@ int nx_,int ny_,int nz_,bool xperiodic_,bool yperiodic_,bool zperiodic_,int init_mem,int ps_) : voro_base(nx_,ny_,nz_,(bx_-ax_)/nx_,(by_-ay_)/ny_,(bz_-az_)/nz_), ax(ax_), bx(bx_), ay(ay_), by(by_), az(az_), bz(bz_), - max_len_sq((bx-ax)*(bx-ax)*(xperiodic_?0.25:1)+(by-ay)*(by-ay)*(yperiodic_?0.25:1) - +(bz-az)*(bz-az)*(zperiodic_?0.25:1)), xperiodic(xperiodic_), yperiodic(yperiodic_), zperiodic(zperiodic_), id(new int*[nxyz]), p(new double*[nxyz]), co(new int[nxyz]), mem(new int[nxyz]), ps(ps_) { - int l; for(l=0;l,rr}\nsphere{<%g,%g,%g>,rr}\n",ax,ay,bz,bx,ay,bz,ax,by,bz,bx,by,bz); } + /** The wall_list constructor sets up an array of pointers to wall classes. */ wall_list::wall_list() : walls(new wall*[init_wall_size]), wep(walls), wel(walls+init_wall_size), current_wall_size(init_wall_size) {} diff -Nru voro++-0.5/src/container.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/container.hh --- voro++-0.5/src/container.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/container.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -126,9 +126,6 @@ const double az; /** The maximum z coordinate of the container. */ const double bz; - /** The maximum length squared that could be encountered in the - * Voronoi cell calculation. */ - const double max_len_sq; /** A boolean value that determines if the x coordinate in * periodic or not. */ const bool xperiodic; @@ -377,7 +374,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_gnuplot(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { pp=p[vl.ijk]+ps*vl.q; c.draw_gnuplot(*pp,pp[1],pp[2],fp); @@ -404,7 +401,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_pov(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { fprintf(fp,"// cell %d\n",id[vl.ijk][vl.q]); pp=p[vl.ijk]+ps*vl.q; @@ -435,13 +432,13 @@ void print_custom(c_loop &vl,const char *format,FILE *fp) { int ijk,q;double *pp; if(contains_neighbor(format)) { - voronoicell_neighbor c(*this); + voronoicell_neighbor c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],default_radius,fp); } while(vl.inc()); } else { - voronoicell c(*this); + voronoicell c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],default_radius,fp); @@ -628,7 +625,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_pov(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { fprintf(fp,"// cell %d\n",id[vl.ijk][vl.q]); pp=p[vl.ijk]+ps*vl.q; @@ -659,13 +656,13 @@ void print_custom(c_loop &vl,const char *format,FILE *fp) { int ijk,q;double *pp; if(contains_neighbor(format)) { - voronoicell_neighbor c(*this); + voronoicell_neighbor c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],pp[3],fp); } while(vl.inc()); } else { - voronoicell c(*this); + voronoicell c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],pp[3],fp); diff -Nru voro++-0.5/src/container_prd.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/container_prd.cc --- voro++-0.5/src/container_prd.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/container_prd.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -28,8 +28,7 @@ * particle. */ container_periodic_base::container_periodic_base(double bx_,double bxy_,double by_, double bxz_,double byz_,double bz_,int nx_,int ny_,int nz_,int init_mem_,int ps_) - : unitcell(bx_,bxy_,by_,bxz_,byz_,bz_), - voro_base(nx_,ny_,nz_,bx_/nx_,by_/ny_,bz_/nz_), max_len_sq(unit_voro.max_radius_squared()), + : unitcell(bx_,bxy_,by_,bxz_,byz_,bz_), voro_base(nx_,ny_,nz_,bx_/nx_,by_/ny_,bz_/nz_), ey(int(max_uv_y*ysp+1)), ez(int(max_uv_z*zsp+1)), wy(ny+ey), wz(nz+ez), oy(ny+2*ey), oz(nz+2*ez), oxyz(nx*oy*oz), id(new int*[oxyz]), p(new double*[oxyz]), co(new int[oxyz]), mem(new int[oxyz]), img(new char[oxyz]), init_mem(init_mem_), ps(ps_) { @@ -94,7 +93,6 @@ void container_periodic::put(int n,double x,double y,double z) { int ijk; put_locate_block(ijk,x,y,z); - for(int l=0;l void draw_cells_gnuplot(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { pp=p[vl.ijk]+ps*vl.q; c.draw_gnuplot(*pp,pp[1],pp[2],fp); @@ -330,7 +329,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_pov(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { fprintf(fp,"// cell %d\n",id[vl.ijk][vl.q]); pp=p[vl.ijk]+ps*vl.q; @@ -361,13 +360,13 @@ void print_custom(c_loop &vl,const char *format,FILE *fp) { int ijk,q;double *pp; if(contains_neighbor(format)) { - voronoicell_neighbor c(*this); + voronoicell_neighbor c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],default_radius,fp); } while(vl.inc()); } else { - voronoicell c(*this); + voronoicell c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],default_radius,fp); @@ -419,7 +418,7 @@ bool q=compute_cell(c,ijk,co[ijk]-1); co[ijk]--; return q; - } + } private: voro_compute vc; friend class voro_compute; @@ -526,7 +525,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_gnuplot(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { pp=p[vl.ijk]+ps*vl.q; c.draw_gnuplot(*pp,pp[1],pp[2],fp); @@ -553,7 +552,7 @@ * \param[in] fp a file handle to write to. */ template void draw_cells_pov(c_loop &vl,FILE *fp) { - voronoicell c(*this);double *pp; + voronoicell c;double *pp; if(vl.start()) do if(compute_cell(c,vl)) { fprintf(fp,"// cell %d\n",id[vl.ijk][vl.q]); pp=p[vl.ijk]+ps*vl.q; @@ -584,13 +583,13 @@ void print_custom(c_loop &vl,const char *format,FILE *fp) { int ijk,q;double *pp; if(contains_neighbor(format)) { - voronoicell_neighbor c(*this); + voronoicell_neighbor c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],pp[3],fp); } while(vl.inc()); } else { - voronoicell c(*this); + voronoicell c; if(vl.start()) do if(compute_cell(c,vl)) { ijk=vl.ijk;q=vl.q;pp=p[ijk]+ps*q; c.output_custom(format,id[ijk][q],*pp,pp[1],pp[2],pp[3],fp); diff -Nru voro++-0.5/src/Doxyfile voro++-0.5+revert-to-0.4.6+dfsg1/src/Doxyfile --- voro++-0.5/src/Doxyfile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/Doxyfile 2013-10-17 18:01:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Doxyfile 1.8.9.1 +# Doxyfile 1.8.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,10 +46,10 @@ PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. PROJECT_LOGO = @@ -60,7 +60,7 @@ OUTPUT_DIRECTORY = .. -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -70,37 +70,27 @@ CREATE_SUBDIRS = NO -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. +# Possible values are: Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese- +# Traditional, Croatian, Czech, Danish, Dutch, English, Esperanto, Farsi, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en, +# Korean, Korean-en, Latvian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# Turkish, Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -135,7 +125,7 @@ INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -205,9 +195,9 @@ INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -269,14 +259,11 @@ # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. # -# Note: For files without extension you can use no_extension as a placeholder. +# Note For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -295,8 +282,8 @@ # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -336,7 +323,7 @@ IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first +# tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. @@ -401,7 +388,7 @@ # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -411,35 +398,35 @@ EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. If set to YES, local methods, +# This flag is only useful for Objective-C code. When set to YES local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are +# included in the documentation. If set to NO only methods in the interface are # included. # The default value is: NO. @@ -464,21 +451,21 @@ # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be +# (class|struct|union) declarations. If set to NO these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these +# documentation blocks found inside the body of a function. If set to NO these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -492,7 +479,7 @@ INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also +# names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -501,32 +488,18 @@ CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the +# their full class and namespace scopes in the documentation. If set to YES the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. @@ -541,15 +514,14 @@ # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. +# name. If set to NO the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. +# name. If set to NO the members will appear in declaration order. # The default value is: NO. SORT_BRIEF_DOCS = NO @@ -593,25 +565,27 @@ STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -636,8 +610,8 @@ MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -685,7 +659,8 @@ # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. CITE_BIB_FILES = @@ -701,7 +676,7 @@ QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -709,7 +684,7 @@ WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -726,8 +701,8 @@ # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO @@ -875,7 +850,7 @@ FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for +# INPUT_FILTER ) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -935,7 +910,7 @@ REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -1012,7 +987,7 @@ # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1074,15 +1049,13 @@ HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1098,7 +1071,7 @@ HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to +# will adjust the colors in the stylesheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1226,29 +1199,28 @@ CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# including file name) of the HTML help compiler ( hhc.exe). If non-empty # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1361,7 +1333,7 @@ # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1389,7 +1361,7 @@ TREEVIEW_WIDTH = 250 -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1418,7 +1390,7 @@ # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# instead of using prerendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1488,11 +1460,11 @@ # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. There -# are two flavors of web server based searching depending on the EXTERNAL_SEARCH -# setting. When disabled, doxygen will generate a PHP script for searching and -# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing -# and searching needs to be provided by external tools. See the section -# "External Indexing and Searching" for details. +# are two flavours of web server based searching depending on the +# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for +# searching and an index file used by the script. When EXTERNAL_SEARCH is +# enabled the indexing and searching needs to be provided by external tools. See +# the section "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1504,7 +1476,7 @@ # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer (doxyindexer) and search engine +# Doxygen ships with an example indexer ( doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1517,7 +1489,7 @@ # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer (doxyindexer) and search engine +# Doxygen ships with an example indexer ( doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1555,7 +1527,7 @@ # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1586,7 +1558,7 @@ MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1621,36 +1593,23 @@ # # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber, -# $projectbrief, $projectlogo. Doxygen will replace $title with the empty -# string, for the replacement values of the other commands the user is referred -# to HTML_HEADER. +# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will +# replace them by respectively the title of the page, the current date and time, +# only the current date, the version number of doxygen, the project name (see +# PROJECT_NAME), or the project number (see PROJECT_NUMBER). # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. See -# LATEX_HEADER for more information on how to generate a default footer and what -# special commands can be used inside the footer. +# chapter. If it is left blank doxygen will generate a standard footer. # # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = -# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# LaTeX style sheets that are included after the standard style sheets created -# by doxygen. Using this option one can overrule certain style aspects. Doxygen -# will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). -# This tag requires that the tag GENERATE_LATEX is set to YES. - -LATEX_EXTRA_STYLESHEET = - # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1668,8 +1627,8 @@ PDF_HYPERLINKS = YES -# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES, to get a +# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1714,7 +1673,7 @@ # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1729,7 +1688,7 @@ RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1766,21 +1725,11 @@ RTF_EXTENSIONS_FILE = -# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code -# with syntax highlighting in the RTF output. -# -# Note that which sources are shown also depends on other settings such as -# SOURCE_BROWSER. -# The default value is: NO. -# This tag requires that the tag GENERATE_RTF is set to YES. - -RTF_SOURCE_CODE = NO - #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1804,13 +1753,6 @@ MAN_EXTENSION = .3 -# The MAN_SUBDIR tag determines the name of the directory created within -# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by -# MAN_EXTENSION with the initial . removed. -# This tag requires that the tag GENERATE_MAN is set to YES. - -MAN_SUBDIR = - # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real # man page(s). These additional files only source the real man page, but without @@ -1824,7 +1766,7 @@ # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1838,7 +1780,19 @@ XML_OUTPUT = xml -# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a +# validating XML parser to check the syntax of the XML files. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify a XML DTD, which can be used by a +# validating XML parser to check the syntax of the XML files. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1851,7 +1805,7 @@ # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1865,23 +1819,14 @@ DOCBOOK_OUTPUT = docbook -# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the -# program listings (including syntax highlighting and cross-referencing -# information) to the DOCBOOK output. Note that enabling this will significantly -# increase the size of the DOCBOOK output. -# The default value is: NO. -# This tag requires that the tag GENERATE_DOCBOOK is set to YES. - -DOCBOOK_PROGRAMLISTING = NO - #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen +# Definitions (see http://autogen.sf.net) file that captures the structure of +# the code including all documentation. Note that this feature is still +# experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1890,7 +1835,7 @@ # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1898,7 +1843,7 @@ GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1906,9 +1851,9 @@ PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO, the +# understand what is going on. On the other hand, if this tag is set to NO the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1928,14 +1873,14 @@ # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names -# in the source code. If set to NO, only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names +# in the source code. If set to NO only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1951,7 +1896,7 @@ EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# If the SEARCH_INCLUDES tag is set to YES the includes files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1993,9 +1938,9 @@ EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all references to function-like macros that are alone on a line, have -# an all uppercase name, and do not end with a semicolon. Such function macros -# are typically used for boiler-plate code, and will confuse the parser if not +# remove all refrences to function-like macros that are alone on a line, have an +# all uppercase name, and do not end with a semicolon. Such function macros are +# typically used for boiler-plate code, and will confuse the parser if not # removed. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -2015,7 +1960,7 @@ # where loc1 and loc2 can be relative or absolute paths or URLs. See the # section "Linking to external documentation" for more information about the use # of tag files. -# Note: Each tag file must have a unique name (where the name does NOT include +# Note: Each tag file must have an unique name (where the name does NOT include # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. @@ -2027,21 +1972,20 @@ GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES, all external class will be listed in -# the class index. If set to NO, only the inherited external classes will be -# listed. +# If the ALLEXTERNALS tag is set to YES all external class will be listed in the +# class index. If set to NO only the inherited external classes will be listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in +# the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2058,7 +2002,7 @@ # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2076,14 +2020,7 @@ MSCGEN_PATH = -# You can include diagrams made with dia in doxygen documentation. Doxygen will -# then run dia to produce the diagram and insert it in the documentation. The -# DIA_PATH tag allows you to specify the directory where the dia binary resides. -# If left empty dia is assumed to be found in the default search path. - -DIA_PATH = - -# If set to YES the inheritance and collaboration graphs will hide inheritance +# If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2108,7 +2045,7 @@ DOT_NUM_THREADS = 0 -# When you want a differently looking font in the dot files that doxygen +# When you want a differently looking font n the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -2156,7 +2093,7 @@ GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2283,25 +2220,6 @@ MSCFILE_DIRS = -# The DIAFILE_DIRS tag can be used to specify one or more directories that -# contain dia files that are included in the documentation (see the \diafile -# command). - -DIAFILE_DIRS = - -# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the -# path where java can find the plantuml.jar file. If left blank, it is assumed -# PlantUML is not used or called during a preprocessing step. Doxygen will -# generate a warning when it encounters a \startuml command in this case and -# will not generate output for the diagram. - -PLANTUML_JAR_PATH = - -# When using plantuml, the specified paths are searched for files specified by -# the !include statement in a plantuml block. - -PLANTUML_INCLUDE_PATH = - # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2338,7 +2256,7 @@ DOT_TRANSPARENT = YES -# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2355,7 +2273,7 @@ GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff -Nru voro++-0.5/src/Makefile voro++-0.5+revert-to-0.4.6+dfsg1/src/Makefile --- voro++-0.5/src/Makefile 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/Makefile 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ # Voro++ makefile # -# Author : Chris H. Rycroft (Harvard University / LBL) +# Author : Chris H. Rycroft (LBL / UC Berkeley) # Email : chr@alum.mit.edu # Date : August 30th 2011 diff -Nru voro++-0.5/src/pre_container.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/pre_container.cc --- voro++-0.5/src/pre_container.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/pre_container.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/pre_container.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/pre_container.hh --- voro++-0.5/src/pre_container.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/pre_container.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/rad_option.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/rad_option.hh --- voro++-0.5/src/rad_option.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/rad_option.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -15,7 +15,7 @@ namespace voro { -/** \brief Class containing all of the routines that are specific to computing +/** \brief Class containing all of the routines that are specific to computing * the regular Voronoi tessellation. * * The container and container_periodic classes are derived from this class, @@ -46,11 +46,11 @@ * \param[in] rs the value to consider. * \return The value with the radius squared added. */ inline double r_max_add(double rs) {return rs;} - /** Subtracts the radius squared of a particle from a given + /** Subtracts the radius squared of a particle from a given * value. * \param[in] rs the value to consider. * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. + * \param[in] q the index of the particle within the block. * \return The value with the radius squared subtracted. */ inline double r_current_sub(double rs,int ijk,int q) {return rs;} /** Scales a plane displacement prior to use in the plane cutting @@ -58,7 +58,7 @@ * \param[in] rs the initial plane displacement. * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ + * \return The scaled plane displacement. */ inline double r_scale(double rs,int ijk,int q) {return rs;} /** Scales a plane displacement prior to use in the plane * cutting algorithm, and also checks if it could possibly cut @@ -69,11 +69,11 @@ * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. * \return True if the cell could possibly cut the cell, false - * otherwise. */ + * otherwise. */ inline bool r_scale_check(double &rs,double mrs,int ijk,int q) {return rssqrt(mrs*crs);} /** Scales a plane displacement during a plane bounds check. * \param[in] lrs the plane displacement. - * \return The scaled value. */ + * \return The scaled value. */ inline double r_cutoff(double lrs) {return lrs*r_val;} /** Adds the maximum radius squared to a given value. * \param[in] rs the value to consider. - * \return The value with the radius squared added. */ + * \return The value with the radius squared added. */ inline double r_max_add(double rs) {return rs+max_radius*max_radius;} - /** Subtracts the radius squared of a particle from a given + /** Subtracts the radius squared of a particle from a given * value. * \param[in] rs the value to consider. * \param[in] ijk the block that the particle is within. - * \param[in] q the index of the particle within the block. + * \param[in] q the index of the particle within the block. * \return The value with the radius squared subtracted. */ inline double r_current_sub(double rs,int ijk,int q) { return rs-ppr[ijk][4*q+3]*ppr[ijk][4*q+3]; @@ -131,7 +131,7 @@ * \param[in] rs the initial plane displacement. * \param[in] ijk the block that the particle is within. * \param[in] q the index of the particle within the block. - * \return The scaled plane displacement. */ + * \return The scaled plane displacement. */ inline double r_scale(double rs,int ijk,int q) { return rs+r_rad-ppr[ijk][4*q+3]*ppr[ijk][4*q+3]; } diff -Nru voro++-0.5/src/unitcell.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/unitcell.cc --- voro++-0.5/src/unitcell.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/unitcell.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -24,8 +24,7 @@ * \param[in] (bxz_,byz_,bz_) The x, y, and z coordinates of the third unit * vector. */ unitcell::unitcell(double bx_,double bxy_,double by_,double bxz_,double byz_,double bz_) - : bx(bx_), bxy(bxy_), by(by_), bxz(bxz_), byz(byz_), bz(bz_), - unit_voro(max_unit_voro_shells*max_unit_voro_shells*4*(bx*bx+by*by+bz*bz)) { + : bx(bx_), bxy(bxy_), by(by_), bxz(bxz_), byz(byz_), bz(bz_) { int i,j,l=1; // Initialize the Voronoi cell to be a very large rectangular box @@ -65,8 +64,8 @@ // of a Voronoi cell vertex. max_uv_y=max_uv_z=0; double y,z,q,*pts=unit_voro.pts,*pp=pts; - while(ppmax_uv_y) max_uv_y=y+q; if(z+q>max_uv_z) max_uv_z=z+q; } diff -Nru voro++-0.5/src/unitcell.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/unitcell.hh --- voro++-0.5/src/unitcell.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/unitcell.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/v_base.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base.cc --- voro++-0.5/src/v_base.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/v_base.hh voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base.hh --- voro++-0.5/src/v_base.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base.hh 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/v_base_wl.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base_wl.cc --- voro++-0.5/src/v_base_wl.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/v_base_wl.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 diff -Nru voro++-0.5/src/v_compute.cc voro++-0.5+revert-to-0.4.6+dfsg1/src/v_compute.cc --- voro++-0.5/src/v_compute.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/src/v_compute.cc 2013-10-17 17:54:13.000000000 +0000 @@ -1,6 +1,6 @@ // Voro++, a 3D cell-based Voronoi library // -// Author : Chris H. Rycroft (Harvard University / LBL) +// Author : Chris H. Rycroft (LBL / UC Berkeley) // Email : chr@alum.mit.edu // Date : August 30th 2011 @@ -779,6 +779,7 @@ return true; } + /** This routine checks to see whether a point is within a particular distance * of a nearby region. If the point is within the distance of the region, then * the routine returns true, and computes the maximum distance from the point @@ -973,8 +974,7 @@ if(qu_s<=qu_e) { while(qu_s -#include -#include -using namespace std; - -#include "unitcell.hh" -using namespace voro; - -int main(int argc,char **argv) { - unsigned int i,j; - vector vi; - vector vd; - - // Check the command line syntax - if(argc!=7) { - fprintf(stderr,"Syntax: ./images bx bxy by bxz byz bz\n"); - return VOROPP_CMD_LINE_ERROR; - } - - // Create the unit cell - unitcell uc(atof(argv[1]),atof(argv[2]),atof(argv[3]),atof(argv[4]),atof(argv[5]),atof(argv[6])); - - // Calculate the images - uc.images(vi,vd); - - // Print the output - for(i=j=0;i - -#include "voro++.hh" -using namespace voro; - -#include "v_network.hh" -#include "r_table.cc" - -// A guess for the memory allocation per region -const int memory=16; - -// A maximum allowed number of regions, to prevent enormous amounts of memory -// being allocated -const int max_regions=16777216; - -// A buffer size -const int bsize=2048; - -// Output routine -template -void compute(c_class &con,char *buffer,int bp,double vol); - -// Commonly used error message -void file_import_error() { - voro_fatal_error("File import error",VOROPP_FILE_ERROR); -} - -int main(int argc,char **argv) { - char *farg,buffer[bsize]; - bool radial;int i,n,bp; - double bx,bxy,by,bxz,byz,bz,x,y,z,vol; - - // Check the command line syntax - if(argc==2) { - radial=false;farg=argv[1]; - } else if(argc==3&&strcmp(argv[1],"-r")==0) { - radial=true;farg=argv[2]; - } else { - fputs("Syntax: ./network [-r] \n",stderr); - return VOROPP_CMD_LINE_ERROR; - } - - // Check that the file has a ".v1" extension - bp=strlen(farg); - if(bp+2>bsize) { - fputs("Filename too long\n",stderr); - return VOROPP_CMD_LINE_ERROR; - } - if(bp<3||farg[bp-3]!='.'||farg[bp-2]!='v'||farg[bp-1]!='1') { - fputs("Filename must end in '.v1'\n",stderr); - return VOROPP_CMD_LINE_ERROR; - } - - // Try opening the file - FILE *fp(fopen(farg,"r")); - if(fp==NULL) voro_fatal_error("Unable to open file for import",VOROPP_FILE_ERROR); - - // Read header line - if(fgets(buffer,bsize,fp)!=buffer) file_import_error(); - if(strcmp(buffer,"Unit cell vectors:\n")!=0) - voro_fatal_error("Invalid header line",VOROPP_FILE_ERROR); - - // Read in the box dimensions and the number of particles - if(fscanf(fp,"%s %lg %lg %lg",buffer,&bx,&x,&x)!=4) file_import_error(); - if(strcmp(buffer,"va=")!=0) voro_fatal_error("Invalid first vector",VOROPP_FILE_ERROR); - if(fscanf(fp,"%s %lg %lg %lg",buffer,&bxy,&by,&x)!=4) file_import_error(); - if(strcmp(buffer,"vb=")!=0) voro_fatal_error("Invalid second vector",VOROPP_FILE_ERROR); - if(fscanf(fp,"%s %lg %lg %lg",buffer,&bxz,&byz,&bz)!=4) file_import_error(); - if(strcmp(buffer,"vc=")!=0) voro_fatal_error("Invalid third vector",VOROPP_FILE_ERROR); - if(fscanf(fp,"%d",&n)!=1) file_import_error(); - - // Print the box dimensions - printf("Box dimensions:\n" - " va=(%f 0 0)\n" - " vb=(%f %f 0)\n" - " vc=(%f %f %f)\n\n",bx,bxy,by,bxz,byz,bz); - - // Check that the input parameters make sense - if(n<1) voro_fatal_error("Invalid number of particles",VOROPP_FILE_ERROR); - if(bxmax_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.\n", - max_regions); - return VOROPP_MEMORY_ERROR; - } - - // Now that we are confident that the number of regions is reasonable, - // create integer versions of them - int nx=int(nxf); - int ny=int(nyf); - int nz=int(nzf); - printf("Total particles = %d\n\nInternal grid size = (%d %d %d)\n\n",n,nx,ny,nz); - - vol=bx*by*bz; - if(radial) { - - // Create a container with the geometry given above - container_periodic_poly con(bx,bxy,by,bxz,byz,bz,nx,ny,nz,memory); - - // Read in the particles from the file - for(i=0;i -void compute(c_class &con,char *buffer,int bp,double vol) { - char *bu(buffer+bp-2); - int id; - double vvol(0),x,y,z,r; - voronoicell c(con); - voronoi_network vn(con,1e-5),vn2(con,1e-5); - - // Compute Voronoi cells and - c_loop_all_periodic vl(con); - if(vl.start()) do if(con.compute_cell(c,vl)) { - vvol+=c.volume(); - vl.pos(id,x,y,z,r); - vn.add_to_network(c,id,x,y,z,r); - vn2.add_to_network_rectangular(c,id,x,y,z,r); - } while(vl.inc()); - - // Carry out the volume check - printf("Volume check:\n Total domain volume = %f\n" - " Total Voronoi volume = %f\n",vol,vvol); - - // Print non-rectangular cell network - extension("nd2",bu);vn.draw_network(buffer); - extension("nt2",bu);vn.print_network(buffer); - - // Print rectangular cell network - extension("ntd",bu);vn2.draw_network(buffer); - extension("net",bu);vn2.print_network(buffer); - - // Output the particles and any constructed periodic images - extension("par",bu);con.draw_particles(buffer); - - // Output the Voronoi cells in gnuplot format - extension("out",bu);con.draw_cells_gnuplot(buffer); - - // Output the unit cell in gnuplot format - extension("dom",bu);con.draw_domain_gnuplot(buffer); -} diff -Nru voro++-0.5/zeo/r_table.cc voro++-0.5+revert-to-0.4.6+dfsg1/zeo/r_table.cc --- voro++-0.5/zeo/r_table.cc 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/zeo/r_table.cc 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -// Voro++, a 3D cell-based Voronoi library -// -// Author : Chris H. Rycroft (LBL / UC Berkeley) -// Email : chr@alum.mit.edu -// Date : July 1st 2008 - -#include - -const int n_table=2; - -const char rad_ctable[][4]={ - "O", - "Si" -}; - -const double rad_table[]={ - 0.8, - 0.5 -}; - -double radial_lookup(char *buffer) { - for(int i=0;i -voronoi_network::voronoi_network(c_class &c,double net_tol_) : - bx(c.bx), bxy(c.bxy), by(c.by), bxz(c.bxz), byz(c.byz), bz(c.bz), - nx(c.nx), ny(c.ny), nz(c.nz), nxyz(nx*ny*nz), - xsp(nx/bx), ysp(ny/by), zsp(nz/bz), net_tol(net_tol_) { - int l; - - // Allocate memory for vertex structure - pts=new double*[nxyz]; - idmem=new int*[nxyz]; - ptsc=new int[nxyz]; - ptsmem=new int[nxyz]; - for(l=0;lmax_network_vertex_memory) - voro_fatal_error("Container vertex maximum memory allocation exceeded",VOROPP_MEMORY_ERROR); - - // Allocate new arrays - double *npts(new double[4*ptsmem[l]]); - int *nidmem(new int[ptsmem[l]]); - - // Copy the contents of the old arrays into the new ones - for(int i=0;i<4*ptsc[l];i++) npts[i]=pts[l][i]; - for(int i=0;imax_vertex_order) - voro_fatal_error("Particular vertex maximum memory allocation exceeded",VOROPP_MEMORY_ERROR); - - // Allocate new arrays - int *ned(new int[2*numem[l]]); - int *nne(ned+numem[l]); - block *nraded(new block[numem[l]]); - unsigned int *npered(new unsigned int[numem[l]]); - - // Copy the contents of the old arrays into the new ones - for(int i=0;i %d",l,ed[l][q]); - raded[l][q].print(fp); - - // Compute and print the length of the edge - ptsp=pts[reg[ed[l][q]]];j=4*regp[ed[l][q]]; - x2=ptsp[j]+ai*bx+aj*bxy+ak*bxz-x; - y2=ptsp[j+1]+aj*by+ak*byz-y; - z2=ptsp[j+2]+ak*bz-z; - fprintf(fp," %d %d %d %g\n",ai,aj,ak,sqrt(x2*x2+y2*y2+z2*z2)); - } - } -} - -// Converts three periodic image displacements into a single unsigned integer. -// \param[in] i the periodic image in the x direction. -// \param[in] j the periodic image in the y direction. -// \param[in] k the periodic image in the z direction. -// \return The packed integer. */ -inline unsigned int voronoi_network::pack_periodicity(int i,int j,int k) { - unsigned int pa=((unsigned int) (127+i)); - pa<<=8;pa+=((unsigned int) (127+j)); - pa<<=8;pa+=((unsigned int) (127+k)); - return pa; -} - -/** Unpacks an unsigned integer into three periodic image displacements. - * \param[in] pa the packed integer. -// \param[out] i the periodic image in the x direction. -// \param[out] j the periodic image in the y direction. -// \param[out] k the periodic image in the z direction. */ -inline void voronoi_network::unpack_periodicity(unsigned int pa,int &i,int &j,int &k) { - i=((signed int) (pa>>16))-127; - j=((signed int) ((pa>>8)&255))-127; - k=((signed int) (pa&255))-127; -} - -/** Adds a Voronoi cell to the network structure. The routine first checks all - * of the Voronoi cell vertices and merges them with existing ones where - * possible. Edges are then added to the structure. - * \param[in] c a reference to a Voronoi cell. - * \param[in] (x,y,z) the position of the Voronoi cell. - * \param[in] idn the ID number of the particle associated with the cell. */ -template -void voronoi_network::add_to_network_internal(v_cell &c,int idn,double x,double y,double z,double rad,int *cmap) { - int i,j,k,ijk,l,q,ai,aj,ak,*vmp(cmap); - double gx,gy,vx,vy,vz,crad,*cp(c.pts); - - // Loop over the vertices of the Voronoi cell - for(l=0;lcrad) pts[ijk][4*q+3]=crad; - } else { - k=step_int(vz*zsp);if(k<0||k>=nz) {ak=step_div(k,nz);vx-=bxz*ak;vy-=byz*ak;vz-=bz*ak;k-=ak*nz;} else ak=0; - j=step_int(gy*ysp);if(j<0||j>=ny) {aj=step_div(j,ny);vx-=bxy*aj;vy-=by*aj;j-=aj*ny;} else aj=0; - i=step_int(gx*xsp);if(i<0||i>=nx) {ai=step_div(i,nx);vx-=bx*ai;i-=ai*nx;} else ai=0; - - vmp[1]=ai;vmp[2]=aj;vmp[3]=ak; - ijk=i+nx*(j+ny*k); - - if(edc==edmem) add_edge_network_memory(); - if(ptsc[ijk]==ptsmem[ijk]) add_network_memory(ijk); - - reg[edc]=ijk;regp[edc]=ptsc[ijk]; - pts[ijk][4*ptsc[ijk]]=vx; - pts[ijk][4*ptsc[ijk]+1]=vy; - pts[ijk][4*ptsc[ijk]+2]=vz; - pts[ijk][4*ptsc[ijk]+3]=crad; - idmem[ijk][ptsc[ijk]++]=edc; - *vmp=edc++; - } - - // Add the neighbor information to this vertex - add_neighbor(*vmp,idn); - } - - add_edges_to_network(c,x,y,z,rad,cmap); -} - -/** Adds a neighboring particle ID to a vertex in the Voronoi network, first - * checking that the ID is not already recorded. - * \param[in] k the Voronoi vertex. - * \param[in] idn the particle ID number. */ -inline void voronoi_network::add_neighbor(int k,int idn) { - for(int i=0;i -void voronoi_network::add_edges_to_network(v_cell &c,double x,double y,double z,double rad,int *cmap) { - int i,j,ai,aj,ak,bi,bj,bk,k,l,q,*vmp;unsigned int cper; - double vx,vy,vz,wx,wy,wz,dx,dy,dz,dis;double *pp; - for(l=0;l1) dis=1; - wx=vx-x+dis*dx;wy=vy-y+dis*dy;wz=vz-z+dis*dz; - int nat=not_already_there(k,j,cper); - if(nat==nu[k]) { - if(nu[k]==numem[k]) add_particular_vertex_memory(k); - ed[k][nu[k]]=j; - raded[k][nu[k]].first(sqrt(wx*wx+wy*wy+wz*wz)-rad,dis); - pered[k][nu[k]++]=cper; - } else { - raded[k][nat].add(sqrt(wx*wx+wy*wy+wz*wz)-rad,dis); - } - } - } -} - -template -void voronoi_network::add_to_network_rectangular_internal(v_cell &c,int idn,double x,double y,double z,double rad,int *cmap) { - int i,j,k,ijk,l,q,ai,aj,ak,*vmp(cmap); - double vx,vy,vz,crad,*cp(c.pts); - - for(l=0;lcrad) pts[ijk][4*q+3]=crad; - } else { - k=step_int(vz*zsp); - if(k<0||k>=nz) { - ak=step_div(k,nz); - vz-=ak*bz;vy-=ak*byz;vx-=ak*bxz;k-=ak*nz; - } else ak=0; - j=step_int(vy*ysp); - if(j<0||j>=ny) { - aj=step_div(j,ny); - vy-=aj*by;vx-=aj*bxy;j-=aj*ny; - } else aj=0; - i=step_int(vx*xsp); - if(i<0||i>=nx) { - ai=step_div(i,nx); - vx-=ai*bx;i-=ai*nx; - } else ai=0; - vmp[1]=ai; - vmp[2]=aj; - vmp[3]=ak; - ijk=i+nx*(j+ny*k); - if(edc==edmem) add_edge_network_memory(); - if(ptsc[ijk]==ptsmem[ijk]) add_network_memory(ijk); - reg[edc]=ijk;regp[edc]=ptsc[ijk]; - pts[ijk][4*ptsc[ijk]]=vx; - pts[ijk][4*ptsc[ijk]+1]=vy; - pts[ijk][4*ptsc[ijk]+2]=vz; - pts[ijk][4*ptsc[ijk]+3]=crad; - idmem[ijk][ptsc[ijk]++]=edc; - *vmp=edc++; - } - - add_neighbor(*vmp,idn); - } - - add_edges_to_network(c,x,y,z,rad,cmap); -} - -int voronoi_network::not_already_there(int k,int j,unsigned int cper) { - for(int i=0;i=nz) { - ck=step_div(k,nz); - z-=ck*bz;y-=ck*byz;x-=ck*bxz;k-=ck*nz; - } else ck=0; - - int j=step_int(y*ysp); - if(j<0||j>=ny) { - cj=step_div(j,ny); - y-=cj*by;x-=cj*bxy;j-=cj*ny; - } else cj=0; - - ijk=step_int(x*xsp); - if(ijk<0||ijk>=nx) { - ci=step_div(ijk,nx); - x-=ci*bx;ijk-=ci*nx; - } else ci=0; - - ijk+=nx*(j+ny*k);double *pp(pts[ijk]); - for(q=0;q (-1,0,0,1). - * With this routine, we have (-1.5,-0.5,0.5,1.5) -> (-2,-1,0,1). */ -inline int voronoi_network::step_int(double a) { - return a<0?int(a)-1:int(a); -} - -/** Custom integer division function, that gives consistent stepping for - * negative numbers. */ -inline int voronoi_network::step_div(int a,int b) { - return a>=0?a/b:-1+(a+1)/b; -} - -// Explicit instantiation -template voronoi_network::voronoi_network(container_periodic&, double); -template voronoi_network::voronoi_network(container_periodic_poly&, double); -template void voronoi_network::add_to_network(voronoicell&, int, double, double, double, double); -template void voronoi_network::add_to_network(voronoicell_neighbor&, int, double, double, double, double); -template void voronoi_network::add_to_network_rectangular(voronoicell&, int, double, double, double, double); -template void voronoi_network::add_to_network_rectangular(voronoicell_neighbor&, int, double, double, double, double); diff -Nru voro++-0.5/zeo/v_network.hh voro++-0.5+revert-to-0.4.6+dfsg1/zeo/v_network.hh --- voro++-0.5/zeo/v_network.hh 2020-04-15 14:44:57.000000000 +0000 +++ voro++-0.5+revert-to-0.4.6+dfsg1/zeo/v_network.hh 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -#ifndef ZEOPP_V_NETWORK_HH -#define ZEOPP_V_NETWORK_HH - -#include - -#include "voro++.hh" -using namespace voro; - -const int init_network_edge_memory=4; -const int init_network_vertex_memory=64; -const int max_network_vertex_memory=65536; - -struct block { - double dis; - double e; - inline void first(double v,double d) {e=v>0?v:0;dis=d;} - inline void add(double v,double d) { - if(v<0) e=0; - else if(v - voronoi_network(c_class &c,double net_tol_=tolerance); - ~voronoi_network(); - void print_network(FILE *fp=stdout,bool reverse_remove=false); - inline void print_network(const char* filename,bool reverse_remove=false) { - FILE *fp(safe_fopen(filename,"w")); - print_network(fp); - fclose(fp); - } - void draw_network(FILE *fp=stdout); - inline void draw_network(const char* filename) { - FILE *fp(safe_fopen(filename,"w")); - draw_network(fp); - fclose(fp); - } - template - inline void add_to_network(v_cell &c,int idn,double x,double y,double z,double rad,int *&cmap) { - cmap=new int[4*c.p]; - add_to_network_internal(c,idn,x,y,z,rad,cmap); - } - template - inline void add_to_network_rectangular(v_cell &c,int idn,double x,double y,double z,double rad,int *&cmap) { - cmap=new int[4*c.p]; - add_to_network_rectangular_internal(c,idn,x,y,z,rad,cmap); - } - template - inline void add_to_network(v_cell &c,int idn,double x,double y,double z,double rad) { - if(c.p>map_mem) add_mapping_memory(c.p); - add_to_network_internal(c,idn,x,y,z,rad,vmap); - } - template - inline void add_to_network_rectangular(v_cell &c,int idn,double x,double y,double z,double rad) { - if(c.p>map_mem) add_mapping_memory(c.p); - add_to_network_rectangular_internal(c,idn,x,y,z,rad,vmap); - } - - void clear_network(); - private: - inline int step_div(int a,int b); - inline int step_int(double a); - inline void add_neighbor(int k,int idn); - void add_particular_vertex_memory(int l); - void add_edge_network_memory(); - void add_network_memory(int l); - void add_mapping_memory(int pmem); - inline unsigned int pack_periodicity(int i,int j,int k); - inline void unpack_periodicity(unsigned int pa,int &i,int &j,int &k); - template - void add_edges_to_network(v_cell &c,double x,double y,double z,double rad,int *cmap); - int not_already_there(int k,int j,unsigned int cper); - bool search_previous(double gx,double gy,double x,double y,double z,int &ijk,int &q,int &ci,int &cj,int &ck); - bool safe_search_previous_rect(double x,double y,double z,int &ijk,int &q,int &ci,int &cj,int &ck); - bool search_previous_rect(double x,double y,double z,int &ijk,int &q,int &ci,int &cj,int &ck); - template - void add_to_network_internal(v_cell &c,int idn,double x,double y,double z,double rad,int *cmap); - template - void add_to_network_rectangular_internal(v_cell &c,int idn,double x,double y,double z,double rad,int *cmap); -}; - -#endif