commit | author | age
|
37791b
|
1 |
#include<stdio.h> |
SP |
2 |
#include<math.h> |
|
3 |
#include "general.h" |
|
4 |
#include "vertex.h" |
|
5 |
#include "bond.h" |
|
6 |
#include "triangle.h" |
|
7 |
#include "cell.h" |
|
8 |
#include "vesicle.h" |
|
9 |
#include "io.h" |
|
10 |
#include "initial_distribution.h" |
|
11 |
#include "frame.h" |
|
12 |
#include "timestep.h" |
|
13 |
|
|
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[]){ |
|
21 |
ts_bool retval; |
|
22 |
ts_vertex_list *vlist=init_vertex_list(5); |
|
23 |
ts_vertex_list *vlist1; |
|
24 |
ts_bond_list *blist=init_bond_list(); |
|
25 |
ts_triangle_list *tlist=init_triangle_list(); |
|
26 |
ts_cell_list *clist=init_cell_list(3,3,3,0.3); |
|
27 |
|
|
28 |
retval=vtx_add_cneighbour(blist,vlist->vtx[1],vlist->vtx[0]); |
|
29 |
if(retval==TS_FAIL) printf("1. already a member or vertex is null!\n"); |
|
30 |
|
|
31 |
retval=vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]); |
|
32 |
if(retval==TS_FAIL) printf("2. already a member or vertex is null!\n"); |
|
33 |
fprintf(stderr,"Was here"); |
|
34 |
retval=vertex_list_remove_vtx(vlist->vtx[1]->neigh,vlist->vtx[0]); |
|
35 |
retval=vertex_list_remove_vtx(vlist->vtx[0]->neigh,vlist->vtx[1]); |
|
36 |
vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]); |
|
37 |
fprintf(stderr,"Was here too!\n"); |
|
38 |
|
|
39 |
vlist->vtx[0]->x=1.0; |
|
40 |
vlist->vtx[0]->x=1.1; |
|
41 |
vlist1=vertex_list_copy(vlist); |
|
42 |
bond_add(blist, vlist->vtx[1],vlist->vtx[0]); |
|
43 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
|
44 |
|
|
45 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
|
46 |
|
|
47 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
|
48 |
cell_add_vertex(clist->cell[0], vlist->vtx[0]); |
|
49 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
|
50 |
printf("Cell idx=1 has vertex[0] has x coordinate=%e\n",clist->cell[0]->vertex[0]->x); |
|
51 |
cell_list_cell_occupation_clear(clist); |
|
52 |
printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->nvertex); |
|
53 |
cell_add_vertex(clist->cell[0], vlist->vtx[0]); |
|
54 |
|
|
55 |
|
|
56 |
triangle_list_free(tlist); |
|
57 |
bond_list_free(blist); |
|
58 |
vtx_list_free(vlist); |
|
59 |
cell_list_free(clist); |
|
60 |
|
|
61 |
vtx_list_free(vlist1); |
|
62 |
printf("Tests complete.\n"); |
|
63 |
|
|
64 |
return 0; //program finished perfectly ok. We return 0. |
|
65 |
} |