4 * author: frank.zirkelbach@physik.uni-augsburg.de
13 //#include <sys/types.h>
14 //#include <sys/stat.h>
26 typedef struct s_data {
34 int usage(char *prog) {
37 printf(" %s <file> <centre atom> <radius> <lc> [marked atom]\n\n",
43 int process(t_moldyn *moldyn,t_atom *itom,t_atom *jtom,void *ptr,u8 bc) {
51 v3_sub(&dist,&(itom->r),&(jtom->r));
52 if(bc) check_per_bound(moldyn,&dist);
56 printf("%s %f %f %f %s %f\n",
57 pse_name[jtom->element],
58 jtom->r.x+data->ox,jtom->r.y+data->oy,jtom->r.z+data->oz,
59 (jtom->tag==data->ma)?"Red":pse_col[jtom->element],
66 int main(int argc,char **argv) {
78 data.ca=atoi(argv[2]);
79 data.radius=atof(argv[3]);
80 data.lc=atof(argv[4]);
83 data.ma=atoi(argv[5]);
85 memset(&moldyn,0,sizeof(t_moldyn));
87 printf("[visual atoms] reading save file ...\n");
88 ret=moldyn_read_save_file(&moldyn,argv[1]);
90 printf("[visual atoms] exit!\n");
95 moldyn.cutoff=data.radius;
96 link_cell_init(&moldyn,VERBOSE);
98 atom=&(moldyn.atom[data.ca]);
103 while((atom->r.x+data.ox)<(-data.lc/2.0))
107 while((atom->r.x+data.ox)>(data.lc/2.0))
113 while((atom->r.y+data.oy)<(-data.lc/2.0))
117 while((atom->r.y+data.oy)>(data.lc/2.0))
123 while((atom->r.z+data.oz)<(-data.lc/2.0))
127 while((atom->r.z+data.oz)>(data.lc/2.0))
131 /* print the centered atom */
132 printf("%s %f %f %f %s %f\n",
133 pse_name[atom->element],atom->r.x+data.ox,atom->r.y+data.oy,
134 atom->r.z+data.oz,"Green",atom->ekin);
136 process_neighbours(&moldyn,&data,atom,process);
138 link_cell_shutdown(&moldyn);
139 moldyn_free_save_file(&moldyn);