def supcell(file, scale, outmode):
from ababe.io.io import GeneralIO
import os
import numpy as np
basefname = os.path.basename(file)
gcell = GeneralIO.from_file(file)
scale_matrix = np.diag(np.array(scale))
sc = gcell.supercell(scale_matrix)
out = GeneralIO(sc)
print("PROCESSING: {:}".format(file))
if outmode == 'stdio':
out.write_file(fname=None, fmt='vasp')
else:
ofname = "{:}_SUPC.{:}".format(basefname.split('.')[0], outmode)
out.write_file(ofname)
评论列表
文章目录