From 453c8531c9b07bb09fdd47bfba9739b40bc92801 Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Wed, 11 Nov 2015 18:58:38 +0100 Subject: [PATCH] Replaced options EMIN, EMAX with EWINDOW It did not make much sense to keep two independent options to define an energy range. Now the energy window is directly defined by two floats. --- python/vasp/inpconf.py | 18 ++++++++++++++++-- python/vasp/plotools.py | 5 ++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/python/vasp/inpconf.py b/python/vasp/inpconf.py index bbdec89e..0f3ecc24 100644 --- a/python/vasp/inpconf.py +++ b/python/vasp/inpconf.py @@ -62,8 +62,7 @@ class ConfigParameters: self.gr_required = { 'shells': ('shells', lambda s: map(int, s.split())), - 'emin': ('emin', float), - 'emax': ('emax', float)} + 'ewindow': ('ewindow', self.parse_energy_window)} self.gr_optional = { 'normalize' : ('normalize', self.parse_string_logical, True), @@ -133,6 +132,21 @@ class ConfigParameters: assert first_char in 'tf', "Logical parameters should be given by either 'True' or 'False'" return first_char == 't' +################################################################################ +# +# parse_energy_window() +# +################################################################################ + def parse_energy_window(self, par_str): + """ + Energy window is given by two floats, with the first one being smaller + than the second one. + """ + ftmp = map(float, par_str.split()) + assert len(ftmp) == 2, "EWINDOW must be specified by exactly two floats" + assert ftmp[0] < ftmp[1], "The first float in EWINDOW must be smaller than the second one" + return tuple(ftmp) + ################################################################################ # # parse_string_tmatrix() diff --git a/python/vasp/plotools.py b/python/vasp/plotools.py index c7000ede..5e38c6c0 100644 --- a/python/vasp/plotools.py +++ b/python/vasp/plotools.py @@ -187,8 +187,7 @@ class ProjectorGroup: """ Constructor """ - self.emin = gr_pars['emin'] - self.emax = gr_pars['emax'] + self.emin, self.emax = gr_pars['ewindow'] self.ishells = gr_pars['shells'] self.ortho = gr_pars['normalize'] self.normion = gr_pars['normion'] @@ -319,7 +318,6 @@ class ProjectorShell: self.lm2 = (self.lorb+1)**2 self.ndim = self.extract_tmatrices(sh_pars) - print " Dimension of subspace:", self.ndim # if self.tmatrix is None: # self.ndim = self.lm2 - self.lm1 # else: @@ -620,6 +618,7 @@ def generate_plo(conf_pars, el_struct): print " Shell : %s"%(pshell.user_index) print " Orbital l : %i"%(pshell.lorb) print " Number of ions: %i"%(len(pshell.ion_list)) + print " Dimension : %i"%(pshell.ndim) pshells.append(pshell) pgroups = []