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