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" |
d7639a
|
7 |
//#include "io.h" |
SP |
8 |
//#include "initial_timestep.h" |
|
9 |
|
|
10 |
/** Entrance function to the program |
|
11 |
* @param argv is a number of parameters used in program call (including the program name |
|
12 |
* @param argc is a pointer to strings (character arrays) which holds the arguments |
|
13 |
* @returns returns 0 on success, any other number on fail. |
|
14 |
*/ |
|
15 |
|
|
16 |
int main(int argv, char *argc[]){ |
|
17 |
ts_bool retval; |
73f967
|
18 |
ts_vertex_list *vlist=init_vertex_list(5); |
a10dd5
|
19 |
ts_bond_list *blist=init_bond_list(); |
a2a676
|
20 |
ts_triangle_list *tlist=init_triangle_list(); |
SP |
21 |
|
|
22 |
|
d7639a
|
23 |
|
a10dd5
|
24 |
retval=vtx_add_cneighbour(blist,vlist->vtx[1],vlist->vtx[0]); |
d7639a
|
25 |
if(retval==TS_FAIL) printf("1. already a member or vertex is null!\n"); |
a10dd5
|
26 |
|
SP |
27 |
retval=vtx_add_cneighbour(blist,vlist->vtx[0],vlist->vtx[1]); |
d7639a
|
28 |
if(retval==TS_FAIL) printf("2. already a member or vertex is null!\n"); |
a10dd5
|
29 |
|
9802f1
|
30 |
retval=vtx_remove_neighbour(vlist->vtx[0],vlist->vtx[1]); |
SP |
31 |
vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]); |
|
32 |
|
a10dd5
|
33 |
vlist->vtx[0]->data->x=1.0; |
SP |
34 |
vlist->vtx[0]->data->x=1.1; |
|
35 |
|
|
36 |
bond_add(blist, vlist->vtx[1],vlist->vtx[0]); |
a2a676
|
37 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
a10dd5
|
38 |
|
a2a676
|
39 |
triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]); |
SP |
40 |
|
|
41 |
triangle_list_free(tlist); |
a10dd5
|
42 |
bond_list_free(blist); |
73f967
|
43 |
vtx_list_free(vlist); |
d7639a
|
44 |
printf("Done.\n"); |
SP |
45 |
return 0; //program finished perfectly ok. We return 0. |
|
46 |
} |