X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=vasp_tools%2Fcreate_lattice.c;fp=vasp_tools%2Fcreate_lattice.c;h=5f6cb8d1582b8157f2a0ce9e2dd749afd3af5b1d;hb=88c1733cf107670db154954879b59bc7bb8ce3f2;hp=0000000000000000000000000000000000000000;hpb=0d2f9a11030dff3583104dac5d4dcb9f040a1327;p=physik%2Fposic.git diff --git a/vasp_tools/create_lattice.c b/vasp_tools/create_lattice.c new file mode 100644 index 0000000..5f6cb8d --- /dev/null +++ b/vasp_tools/create_lattice.c @@ -0,0 +1,111 @@ +/* + * create lattice (for usage in vasp POSCAR file) + * + * author: Frank Zirkelbach + * + */ + +#include +#include +#include +#include +#include "../math/math.h" + +#define FCC 0x01 +#define DIAMOND 0x02 +#define ZINCBLENDE 0x03 + +int main(int argc,char **argv) { + + int i,j,k,l,cnt; + t_3dvec basis[3]; + t_3dvec offset; + t_3dvec r,n; + char type; + double zrot; + + if(argc<5) { + printf("usage: %s type lx ly lz\n",argv[0]); + return -1; + } + + type=argv[1][0]; + type=DIAMOND; + + zrot=0.0; + if(argc==6) + zrot=atof(argv[5]); + + offset.x=0.25; + offset.y=0.25; + offset.z=0.25; + + memset(basis,0,3*sizeof(t_3dvec)); + basis[0].x=0.5; + basis[0].y=0.5; + basis[1].x=0.5; + basis[1].z=0.5; + basis[2].y=0.5; + basis[2].z=0.5; + + cnt=0; + r.x=0.0; + for(i=0;i