From cefaf9dda4e990e1873a360115c03e32ebe9f23b Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Wed, 11 Nov 2015 11:36:09 +0100 Subject: [PATCH] Added TRANSFILE option to the config-parser TRANSFILE option provides a filename containing transformation matrices for all ions of a projected shell. The parser simply reads the numbers into a 2d-array which is left for interpretation at a later stage. --- python/vasp/inpconf.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/python/vasp/inpconf.py b/python/vasp/inpconf.py index e0b8fafc..bbdec89e 100644 --- a/python/vasp/inpconf.py +++ b/python/vasp/inpconf.py @@ -57,7 +57,8 @@ class ConfigParameters: self.sh_optional = { 'rtransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=True)), - 'ctransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=False))} + 'ctransform': ('tmatrix', lambda s: self.parse_string_tmatrix(s, real=False)), + 'transfile': ('tmatrices', self.parse_file_tmatrix)} self.gr_required = { 'shells': ('shells', lambda s: map(int, s.split())), @@ -167,6 +168,21 @@ class ConfigParameters: return mat +################################################################################ +# +# parse_file_tmatrix() +# +################################################################################ + def parse_file_tmatrix(self, filename): + """ + Parses a file 'filename' containing transformation matrices + for each ion. The parser returns a raw matrix that will be + interpreted elsewhere because the interpretation depends on + shell parameters. + """ + tmatrices = np.loadtxt(filename) + return tmatrices + ################################################################################ # # parse_string_ion_list() @@ -176,10 +192,10 @@ class ConfigParameters: """ Two formats are accepted: - # Two floats (energy range) and an integer (number of energy points). + 1. Two floats (energy range) and an integer (number of energy points). - # One integer (number of energy points). In this case the energy - range is taken to be equal to EMIN, EMAX of a shell. + 2. One integer (number of energy points). In this case the energy + range is taken to be equal to EMIN, EMAX of a shell. The parser returns a dictionary: {'n_points': int,