Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-elk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
nomad-lab
parser-elk
Commits
d05af29c
There was a problem fetching the pipeline summary.
Commit
d05af29c
authored
Nov 16, 2016
by
Pardini, Lorenzo (lopa)
Browse files
Options
Downloads
Patches
Plain Diff
fixed bug with atom positions
parent
99a190a6
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-elk/parser_elk.py
+31
-10
31 additions, 10 deletions
parser/parser-elk/parser_elk.py
with
31 additions
and
10 deletions
parser/parser-elk/parser_elk.py
+
31
−
10
View file @
d05af29c
...
...
@@ -22,7 +22,10 @@ class ElkContext(object):
self
.
parser
=
parser
# allows to reset values if the same superContext is used to parse different files
self
.
initialize_values
()
self
.
enTot
=
[]
self
.
atom_pos
=
[]
self
.
atom_labels
=
[]
def
onClose_x_elk_section_lattice_vectors
(
self
,
backend
,
gIndex
,
section
):
latticeX
=
section
[
"
x_elk_geometry_lattice_vector_x
"
]
...
...
@@ -118,16 +121,33 @@ class ElkContext(object):
backend
.
addArrayValues
(
'
configuration_periodic_dimensions
'
,
np
.
asarray
([
True
,
True
,
True
]))
self
.
secSystemDescriptionIndex
=
gIndex
atom_pos
=
[]
for
i
in
[
'
x
'
,
'
y
'
,
'
z
'
]:
api
=
section
[
'
x_elk_geometry_atom_positions_
'
+
i
]
if
api
is
not
None
:
atom_pos
.
append
(
api
)
if
atom_pos
:
backend
.
addArrayValues
(
'
atom_positions
'
,
np
.
transpose
(
np
.
asarray
(
atom_pos
)))
atom_labels
=
section
[
'
x_elk_geometry_atom_labels
'
]
if
atom_labels
is
not
None
:
backend
.
addArrayValues
(
'
atom_labels
'
,
np
.
asarray
(
atom_labels
))
# atom_pos = []
# for i in ['x', 'y', 'z']:
# api = section['x_elk_geometry_atom_positions_' + i]
# if api is not None:
# atom_pos.append(api)
# if atom_pos:
# backend.addArrayValues('atom_positions', np.transpose(np.asarray(atom_pos)))
# atom_labels = section['x_elk_geometry_atom_labels']
# if atom_labels is not None:
# backend.addArrayValues('atom_labels', np.asarray(atom_labels))
if
self
.
atom_pos
:
backend
.
addArrayValues
(
'
atom_positions
'
,
np
.
asarray
(
self
.
atom_pos
))
self
.
atom_pos
=
[]
if
self
.
atom_labels
is
not
None
:
backend
.
addArrayValues
(
'
atom_labels
'
,
np
.
asarray
(
self
.
atom_labels
))
self
.
atom_labels
=
[]
def
onClose_x_elk_section_atoms_group
(
self
,
backend
,
gIndex
,
section
):
pos
=
[
section
[
'
x_elk_geometry_atom_positions_
'
+
i
]
for
i
in
[
'
x
'
,
'
y
'
,
'
z
'
]]
pl
=
[
len
(
comp
)
for
comp
in
pos
]
natom
=
pl
[
0
]
if
pl
[
1
]
!=
natom
or
pl
[
2
]
!=
natom
:
raise
Exception
(
"
invalid number of atoms in various components %s
"
%
pl
)
for
i
in
range
(
natom
):
self
.
atom_pos
.
append
([
pos
[
0
][
i
],
pos
[
1
][
i
],
pos
[
2
][
i
]])
self
.
atom_labels
=
self
.
atom_labels
+
(
section
[
'
x_elk_geometry_atom_labels
'
]
*
natom
)
def
onClose_section_scf_iteration
(
self
,
backend
,
gIndex
,
section
):
Etot
=
section
[
"
energy_total_scf_iteration
"
]
...
...
@@ -164,6 +184,7 @@ mainFileDescription = \
SM
(
r
"
\s*Unit cell volume\s*:\s*(?P<x_elk_unit_cell_volume__bohr3>[-0-9.]+)
"
),
SM
(
r
"
\s*Brillouin zone volume\s*:\s*(?P<x_elk_brillouin_zone_volume__bohr_3>[-0-9.]+)
"
),
SM
(
r
"
\s*Species\s*:\s*[0-9]\s*\((?P<x_elk_geometry_atom_labels>[-a-zA-Z0-9]+)\)
"
,
repeats
=
True
,
sections
=
[
"
x_elk_section_atoms_group
"
],
subMatchers
=
[
SM
(
r
"
\s*muffin-tin radius\s*:\s*(?P<x_elk_muffin_tin_radius__bohr>[-0-9.]+)
"
),
SM
(
r
"
\s*number of radial points in muffin-tin\s*:\s*(?P<x_elk_muffin_tin_points>[-0-9.]+)
"
),
...
...
...
...
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
sign in
to comment