commit | author | age
|
d7639a
|
1 |
#include<stdio.h> |
SP |
2 |
#include<math.h> |
|
3 |
#include "general.h" |
|
4 |
#include "vertex.h" |
a10dd5
|
5 |
#include "bond.h" |
a2a676
|
6 |
#include "triangle.h" |
bb77ca
|
7 |
#include "cell.h" |
7958e9
|
8 |
#include "vesicle.h" |
a6b1b5
|
9 |
#include "io.h" |
7958e9
|
10 |
#include "initial_distribution.h" |
dac2e5
|
11 |
#include "frame.h" |
aec47d
|
12 |
#include "timestep.h" |
8db569
|
13 |
#include "poly.h" |
d7639a
|
14 |
|
SP |
15 |
/** Entrance function to the program |
|
16 |
* @param argv is a number of parameters used in program call (including the program name |
|
17 |
* @param argc is a pointer to strings (character arrays) which holds the arguments |
|
18 |
* @returns returns 0 on success, any other number on fail. |
|
19 |
*/ |
|
20 |
|
|
21 |
int main(int argv, char *argc[]){ |
d7a113
|
22 |
ts_uint inititer,mcsweeps, iterations; |
3c1ac1
|
23 |
ts_vesicle *vesicle, *vesicle1; |
b14a8d
|
24 |
/* THIS SHOULD GO INTO UNIT TEST |
d7639a
|
25 |
ts_bool retval; |
3131dc
|
26 |
ts_vertex_list *vlist=init_vertex_list(5); |
b01cc1
|
27 |
ts_vertex_list *vlist1; |
a10dd5
|
28 |
ts_bond_list *blist=init_bond_list(); |
a2a676
|
29 |
ts_triangle_list *tlist=init_triangle_list(); |
bb77ca
|
30 |
ts_cell_list *clist=init_cell_list(3,3,3,0.3); |
d7639a
|
31 |
|
a10dd5
|
32 |
retval=vtx_add_cneighbour(blist,vlist->vtx[1],vlist->vtx[0]); |
d7639a
|
33 |
if(retval==TS_FAIL) printf("1. already a member or vertex is null!\n"); |
a10dd5
|
34 |
|
e19e79
|
35 |
retval=vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]); |
d7639a
|
36 |
if(retval==TS_FAIL) printf("2. already a member or vertex is null!\n"); |
306559
|
37 |
fprintf(stderr,"Was here"); |
e19e79
|
38 |
retval=vtx_remove_neighbour(vlist->vtx[1],vlist->vtx[0]); |
9802f1
|
39 |
vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]); |
306559
|
40 |
fprintf(stderr,"Was here too!\n"); |
9802f1
|
41 |
|
8f6a69
|
42 |
vlist->vtx[0]->x=1.0; |
SP |
43 |
vlist->vtx[0]->x=1.1; |
b01cc1
|
44 |
vlist1=vertex_list_copy(vlist); |
a10dd5
|
45 |
bond_add(blist, vlist->vtx[1],vlist->vtx[0]); |
a2a676
|
46 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
a10dd5
|
47 |
|
a2a676
|
48 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
SP |
49 |
|
34d3de
|
50 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
bb77ca
|
51 |
cell_add_vertex(clist->cell[0], vlist->vtx[0]); |
34d3de
|
52 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
8f6a69
|
53 |
printf("Cell idx=1 has vertex[0] has x coordinate=%e\n",clist->cell[0]->vertex[0]->x); |
bb77ca
|
54 |
cell_list_cell_occupation_clear(clist); |
34d3de
|
55 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
bb77ca
|
56 |
cell_add_vertex(clist->cell[0], vlist->vtx[0]); |
SP |
57 |
|
|
58 |
|
a2a676
|
59 |
triangle_list_free(tlist); |
a10dd5
|
60 |
bond_list_free(blist); |
73f967
|
61 |
vtx_list_free(vlist); |
bb77ca
|
62 |
cell_list_free(clist); |
7958e9
|
63 |
|
b01cc1
|
64 |
vtx_list_free(vlist1); |
SP |
65 |
printf("Tests complete.\n"); |
b14a8d
|
66 |
*/ |
063289
|
67 |
vesicle1=parsetape(&mcsweeps, &inititer, &iterations); |
8db569
|
68 |
|
M |
69 |
/*Testing */ |
a2db52
|
70 |
//vesicle->poly_list=init_poly_list(1400,20,vesicle->vlist); |
8db569
|
71 |
|
a2db52
|
72 |
//poly_list_free(vesicle->poly_list); |
8db569
|
73 |
/*End testing*/ |
3c1ac1
|
74 |
|
063289
|
75 |
dump_state(vesicle1); |
314f2d
|
76 |
|
86f5e7
|
77 |
vesicle=restore_state(); |
SP |
78 |
//vesicle_free(vesicle1); |
|
79 |
run_simulation(vesicle1, mcsweeps, inititer, iterations); |
a6b1b5
|
80 |
write_master_xml_file("test.pvd"); |
3131dc
|
81 |
write_dout_fcompat_file(vesicle,"dout"); |
7958e9
|
82 |
vesicle_free(vesicle); |
SP |
83 |
|
d7639a
|
84 |
return 0; //program finished perfectly ok. We return 0. |
SP |
85 |
} |