Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-elk
Commits
cca3a16c
Commit
cca3a16c
authored
Aug 10, 2016
by
Pardini, Lorenzo (lopa)
Browse files
added eigenvalues
parent
d820a7fd
Pipeline
#6806
passed with stage
in 5 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
parser/parser-elk/parser_elk.py
View file @
cca3a16c
...
@@ -44,6 +44,7 @@ class ElkContext(object):
...
@@ -44,6 +44,7 @@ class ElkContext(object):
def
onClose_section_single_configuration_calculation
(
self
,
backend
,
gIndex
,
section
):
def
onClose_section_single_configuration_calculation
(
self
,
backend
,
gIndex
,
section
):
dirPath
=
os
.
path
.
dirname
(
self
.
parser
.
fIn
.
name
)
dirPath
=
os
.
path
.
dirname
(
self
.
parser
.
fIn
.
name
)
dosFile
=
os
.
path
.
join
(
dirPath
,
"TDOS.OUT"
)
dosFile
=
os
.
path
.
join
(
dirPath
,
"TDOS.OUT"
)
eigvalFile
=
os
.
path
.
join
(
dirPath
,
"EIGVAL.OUT"
)
if
os
.
path
.
exists
(
dosFile
):
if
os
.
path
.
exists
(
dosFile
):
dosGIndex
=
backend
.
openSection
(
"section_dos"
)
dosGIndex
=
backend
.
openSection
(
"section_dos"
)
with
open
(
dosFile
)
as
f
:
with
open
(
dosFile
)
as
f
:
...
@@ -62,6 +63,20 @@ class ElkContext(object):
...
@@ -62,6 +63,20 @@ class ElkContext(object):
backend
.
addArrayValues
(
"dos_values"
,
np
.
asarray
(
dosV
))
backend
.
addArrayValues
(
"dos_values"
,
np
.
asarray
(
dosV
))
backend
.
addArrayValues
(
"dos_energies"
,
np
.
asarray
(
dosE
))
backend
.
addArrayValues
(
"dos_energies"
,
np
.
asarray
(
dosE
))
backend
.
closeSection
(
"section_dos"
,
dosGIndex
)
backend
.
closeSection
(
"section_dos"
,
dosGIndex
)
if
os
.
path
.
exists
(
eigvalFile
):
eigvalGIndex
=
backend
.
openSection
(
"section_eigenvalues"
)
with
open
(
eigvalFile
)
as
g
:
eigvalKpoint
=
[]
eigvalVal
=
[]
eigvalOcc
=
[]
fromH
=
unit_conversion
.
convert_unit_function
(
"hartree"
,
"J"
)
while
1
:
s
=
g
.
readline
()
if
not
s
:
break
s
=
s
.
strip
()
if
len
(
s
)
>
50
:
eigvalKpoint
.
append
(
list
(
map
(
float
,
s
.
split
()[
1
:
4
])))
backend
.
addArrayValues
(
"eigenvalues_kpoints"
,
np
.
asarray
(
eigvalKpoint
))
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
backend
.
addArrayValues
(
'configuration_periodic_dimensions'
,
np
.
asarray
([
True
,
True
,
True
]))
backend
.
addArrayValues
(
'configuration_periodic_dimensions'
,
np
.
asarray
([
True
,
True
,
True
]))
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment