qli@bigbro:~/Desktop/test$ ls CONTCAR qli@bigbro:~/Desktop/test$ cat CONTCAR Au\(1\1\1) 1.00000000000000 20.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 21.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 22.0000000000000000 C H 2 4 Selective dynamics Direct 0.1615221012872249 0.4048804874587976 0.3815091574487524 T T T 0.1387568880386591 0.3452706062587786 0.3846145011058063 T T T 0.2143704422309978 0.4168857617494277 0.3865629189119751 T T T 0.1712711104214057 0.3044252978921785 0.3929860718019034 T T T 0.1271257560199507 0.4443139925926637 0.3733323288922066 T T T 0.0855583096767520 0.3352469534052885 0.3790158532393584 T T T
qli@bigbro:~/Desktop/test$ ls CONTCAR qli@bigbro:~/Desktop/test$ ase gui CONTCAR -o c2h4.xyz /home/qli/anaconda2/lib/python2.7/site-packages/ase/gui/ag.py:86: UserWarning: You should be using "ase convert ..." instead! warnings.warn('You should be using "ase convert ..." instead!') qli@bigbro:~/Desktop/test$ cat c2h4.xyz 6 Lattice="20.0 0.0 0.0 0.0 21.0 0.0 0.0 0.0 22.0" Properties=species:S:1:pos:R:3 pbc="T T T" C 3.23044203 8.50249024 8.39320146 C 2.77513776 7.25068273 8.46151902 H 4.28740884 8.75460100 8.50438422 H 3.42542221 6.39293126 8.64569358 H 2.54251512 9.33059384 8.21331124 H 1.71116619 7.04018602 8.33834877
qli@bigbro:~/Desktop/test$ ase gui c2h4.xyz -o POSCAR /home/qli/anaconda2/lib/python2.7/site-packages/ase/gui/ag.py:86: UserWarning: You should be using "ase convert ..." instead! warnings.warn('You should be using "ase convert ..." instead!') qli@bigbro:~/Desktop/test$ cat POSCAR -n 1 C H 21.0000000000000000 320.00000000000000000.00000000000000000.0000000000000000 40.000000000000000021.00000000000000000.0000000000000000 50.00000000000000000.000000000000000022.0000000000000000 624 7 Cartesian 83.23044202999999998.50249024000000028.3932014600000002 92.77513775999999987.25068273000000038.4615190200000008 104.28740884000000038.75460099999999928.5043842200000004 113.42542220999999986.39293126000000018.6456935799999997 122.54251512000000009.33059384000000068.2133112399999995 131.71116618999999997.04018602000000028.3383487699999996
从xyz转化成POSCAR的时候,ASE的优点:
1)按照Cartesian格式输出。
2)元素行在第一行。
缺点:
1)输出文件还是老式的VASP格式(vasp 4.6)。第6行前面少了元素哪一行。
解决办法:ASE把这一行写到第一行了。我们直接在vim里面,把第一行复制到第6行前面就OK。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 C H 21.0000000000000000 320.00000000000000000.00000000000000000.0000000000000000 40.000000000000000021.00000000000000000.0000000000000000 50.00000000000000000.000000000000000022.0000000000000000 6 C H 724 8 Cartesian 93.23044202999999998.50249024000000028.3932014600000002 102.77513775999999987.25068273000000038.4615190200000008 114.28740884000000038.75460099999999928.5043842200000004 123.42542220999999986.39293126000000018.6456935799999997 132.54251512000000009.33059384000000068.2133112399999995 141.71116618999999997.04018602000000028.3383487699999996
qli@bigbro:~/Desktop/test$ ls c2h4.xyz CONTCAR POSCAR qli@bigbro:~/Desktop/test$ POSCARtoolkit.py -i POSCAR -f x x x ----------------------------------------------------------- Cartesian Coordinates found, only for fixing atoms! Then type how many layers to be fixed, from bottom to top. -----------------------------------------------------------
Found 1 layers, choose how many layers to be fixed------> 0
----------------------------------------------------------- POSCAR with Cartesian Coordiations is named as POSCAR_C x x x qli@bigbro:~/Desktop/test$ ls c2h4.xyz CONTCAR POSCAR POSCAR_C qli@bigbro:~/Desktop/test$ cat POSCAR_C C H 1.0000000000000000 20.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 21.0000000000000000 0.0000000000000000 0.0000000000000000 0.0000000000000000 22.0000000000000000 C H 2 4 Selective Cartesian +3.2304420300 +8.5024902400 +8.3932014600 T T T +2.7751377600 +7.2506827300 +8.4615190200 T T T +4.2874088400 +8.7546010000 +8.5043842200 T T T x x x