1 #include "voro++_2d.hh"
10 void add_memory_array(double* &old,int size){
11 double *newa= new double[2*size];
12 for(int i=0;i<(size);i++){
19 int main(int argc
,char **argv
){
24 FILE *fp
=fopen(argv
[1],"r");
26 connect
.assemble_vertex();
27 connect
.assemble_gen_ed();
28 connect
.assemble_boundary();
29 // connect.lloyds(.0001);
32 sprintf(outfn
,"%s.gv",argv
[1]);
33 connect
.draw_vtg_gnu(outfn
);
37 sprintf(outfn
,"%s.vertlabel",argv
[1]);
38 connect
.label_vertices(outfn
);
42 sprintf(outfn
,"%s.genlabel",argv
[1]);
43 connect
.label_generators(outfn
);
47 sprintf(outfn
,"%s.edlabel",argv
[1]);
48 connect
.label_edges(outfn
);
52 sprintf(outfn
,"%s.neighbors",argv
[1]);
53 connect
.draw_gen_gen(outfn
);
57 sprintf(outfn
,"%s.gen_to_ed_table",argv
[1]);
58 connect
.print_gen_to_ed_table(outfn
);
62 sprintf(outfn
,"%s.gen_to_vert_table",argv
[1]);
63 connect
.print_gen_to_vert_table(outfn
);
67 sprintf(outfn
,"%s.vert_to_gen_table",argv
[1]);
68 connect
.print_vert_to_gen_table(outfn
);
72 sprintf(outfn
,"%s.ed_to_gen_table",argv
[1]);
73 connect
.print_ed_to_gen_table(outfn
);
77 sprintf(outfn
,"%s.vert_to_ed_table",argv
[1]);
78 connect
.print_vert_to_ed_table(outfn
);
82 sprintf(outfn
,"%s.vert_boundary_table",argv
[1]);
83 connect
.print_vert_boundary(outfn
);
87 sprintf(outfn
,"%s.ed_boundary_table",argv
[1]);
88 connect
.print_ed_boundary(outfn
);
92 sprintf(outfn
,"%s.gnu",argv
[1]);
93 connect
.draw_gnu(outfn
);
97 sprintf(outfn
,"%s.centroidlabel",argv
[1]);
98 connect
.label_centroids(outfn
);
101 outfn
=new char[1000];
102 sprintf(outfn
,"%s.dualmesh",argv
[1]);
103 connect
.draw_median_mesh(outfn
);
106 outfn
=new char[1000];
107 sprintf(outfn
,"%s.ascii",argv
[1]);
108 connect
.ascii_output(outfn
);
112 double x
=atof(argv
[2]);
113 double y
=atof(argv
[3]);
114 outfn
=new char[1000];
115 sprintf(outfn
,"%s.closest",argv
[1]);
116 connect
.draw_closest_generator(outfn
,x
,y
);
120 double *test=new double[10];
121 for(int i=0;i<10;i++){
124 for(int i=0;i<10;i++){
125 cout << test[i] << endl;
127 cout << "\n\n\n" << endl;
128 add_memory_array(test,10);
129 for(int i=0;i<20;i++){
130 cout << test[i] << endl;