def __init__(self, gcell):
self.lattice = np.around(gcell.lattice, decimals=6)
self.positions = np.around(gcell.positions, decimals=6)
self.numbers = gcell.numbers
atoms_name_list = list(map(lambda x: Specie.to_name(x),
list(self.numbers)))
d = Counter(atoms_name_list)
ordered_atoms = OrderedDict(sorted(d.items(),
key=lambda x: Specie(x[0]).Z))
# remove Ghostatoms
if 'G' in ordered_atoms:
del ordered_atoms['G']
self.comment = ''.join(['{}{}'.format(k, v)
for k, v in ordered_atoms.items()])
评论列表
文章目录