Trisurf Monte Carlo simulator
Samo Penic
2010-12-04 bb77ca8f6e18e5a3ee2996095db5394dcd49197a
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"
d7639a 8 //#include "io.h"
SP 9 //#include "initial_timestep.h"
10
11 /** Entrance function to the program
12   * @param argv is a number of parameters used in program call (including the program name
13   * @param argc is a pointer to strings (character arrays) which holds the arguments
14   * @returns returns 0 on success, any other number on fail.
15 */
16
17 int main(int argv, char *argc[]){
18 ts_bool retval;
73f967 19 ts_vertex_list *vlist=init_vertex_list(5);
a10dd5 20 ts_bond_list *blist=init_bond_list();
a2a676 21 ts_triangle_list *tlist=init_triangle_list();
bb77ca 22 ts_cell_list *clist=init_cell_list(3,3,3,0.3);
a2a676 23
d7639a 24
a10dd5 25 retval=vtx_add_cneighbour(blist,vlist->vtx[1],vlist->vtx[0]);
d7639a 26 if(retval==TS_FAIL) printf("1. already a member or vertex is null!\n");
a10dd5 27
SP 28 retval=vtx_add_cneighbour(blist,vlist->vtx[0],vlist->vtx[1]);
d7639a 29 if(retval==TS_FAIL) printf("2. already a member or vertex is null!\n");
a10dd5 30
9802f1 31 retval=vtx_remove_neighbour(vlist->vtx[0],vlist->vtx[1]);
SP 32 vtx_add_neighbour(vlist->vtx[0],vlist->vtx[1]);
33
a10dd5 34 vlist->vtx[0]->data->x=1.0;
SP 35 vlist->vtx[0]->data->x=1.1;
36
37 bond_add(blist, vlist->vtx[1],vlist->vtx[0]);
a2a676 38 triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]);
a10dd5 39
a2a676 40 triangle_add(tlist,vlist->vtx[1],vlist->vtx[2],vlist->vtx[3]);
SP 41
bb77ca 42 printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->data->nvertex);
SP 43 cell_add_vertex(clist->cell[0], vlist->vtx[0]);
44 printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->data->nvertex);
45 printf("Cell idx=1 has vertex[0] has x coordinate=%e\n",clist->cell[0]->data->vertex[0]->data->x);
46 cell_list_cell_occupation_clear(clist);
47 printf("Cell idx=1 has vertices=%u\n",clist->cell[0]->data->nvertex);
48 cell_add_vertex(clist->cell[0], vlist->vtx[0]);
49
50
a2a676 51 triangle_list_free(tlist);
a10dd5 52 bond_list_free(blist);
73f967 53 vtx_list_free(vlist);
bb77ca 54 cell_list_free(clist);
d7639a 55 printf("Done.\n");
SP 56 return 0; //program finished perfectly ok. We return 0.
57