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