3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-21 20:03:41 +01:00

Added output of k-points

The header of the ctrl-file is terminated by a line "#END OF HEADER"
followed by a dump of k-points with weights.
This commit is contained in:
Oleg E. Peil 2015-08-13 10:59:32 +02:00 committed by Michel Ferrero
parent d794bfa0f5
commit 99f87cc70f

View File

@ -387,8 +387,20 @@ def ctrl_output(conf_pars, el_struct, ng):
header = json.dumps(head_dict, indent=4, separators=(',', ': '))
print " Storing ctrl-file..."
with open(ctrl_fname, 'wt') as f:
f.write(header)
f.write(header + "\n")
f.write("#END OF HEADER\n")
f.write("# k-points and weights\n")
labels = ['kx', 'ky', 'kz', 'kweight']
out = "".join(map(lambda s: s.center(15), labels))
f.write("#" + out + "\n")
for ik, kp in enumerate(el_struct.kmesh['kpoints']):
tmp1 = "".join(map("{0:15.10f}".format, kp))
out = tmp1 + "{0:16.10f}".format(el_struct.kmesh['kweights'][ik])
f.write(out + "\n")
################################################################################
#