Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-elk
Commits
f790bffa
Commit
f790bffa
authored
Aug 18, 2016
by
Pardini, Lorenzo (lopa)
Browse files
added parsing eigenvalues
parent
cca3a16c
Pipeline
#6880
passed with stage
in 3 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
parser/parser-elk/parser_elk.py
View file @
f790bffa
...
...
@@ -67,15 +67,34 @@ class ElkContext(object):
eigvalGIndex
=
backend
.
openSection
(
"section_eigenvalues"
)
with
open
(
eigvalFile
)
as
g
:
eigvalKpoint
=
[]
eigvalVal
=
[]
eigvalVal
=
[
[],[]
]
eigvalOcc
=
[]
fromH
=
unit_conversion
.
convert_unit_function
(
"hartree"
,
"J"
)
i
=
0
while
1
:
i
+=
1
print
(
"i= "
,
i
)
s
=
g
.
readline
()
if
not
s
:
break
s
=
s
.
strip
()
if
len
(
s
)
>
50
:
# print ("s= ", s)
print
(
"len(s)= "
,
len
(
s
))
if
len
(
s
)
<
20
:
continue
elif
len
(
s
)
>
50
:
eigvalVal
[
0
].
append
([])
eigvalVal
[
1
].
append
([])
eigvalKpoint
.
append
(
list
(
map
(
float
,
s
.
split
()[
1
:
4
])))
# print ("eigvalKpoint= ", eigvalKpoint)
else
:
try
:
int
(
s
[
0
])
except
ValueError
:
continue
else
:
n
,
e
,
occ
=
s
.
split
()
eigvalVal
[
0
][
-
1
].
append
(
int
(
n
))
eigvalVal
[
1
][
-
1
].
append
(
float
(
e
))
print
(
"eigvalVal= "
,
eigvalVal
)
backend
.
addArrayValues
(
"eigenvalues_kpoints"
,
np
.
asarray
(
eigvalKpoint
))
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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