3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-30 16:15:47 +01:00

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.
This commit is contained in:
Oleg E. Peil 2015-11-11 18:58:38 +01:00
parent 5ec3e881cd
commit 453c8531c9
2 changed files with 18 additions and 5 deletions

View File

@ -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()

View File

@ -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 = []