-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathvas2gjf.py
27 lines (23 loc) · 896 Bytes
/
vas2gjf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/env python3
import sys
from VASP import readVasp
from VASP import writeGjf
if len(sys.argv) == 1:
print('')
print('Usage: %s vasp_file1 vasp_file2 ...' % sys.argv[0].split('/')[-1])
print('')
exit(1)
print('')
print('############### This script converts vasp file into gview file ###############')
print(' ############ CONTCAR or POSCAR -> .gjf ############')
print('')
for vasp_file in sys.argv[1:]:
print(' Processing %s' % vasp_file)
lattice, basis, elements, num_atoms, selectiveflag, coordinate_type, coordinates, selective = readVasp(vasp_file)
if vasp_file.endswith('.vasp'):
vasp_file = '%s.gjf' % vasp_file[:-5]
else:
vasp_file = '%s.gjf' % vasp_file
writeGjf(vasp_file, elements, num_atoms, coordinates)
print('')
print(' --------------- Done ---------------\n')