X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=display_atom_data.c;fp=display_atom_data.c;h=08723669978c6f35c458550ea62691ae85e5ca96;hb=b1c3e2366702a37786ed057c7b56929258890950;hp=0000000000000000000000000000000000000000;hpb=9b7ed8daf887bef7ec61abd021931d2e92226e6a;p=physik%2Fposic.git diff --git a/display_atom_data.c b/display_atom_data.c new file mode 100644 index 0000000..0872366 --- /dev/null +++ b/display_atom_data.c @@ -0,0 +1,80 @@ +/* + * code to display atom data + * + * author: frank.zirkelbach@physik.uni-augsburg.de + * + */ + +#define _GNU_SOURCE +#include +//#include +//#include +//#include +//#include +//#include +//#include + +#include "moldyn.h" +#include "potentials/albe.h" + +int usage(char *prog) { + + printf("\nusage:\n"); + printf(" %s ... \n\n",prog); + + return -1; +} + +int main(int argc,char **argv) { + + t_moldyn moldyn; + int ret; + int i; + int nr; + t_atom *atom; + double off; + double lc; + + if(argc<2) { + usage(argv[0]); + return -1; + } + + memset(&moldyn,0,sizeof(t_moldyn)); + + printf("[search bonds] reading save file ...\n"); + ret=moldyn_read_save_file(&moldyn,argv[1]); + if(ret) { + printf("[search bonds] exit!\n"); + return ret; + } + + /* todo: guessing offset/lc */ + lc=ALBE_LC_SI; + off=0.125*lc-0.5*lc; + + for(i=2;ir.x,atom->r_0.x,atom->r.x-off,atom->r_0.x-off, + atom->r.x-atom->r_0.x,(atom->r.x-off)/lc); + printf(" y: %f %f | %f %f | %f | %f\n", + atom->r.y,atom->r_0.y,atom->r.y-off,atom->r_0.y-off, + atom->r.y-atom->r_0.y,(atom->r.y-off)/lc); + printf(" z: %f %f | %f %f | %f | %f\n", + atom->r.z,atom->r_0.z,atom->r.z-off,atom->r_0.z-off, + atom->r.z-atom->r_0.z,(atom->r.z-off)/lc); + + } + + moldyn_free_save_file(&moldyn); + + return 0; +}