X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=vasp_tools%2Fcreate_lattice.c;h=658fdb4c064e8179e82d85ad2721636184b27624;hb=a29f0d8f1217a53ac4e1b90e65d24394f7c8967f;hp=bbcc39eb97ed6733ee8fb1344eeef91f8c2a81a2;hpb=b9c3fc7d4ff67c3b06b12988e6b8b5683af4a2db;p=physik%2Fposic.git diff --git a/vasp_tools/create_lattice.c b/vasp_tools/create_lattice.c index bbcc39e..658fdb4 100644 --- a/vasp_tools/create_lattice.c +++ b/vasp_tools/create_lattice.c @@ -44,18 +44,19 @@ int main(int argc,char **argv) { - int i,j,k,l,cnt; + int i,j,k,l,cnt,estimated; int x,y,z; t_3dvec basis[3]; t_3dvec o[3]; t_3dvec dia; t_3dvec r,h; - char type,fccdia; + char type,fccdia,foa,fixstr[6]; - if(argc!=6) { + if(argc<6) { printf("usage: %s type fcc/dia lx ly lz\n",argv[0]); printf(" basis types: 0, 1, 2 (see code)\n"); printf(" fcc/dia: 0=fcc, 1=dia\n"); + printf(" optional: foa (fix outer atoms)\n"); return -1; } @@ -66,13 +67,17 @@ int main(int argc,char **argv) { y=atoi(argv[4]); z=atoi(argv[5]); + foa=0; + if(argc==7) + foa=1; + dia.x=0.25; dia.y=0.25; dia.z=0.25; if(type=='1') { - dia.x=0.5; - dia.y=0.0; + dia.x=0.0; + dia.y=0.5; dia.z=0.25; } @@ -113,23 +118,51 @@ int main(int argc,char **argv) { cnt=0; + estimated=1; + if(fccdia=='1') estimated*=2; + if(type=='1') estimated*=2; + if(type=='2') estimated*=4; + estimated*=x*y*z; + + // print POSCAR 'header' + + printf("cubic diamond\n"); + printf(" 5.429\n"); + + v3_scale(&h,&basis[0],x); + printf(" %.5f %.5f %.5f\n",h.x,h.y,h.z); + v3_scale(&h,&basis[1],y); + printf(" %.5f %.5f %.5f\n",h.x,h.y,h.z); + v3_scale(&h,&basis[2],z); + printf(" %.5f %.5f %.5f\n",h.x,h.y,h.z); + + printf(" %d\n",estimated); + printf("selective dynamics\n"); + printf("direct\n"); + + // now print the coordinates + for(i=0;i