From f457f5cc7ab7bdc8bfbf3458f1eeacb3c3f5dd86 Mon Sep 17 00:00:00 2001 From: "Oleg E. Peil" Date: Wed, 14 Oct 2015 17:36:39 +0200 Subject: [PATCH] Modified ElectronicStructure for new projectors Some necessary modifications to class ElectronicStructure in order to conform the modified projector input. In particular, the dimensions of the projector array are now taken directly from the array, and the old dictionary 'params' is replaced with a list 'proj_params' containing information on the character of projectors. --- python/vasp/elstruct.py | 17 +++++++---------- python/vasp/vaspio.py | 8 ++++++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/python/vasp/elstruct.py b/python/vasp/elstruct.py index fc6454ba..4fd7480d 100644 --- a/python/vasp/elstruct.py +++ b/python/vasp/elstruct.py @@ -55,26 +55,23 @@ class ElectronicStructure: # For later use it is more convenient to use a different order of indices # [see ProjectorGroup.orthogonalization()] - self.proj_raw = vasp_data.plocar.plo.transpose((0, 1, 2, 4, 3)) + self.proj_raw = vasp_data.plocar.plo + self.proj_params = vasp_data.plocar.params -# In fact, Fermi weights do not depend on ions -# FIXME: restructure the data in PLOCAR to remove the redundant dependency -# of 'ferw' on ions self.ferw = vasp_data.eigenval.ferw +# Not needed any more since PROJCAR contains projectors only for a subset of sites # Check that the number of atoms is the same in PLOCAR and POSCAR - natom_plo = vasp_data.plocar.params['nion'] - assert natom_plo == self.natom, "PLOCAR is inconsistent with POSCAR (number of atoms)" +# natom_plo = vasp_data.plocar.params['nion'] +# assert natom_plo == self.natom, "PLOCAR is inconsistent with POSCAR (number of atoms)" # Check that the number of k-points is the same in all files - nk_plo = vasp_data.plocar.params['nk'] + _, ns_plo, nk_plo, nb_plo = vasp_data.plocar.plo.shape assert nk_plo == self.nktot, "PLOCAR is inconsistent with IBZKPT (number of k-points)" nk_eig = vasp_data.eigenval.nktot assert nk_eig == self.nktot, "PLOCAR is inconsistent with EIGENVAL (number of k-points)" -# Check that the number of band is the same in PLOCAR and EIGENVAL - nb_plo = vasp_data.plocar.params['nb'] +# Check that the number of band is the same in PROJCAR and EIGENVAL assert nb_plo == self.nband, "PLOCAR is inconsistent with EIGENVAL (number of bands)" - diff --git a/python/vasp/vaspio.py b/python/vasp/vaspio.py index eecb18f4..2241aca1 100644 --- a/python/vasp/vaspio.py +++ b/python/vasp/vaspio.py @@ -469,8 +469,12 @@ class Doscar: f = read_lines(vasp_dir + dos_filename) -# Skip first 5 lines - for _ in xrange(5): +# First line: NION, NION, JOBPAR, NCDIJ + sline = f.next().split() + self.ncdij = int(sline[3]) + +# Skip next 4 lines + for _ in xrange(4): sline = f.next() # Sixth line: EMAX, EMIN, NEDOS, EFERMI, 1.0