- r.x=0.0;
- for(i=0;i<atoi(argv[2]);i++) {
- r.y=0.0;
- for(j=0;j<atoi(argv[3]);j++) {
- r.z=0.0;
- for(k=0;k<atoi(argv[4]);k++) {
-
- // first atom
- printf(" %.2f %.2f %.2f T T T\n",r.x,r.y,r.z);
+
+ 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<x;i++) {
+ for(j=0;j<y;j++) {
+ for(k=0;k<z;k++) {
+
+ // first atom (all types)
+ r.x=i;
+ r.y=j;
+ r.z=k;
+
+ strcpy(fixstr,"T T T");
+ if(((r.x==0)||(r.y==0)||(r.z==0))&foa)
+ strcpy(fixstr,"F F F");
+ printf(" %.5f %.5f %.5f %s\n",r.x/x,r.y/y,r.z/z,fixstr);