From b1c3e2366702a37786ed057c7b56929258890950 Mon Sep 17 00:00:00 2001 From: hackbard Date: Fri, 9 May 2008 09:31:49 +0200 Subject: [PATCH] added display atom data tool --- Makefile | 4 ++- display_atom_data.c | 80 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 display_atom_data.c diff --git a/Makefile b/Makefile index 36c411e..47670a8 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ DEPS += potentials/lennard_jones.o potentials/harmonic_oscillator.o DEPS += potentials/tersoff.o potentials/albe.o ALL = mdrun sic fluctuation_calc postproc pair_correlation_calc diffusion_calc -ALL += bond_analyze search_bonds visual_atoms +ALL += bond_analyze search_bonds visual_atoms display_atom_data all: $(ALL) @@ -43,6 +43,8 @@ search_bonds: $(DEPS) visual_atoms: $(DEPS) +display_atom_data: $(DEPS) + .PHONY:clean clean: rm -vf $(ALL) *.o */*.o 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; +} -- 2.39.2