2 * moldyn.c - molecular dynamics library main file
4 * author: Frank Zirkelbach <frank.zirkelbach@physik.uni-augsburg.de>
13 #include "math/math.h"
14 #include "init/init.h"
17 int create_lattice(unsigned char type,int element,double mass,double lc,
18 int a,int b,int c,t_atom **atom) {
26 if(type==FCC) count*=4;
27 if(type==DIAMOND) count*=8;
29 *atom=malloc(count*sizeof(t_atom));
31 perror("malloc (atoms)");
39 ret=fcc_init(a,b,c,lc,*atom,&origin);
42 ret=diamond_init(a,b,c,lc,*atom,&origin);
46 printf("unknown lattice type (%02x)\n",type);
51 printf("ok, there is something wrong ...\n");
52 printf("calculated -> %d atoms\n",count);
53 printf("created -> %d atoms\n",ret);
57 (*atom)[count-1].element=element;
58 (*atom)[count-1].mass=mass;