From b040d775deb32173e6536464a3e2ad95a6a5bd55 Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 27 Mar 2006 14:29:07 +0000 Subject: [PATCH] more mods --- Makefile | 2 +- init/init.c | 7 ++++--- moldyn.c | 38 +++++++++++++++++++++++++++++++++++++- moldyn.h | 2 ++ posic.c | 2 +- visual/visual.c | 4 ++-- 6 files changed, 47 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a6ba055..b6e31c0 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ OBJS=init/init.o visual/visual.o math/math.o moldyn.o all: moldyn.o posic -posic: +posic: moldyn.o $(OBJS) $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) posic.c clean: diff --git a/init/init.c b/init/init.c index 07b4dc6..daeb3b1 100644 --- a/init/init.c +++ b/init/init.c @@ -35,16 +35,17 @@ int fcc_init(int a,int b,int c,double lc,t_atom *atom,t_3dvec *origin) { } v3_zero(&r); - v3_add(&r,&r,&o); count=0; /* fill up the room */ + r.x=o.x; while(r.x %d atoms\n",count); printf("created -> %d atoms\n",ret); + return -1; } while(count) { @@ -62,3 +63,38 @@ int create_lattice(unsigned char type,int element,double mass,double lc, return ret; } +int thermal_init(t_atom *atom,int count,double t) { + + /* + * - gaussian distribution of velocities + * - velocity scaling (E = 3/2 N k T), E: kinetic energy + */ + + int i; + double e,c,v; + + e=.0; + + for(i=0;ifd,"load xyz %s\n",file); dprintf(v->fd,"spacefill 200\n"); - dprintf(v->fd,"rotate x 11\n"); - dprintf(v->fd,"rotate y 13\n"); + dprintf(v->fd,"rotate x 100\n"); + dprintf(v->fd,"rotate y 10\n"); dprintf(v->fd,"set ambient 20\n"); dprintf(v->fd,"set specular on\n"); sprintf(file,"%s-%.15f.ppm",v->fb,time); -- 2.20.1