]> hackdaworld.org Git - physik/posic.git/blob - bond_analyze.c
6c46251f14dd4ecd2b18a1bbb94c76f1a9028757
[physik/posic.git] / bond_analyze.c
1 /*
2  * bonding analyzation code
3  *
4  * author: frank.zirkelbach@physik.uni-augsburg.de
5  *
6  */
7
8 #define _GNU_SOURCE
9 #include <stdio.h>
10 //#include <stdlib.h>
11 //#include <unistd.h>
12 //#include <string.h>
13 //#include <sys/types.h>
14 //#include <sys/stat.h>
15 //#include <fcntl.h>
16
17 #include "moldyn.h"
18 #include "potentials/albe.h"
19
20 int usage(char *prog) {
21
22         printf("\nusage:\n");
23         printf("  %s <save file>\n\n",prog);
24
25         return -1;
26 }
27
28 int main(int argc,char **argv) {
29
30         t_moldyn moldyn;
31         int ret;
32         double quality[2];
33
34         if(argc!=2) {
35                 usage(argv[0]);
36                 return -1;
37         }
38
39         memset(&moldyn,0,sizeof(t_moldyn));
40
41         printf("[bond analyze] reading save file ...\n");
42         ret=moldyn_read_save_file(&moldyn,argv[1]);
43         if(ret) {
44                 printf("[bond analyze] exit!\n");
45                 return ret;
46         }
47
48         /* potential setting */
49         set_potential(&moldyn,MOLDYN_POTENTIAL_AM);
50         albe_mult_set_params(&moldyn,SI,C);
51
52         /* link cell init */
53         link_cell_init(&moldyn,VERBOSE);
54
55         /* analyzing ... */
56         bond_analyze(&moldyn,quality);
57
58         printf("[bond analyze] quality = %f | %f\n",quality[0],quality[1]);
59
60         moldyn_free_save_file(&moldyn);
61
62         return 0;
63 }