Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
nomad-lab
parser-elk
Commits
99a190a6
Commit
99a190a6
authored
Nov 16, 2016
by
Pardini, Lorenzo (lopa)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with total energy
parent
4fedb990
Pipeline
#8439
passed with stage
in 5 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
parser/parser-elk/parser_elk.py
parser/parser-elk/parser_elk.py
+10
-7
No files found.
parser/parser-elk/parser_elk.py
View file @
99a190a6
...
...
@@ -14,14 +14,15 @@ class ElkContext(object):
self
.
parser
=
None
def
initialize_values
(
self
):
"""allows to reset values if the same superContext is used to parse different files"""
self
.
metaInfoEnv
=
self
.
parser
.
parserBuilder
.
metaInfoEnv
"""allows to reset values if the same superContext is used to parse different files"""
self
.
metaInfoEnv
=
self
.
parser
.
parserBuilder
.
metaInfoEnv
def
startedParsing
(
self
,
path
,
parser
):
"""called when parsing starts"""
self
.
parser
=
parser
# allows to reset values if the same superContext is used to parse different files
self
.
initialize_values
()
"""called when parsing starts"""
self
.
parser
=
parser
# allows to reset values if the same superContext is used to parse different files
self
.
initialize_values
()
self
.
enTot
=
[]
def
onClose_x_elk_section_lattice_vectors
(
self
,
backend
,
gIndex
,
section
):
latticeX
=
section
[
"x_elk_geometry_lattice_vector_x"
]
...
...
@@ -111,6 +112,8 @@ class ElkContext(object):
backend
.
addArrayValues
(
"eigenvalues_values"
,
np
.
asarray
([
eigvalVal
]))
backend
.
addArrayValues
(
"eigenvalues_occupation"
,
np
.
asarray
([
eigvalOcc
]))
backend
.
addValue
(
"energy_total"
,
self
.
enTot
[
-
1
])
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
backend
.
addArrayValues
(
'configuration_periodic_dimensions'
,
np
.
asarray
([
True
,
True
,
True
]))
self
.
secSystemDescriptionIndex
=
gIndex
...
...
@@ -128,7 +131,7 @@ class ElkContext(object):
def
onClose_section_scf_iteration
(
self
,
backend
,
gIndex
,
section
):
Etot
=
section
[
"energy_total_scf_iteration"
]
backend
.
addValue
(
"energy_total"
,
Etot
[
-
1
])
self
.
enTot
.
append
(
Etot
[
0
])
# description of the input
mainFileDescription
=
\
...
...
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