2 * code searching for special types of bonds
4 * author: frank.zirkelbach@physik.uni-augsburg.de
13 //#include <sys/types.h>
14 //#include <sys/stat.h>
18 #include "potentials/albe.h"
20 typedef struct s_data {
25 int usage(char *prog) {
28 printf(" %s <file> <type> <bondlen> <+->\n",prog);
29 printf(" type: a - 0-0 bond\n");
30 printf(" type: b - 1-1 bond\n");
31 printf(" type: c - 0-1 / 1-0 bond\n\n");
36 int process(t_moldyn *moldyn,t_atom *ai,t_atom *aj,void *ptr,u8 bc) {
62 if(ai->brand==aj->brand)
67 v3_sub(&dist,&(ai->r),&(aj->r));
68 check_per_bound(moldyn,&dist);
71 if((d<=data->len+data->pm)&(d>=data->len-data->pm))
72 printf(" # atoms %d/%d %d/%d - %f\n",
79 int main(int argc,char **argv) {
91 data.len=atof(argv[3]);
92 data.pm=atof(argv[4]);
94 memset(&moldyn,0,sizeof(t_moldyn));
96 printf("[search bonds] reading save file ...\n");
97 ret=moldyn_read_save_file(&moldyn,argv[1]);
99 printf("[search bonds] exit!\n");
104 moldyn.cutoff=data.len+data.pm;
105 link_cell_init(&moldyn,VERBOSE);
107 process_2b_bonds(&moldyn,&data,process);
110 link_cell_shutdown(&moldyn);
112 moldyn_free_save_file(&moldyn);