Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-wien2k
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
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-wien2k
Commits
bcea07aa
Commit
bcea07aa
authored
4 years ago
by
Pavel Ondračka
Committed by
Markus Scheidgen
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Parse total DOS
parent
fbd5196d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
wien2kparser/parser_wien2k.py
+58
-2
58 additions, 2 deletions
wien2kparser/parser_wien2k.py
with
58 additions
and
2 deletions
wien2kparser/parser_wien2k.py
+
58
−
2
View file @
bcea07aa
...
@@ -136,6 +136,7 @@ class Wien2kContext(object):
...
@@ -136,6 +136,7 @@ class Wien2kContext(object):
# write the references to section_method and section_system
# write the references to section_method and section_system
backend
.
addValue
(
'
single_configuration_to_calculation_method_ref
'
,
self
.
secMethodIndex
)
backend
.
addValue
(
'
single_configuration_to_calculation_method_ref
'
,
self
.
secMethodIndex
)
backend
.
addValue
(
'
single_configuration_calculation_to_system_ref
'
,
self
.
secSystemIndex
)
backend
.
addValue
(
'
single_configuration_calculation_to_system_ref
'
,
self
.
secSystemIndex
)
fromR
=
unit_conversion
.
convert_unit_function
(
"
rydberg
"
,
"
J
"
)
if
self
.
eTot
is
not
None
:
if
self
.
eTot
is
not
None
:
backend
.
addValue
(
"
energy_total
"
,
self
.
eTot
)
backend
.
addValue
(
"
energy_total
"
,
self
.
eTot
)
...
@@ -154,7 +155,12 @@ class Wien2kContext(object):
...
@@ -154,7 +155,12 @@ class Wien2kContext(object):
# case.energyup and case.energydn for spinpolarized serial calculation
# case.energyup and case.energydn for spinpolarized serial calculation
# case.energy_x files for non spinpolarized parallel calculation
# case.energy_x files for non spinpolarized parallel calculation
# case.energyup_x and case.energydn_x for spinpolarized parallel calculation
# case.energyup_x and case.energydn_x for spinpolarized parallel calculation
if
self
.
spinPol
==
None
:
suffixes
=
[
""
,
"
up
"
,
"
dn
"
]
suffixes
=
[
""
,
"
up
"
,
"
dn
"
]
elif
self
.
spinPol
:
suffixes
=
[
"
up
"
,
"
dn
"
]
else
:
suffixes
=
[
""
]
spin
=
0
spin
=
0
for
suf
in
suffixes
:
for
suf
in
suffixes
:
...
@@ -171,7 +177,6 @@ class Wien2kContext(object):
...
@@ -171,7 +177,6 @@ class Wien2kContext(object):
eigvalVal
.
append
([])
eigvalVal
.
append
([])
else
:
else
:
spin
=
0
spin
=
0
fromR
=
unit_conversion
.
convert_unit_function
(
"
rydberg
"
,
"
J
"
)
eigvalToRead
=
0
eigvalToRead
=
0
for
l
in
g
:
for
l
in
g
:
if
len
(
l
)
>
90
:
if
len
(
l
)
>
90
:
...
@@ -203,6 +208,57 @@ class Wien2kContext(object):
...
@@ -203,6 +208,57 @@ class Wien2kContext(object):
backend
.
addArrayValues
(
"
eigenvalues_kpoints_multiplicity
"
,
np
.
asarray
(
eigvalKpointMult
))
backend
.
addArrayValues
(
"
eigenvalues_kpoints_multiplicity
"
,
np
.
asarray
(
eigvalKpointMult
))
backend
.
closeSection
(
"
section_eigenvalues
"
,
eigvalGIndex
)
backend
.
closeSection
(
"
section_eigenvalues
"
,
eigvalGIndex
)
#iterate over all dos files, for now just the total dos is supported
spin
=
0
DOS
=
[[]]
ene
=
[]
eneNorm
=
[]
for
suf
in
suffixes
:
for
n
in
range
(
1
,
50
):
fName
=
mainFile
[:
-
4
]
+
"
.dos
"
+
str
(
n
)
+
suf
if
os
.
path
.
exists
(
fName
):
#read the DOS file
with
open
(
fName
)
as
f
:
if
suf
==
"
dn
"
:
spin
=
1
if
len
(
DOS
)
==
1
:
DOS
.
append
([])
ene
=
[]
eneNorm
=
[]
Ef
=
0.0
totDOScol
=
0
for
i
,
l
in
enumerate
(
f
):
l
=
l
.
split
()
if
i
==
1
:
Ef
=
float
(
l
[
1
])
if
i
==
2
:
#find out which column is the total DOS
for
j
,
w
in
enumerate
(
l
):
if
"
total-DOS
"
in
w
or
"
TOTAL
"
in
w
:
totDOScol
=
j
-
1
break
# there is no total DOS column here
if
totDOScol
==
0
:
break
if
i
>
2
:
ene
.
append
(
fromR
(
float
(
l
[
0
])))
eneNorm
.
append
(
fromR
(
float
(
l
[
0
])
-
Ef
))
DOS
[
spin
].
append
(
float
(
l
[
totDOScol
])
/
fromR
(
1.0
))
# we found the total DOS, ignore the rest of files
if
DOS
[
spin
]:
break
else
:
break
if
DOS
[
0
]:
DOSGIndex
=
backend
.
openSection
(
"
section_dos
"
)
backend
.
addArrayValues
(
"
dos_energies
"
,
np
.
asarray
(
ene
))
backend
.
addArrayValues
(
"
dos_energies_normalized
"
,
np
.
asarray
(
eneNorm
))
backend
.
addArrayValues
(
"
dos_values
"
,
np
.
asarray
(
DOS
))
backend
.
addValue
(
"
dos_kind
"
,
"
electronic
"
)
backend
.
addValue
(
"
number_of_dos_values
"
,
len
(
DOS
[
0
]))
backend
.
closeSection
(
"
section_dos
"
,
DOSGIndex
)
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
# atom labels
# atom labels
...
...
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