From 99f87cc70f240cd8736fbf82f09f3b981164c7b4 Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Thu, 13 Aug 2015 10:59:32 +0200 Subject: [PATCH] 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. --- python/converters/vasp/python/plotools.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python/converters/vasp/python/plotools.py b/python/converters/vasp/python/plotools.py index 5a07357a..78b40776 100644 --- a/python/converters/vasp/python/plotools.py +++ b/python/converters/vasp/python/plotools.py @@ -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") + ################################################################################ #