示例#1
0
文件: ctrl2vasp.py 项目: bbabba/ecalj
#	sys.exit(-1)
coordinates='Cartesian'   

for ix in argvs:  #Get extensions for ctrl.ext or ctrls.ext
	if 'ctrl.' in ix:
		ext = ix.split('ctrl.')[1]
		break
	elif 'ctrls.' in ix:
		ext = ix.split('ctrls.')[1]
		break

titleinput = 'POSCAR_'+ext

openfile = open(argvs[1]).read().split('\n') 
perfectopen = convctrl.fileopen(openfile)
variable_val = convctrl.constlist(openfile)
print 'defined variables are:',variable_val

for const in range(len(variable_val)):
	exec variable_val[const] 
variable_name = convctrl.keywordname(variable_val)

ALATone = convctrl.alat(perfectopen,variable_name)
ALATone[0][1] = eval(ALATone[0][1])
angstrom = 0.529177
ALAT = ALATone[0][1]*angstrom # ALAT in angstrom
PLAT_list = convctrl.plat(perfectopen,variable_name)
#print 'plat=',PLAT_list

for line_ing in range(len(PLAT_list)):
	PLAT_list[line_ing] = re.sub('/','/1.0/',PLAT_list[line_ing]) # this trick replace 5/3 with 5/1.0/3. In python 2 this gives difference (5/3=1 in python2).
示例#2
0
#	print ' You need to set --Cartesian or --Direct.' 
#	sys.exit(-1)
coordinates='Cartesian'   

for ix in argvs:  #Get extensions for ctrl.ext or ctrls.ext
	if 'ctrl.' in ix:
		ext = ix.split('ctrl.')[1]
		break
	elif 'ctrls.' in ix:
		ext = ix.split('ctrls.')[1]
		break

titleinput = 'POSCAR_'+ext
openfile = open(argvs[1]).read().split('\n') 
perfectopen = convctrl.fileopen(openfile)
keyword_val = convctrl.constlist(openfile)
for const in range(len(keyword_val)):
	exec keyword_val[const] 
keyword_name = convctrl.keywordname(keyword_val)
ALATone = convctrl.alat(perfectopen,keyword_name)
ALATone[0][1] = eval(ALATone[0][1])

angstrom = 0.529177
ALAT = ALATone[0][1]*angstrom # ALAT in angstrom
PLAT_list = convctrl.plat(perfectopen,keyword_name)
print 'plat=',PLAT_list

for line_ing in range(len(PLAT_list)):
	PLAT_list[line_ing] = re.sub('/','/1.0/',PLAT_list[line_ing])
	PLAT_list[line_ing] = eval(PLAT_list[line_ing])
示例#3
0
#	sys.exit(-1)
coordinates = 'Cartesian'

for ix in argvs:  #Get extensions for ctrl.ext or ctrls.ext
    if 'ctrl.' in ix:
        ext = ix.split('ctrl.')[1]
        break
    elif 'ctrls.' in ix:
        ext = ix.split('ctrls.')[1]
        break

titleinput = 'POSCAR_' + ext

openfile = open(argvs[1]).read().split('\n')
perfectopen = convctrl.fileopen(openfile)
variable_val = convctrl.constlist(openfile)
print 'defined variables are:', variable_val

for const in range(len(variable_val)):
    exec variable_val[const]
variable_name = convctrl.keywordname(variable_val)

ALATone = convctrl.alat(perfectopen, variable_name)
ALATone[0][1] = eval(ALATone[0][1])
angstrom = 0.529177
ALAT = ALATone[0][1] * angstrom  # ALAT in angstrom
PLAT_list = convctrl.plat(perfectopen, variable_name)
#print 'plat=',PLAT_list

for line_ing in range(len(PLAT_list)):
    PLAT_list[line_ing] = re.sub(