From: hackbard Date: Mon, 27 Mar 2006 14:29:07 +0000 (+0000) Subject: more mods X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b040d775deb32173e6536464a3e2ad95a6a5bd55;p=physik%2Fposic.git more mods --- 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);