Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-vasp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-vasp
Commits
4facbebf
Commit
4facbebf
authored
8 years ago
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
Options
Downloads
Patches
Plain Diff
spin specific reference
parent
678ea843
Branches
Branches containing commit
Tags
1.3.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-vasp/parser_vasprun.py
+14
-10
14 additions, 10 deletions
parser/parser-vasp/parser_vasprun.py
with
14 additions
and
10 deletions
parser/parser-vasp/parser_vasprun.py
+
14
−
10
View file @
4facbebf
...
@@ -409,6 +409,8 @@ class VasprunContext(object):
...
@@ -409,6 +409,8 @@ class VasprunContext(object):
def
onEnd_eigenvalues
(
self
,
parser
,
event
,
element
,
pathStr
):
def
onEnd_eigenvalues
(
self
,
parser
,
event
,
element
,
pathStr
):
if
pathStr
!=
"
modeling/calculation/eigenvalues
"
:
return
True
backend
=
parser
.
backend
backend
=
parser
.
backend
eigenvalues
=
None
eigenvalues
=
None
occupation
=
None
occupation
=
None
...
@@ -443,20 +445,22 @@ class VasprunContext(object):
...
@@ -443,20 +445,22 @@ class VasprunContext(object):
if
eigenvalues
is
not
None
:
if
eigenvalues
is
not
None
:
ev
=
eV2JV
(
eigenvalues
)
ev
=
eV2JV
(
eigenvalues
)
vbTopE
=
float
(
'
-inf
'
)
# ev[0,0,0
]
vbTopE
=
[
]
ebMinE
=
float
(
'
inf
'
)
ebMinE
=
[]
for
ispin
in
range
(
occupation
.
shape
[
0
]):
for
ispin
in
range
(
occupation
.
shape
[
0
]):
vbTopE
.
append
(
float
(
'
-inf
'
))
ebMinE
.
append
(
float
(
'
inf
'
))
for
ik
in
range
(
occupation
.
shape
[
1
]):
for
ik
in
range
(
occupation
.
shape
[
1
]):
ebIndex
=
bisect
.
bisect_right
(
-
occupation
[
ispin
,
ik
,
:],
-
0.5
)
-
1
ebIndex
=
bisect
.
bisect_right
(
-
occupation
[
ispin
,
ik
,
:],
-
0.5
)
-
1
vbTopIndex
=
ebIndex
-
1
vbTopIndex
=
ebIndex
-
1
if
vbTopIndex
>=
0
:
if
vbTopIndex
>=
0
:
vbTopK
=
ev
[
ispin
,
ik
,
vbTopIndex
]
vbTopK
=
ev
[
ispin
,
ik
,
vbTopIndex
]
if
vbTopK
>
vbTopE
:
if
vbTopK
>
vbTopE
[
ispin
]
:
vbTopE
=
vbTopK
vbTopE
[
ispin
]
=
vbTopK
if
ebIndex
<
ev
.
shape
[
2
]:
if
ebIndex
<
ev
.
shape
[
2
]:
ebMinK
=
ev
[
ispin
,
ik
,
ebIndex
]
ebMinK
=
ev
[
ispin
,
ik
,
ebIndex
]
if
ebMinK
<
ebMinE
:
if
ebMinK
<
ebMinE
[
ispin
]
:
ebMinE
=
ebMinK
ebMinE
[
ispin
]
=
ebMinK
self
.
vbTopE
=
vbTopE
self
.
vbTopE
=
vbTopE
self
.
ebMinE
=
ebMinE
self
.
ebMinE
=
ebMinE
backend
.
addValue
(
"
energy_reference_highest_occupied
"
,
vbTopE
)
backend
.
addValue
(
"
energy_reference_highest_occupied
"
,
vbTopE
)
...
@@ -485,7 +489,7 @@ class VasprunContext(object):
...
@@ -485,7 +489,7 @@ class VasprunContext(object):
logging
.
exception
(
"
failed to get special points
"
)
logging
.
exception
(
"
failed to get special points
"
)
for
isegment
in
range
(
nsegments
):
for
isegment
in
range
(
nsegments
):
backend
.
openNonOverlappingSection
(
"
section_k_band_segment_normalized
"
)
backend
.
openNonOverlappingSection
(
"
section_k_band_segment_normalized
"
)
backend
.
addArrayValues
(
"
band_energies_normalized
"
,
energies
[:,
isegment
,
:,
:]
-
self
.
vbTopE
)
backend
.
addArrayValues
(
"
band_energies_normalized
"
,
energies
[:,
isegment
,
:,
:]
-
max
(
self
.
vbTopE
)
)
backend
.
addArrayValues
(
"
band_occupations_normalized
"
,
occ
[:,
isegment
,
:,
:])
backend
.
addArrayValues
(
"
band_occupations_normalized
"
,
occ
[:,
isegment
,
:,
:])
backend
.
addArrayValues
(
"
band_k_points_normalized
"
,
kpt
[
isegment
])
backend
.
addArrayValues
(
"
band_k_points_normalized
"
,
kpt
[
isegment
])
backend
.
addArrayValues
(
"
band_segm_start_end_normalized
"
,
np
.
asarray
([
kpt
[
isegment
,
0
],
kpt
[
isegment
,
divisions
-
1
]]))
backend
.
addArrayValues
(
"
band_segm_start_end_normalized
"
,
np
.
asarray
([
kpt
[
isegment
,
0
],
kpt
[
isegment
,
divisions
-
1
]]))
...
@@ -705,7 +709,7 @@ class VasprunContext(object):
...
@@ -705,7 +709,7 @@ class VasprunContext(object):
if
el
.
attrib
.
get
(
"
name
"
)
==
"
efermi
"
:
if
el
.
attrib
.
get
(
"
name
"
)
==
"
efermi
"
:
self
.
eFermi
=
eV2J
(
float
(
el
.
text
.
strip
()))
self
.
eFermi
=
eV2J
(
float
(
el
.
text
.
strip
()))
backend
.
addValue
(
"
dos_fermi_energy
"
,
self
.
eFermi
)
backend
.
addValue
(
"
dos_fermi_energy
"
,
self
.
eFermi
)
backend
.
addValue
(
"
energy_reference_fermi
"
,
self
.
eFermi
)
backend
.
addValue
(
"
energy_reference_fermi
"
,
[
self
.
eFermi
]
*
self
.
ispin
)
else
:
else
:
backend
.
pwarn
(
"
unexpected tag %s %s in dos
"
%
(
el
.
tag
,
el
.
attrib
))
backend
.
pwarn
(
"
unexpected tag %s %s in dos
"
%
(
el
.
tag
,
el
.
attrib
))
elif
el
.
tag
==
"
total
"
:
elif
el
.
tag
==
"
total
"
:
...
@@ -727,8 +731,8 @@ class VasprunContext(object):
...
@@ -727,8 +731,8 @@ class VasprunContext(object):
dosE
=
eV2JV
(
dosA
[:,:,
0
])
dosE
=
eV2JV
(
dosA
[:,:,
0
])
dosI
=
dosA
[:,:,
2
]
dosI
=
dosA
[:,:,
2
]
dosV
=
dosA
[:,:,
1
]
dosV
=
dosA
[:,:,
1
]
if
self
.
vbTopE
is
not
None
:
if
self
.
vbTopE
:
eRef
=
self
.
vbTopE
eRef
=
max
(
self
.
vbTopE
)
else
:
else
:
eRef
=
self
.
eFermi
eRef
=
self
.
eFermi
backend
.
addArrayValues
(
"
dos_energies
"
,
dosE
)
backend
.
addArrayValues
(
"
dos_energies
"
,
dosE
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment