X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=init%2Finit.c;h=07b4dc6fd061e120f2af3b749b7ca2ff7462e97c;hb=706aed2512544b99ff34308fdb673b19ee884ce0;hp=1f62963c366ca66096639b9183e4944dc8f61258;hpb=710717c4033bc5b8eb34644914e762a2834ae345;p=physik%2Fposic.git diff --git a/init/init.c b/init/init.c index 1f62963..07b4dc6 100644 --- a/init/init.c +++ b/init/init.c @@ -9,13 +9,18 @@ #include "../moldyn.h" /* fcc lattice init */ -int fcc_init(t_3dvec *dim,double lc,t_atom *atom,t_3dvec *origin) { +int fcc_init(int a,int b,int c,double lc,t_atom *atom,t_3dvec *origin) { int count; int i,j; t_3dvec o,r,n; t_3dvec basis[3]; double help[3]; + double x,y,z; + + x=a*lc; + y=b*lc; + z=c*lc; if(origin) v3_copy(&o,origin); else v3_zero(&o); @@ -34,14 +39,16 @@ int fcc_init(t_3dvec *dim,double lc,t_atom *atom,t_3dvec *origin) { count=0; /* fill up the room */ - while(r.xx) { - while(r.yy) { - while(r.zz) { + while(r.xx+o.x)&&(n.yy+o.y)&&(n.zz+o.z)) { + if((n.xx/2.0; - help[1]=dim->y/2.0; - help[2]=dim->z/2.0; + help[0]=x/2.0; + help[1]=y/2.0; + help[2]=z/2.0; v3_set(&n,help); for(i=0;i