Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parser-elk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nomad-lab
parser-elk
Commits
3d89d9c2
Commit
3d89d9c2
authored
Jan 06, 2017
by
Pardini, Lorenzo (lopa)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spin treatment
parent
0decad86
Pipeline
#9226
failed with stage
in 5 minutes and 30 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
10 deletions
+31
-10
parser/parser-elk/parser_elk.py
parser/parser-elk/parser_elk.py
+31
-10
No files found.
parser/parser-elk/parser_elk.py
View file @
3d89d9c2
...
...
@@ -26,25 +26,26 @@ class ElkContext(object):
self
.
enTot
=
[]
self
.
atom_pos
=
[]
self
.
atom_labels
=
[]
self
.
spinTreat
=
None
def
onClose_x_elk_section_lattice_vectors
(
self
,
backend
,
gIndex
,
section
):
latticeX
=
section
[
"x_elk_geometry_lattice_vector_x"
]
latticeY
=
section
[
"x_elk_geometry_lattice_vector_y"
]
latticeZ
=
section
[
"x_elk_geometry_lattice_vector_z"
]
cell
=
[[
latticeX
[
0
],
latticeY
[
0
],
latticeZ
[
0
]],
cell
=
np
.
array
(
[[
latticeX
[
0
],
latticeY
[
0
],
latticeZ
[
0
]],
[
latticeX
[
1
],
latticeY
[
1
],
latticeZ
[
1
]],
[
latticeX
[
2
],
latticeY
[
2
],
latticeZ
[
2
]]]
# print ("celll= ",
cell
)
backend
.
add
Value
(
"simulation_cell"
,
cell
)
[
latticeX
[
2
],
latticeY
[
2
],
latticeZ
[
2
]]]
)
# print ("celll= ",
latticeZ
)
backend
.
add
ArrayValues
(
"simulation_cell"
,
cell
)
def
onClose_x_elk_section_reciprocal_lattice_vectors
(
self
,
backend
,
gIndex
,
section
):
recLatticeX
=
section
[
"x_elk_geometry_reciprocal_lattice_vector_x"
]
recLatticeY
=
section
[
"x_elk_geometry_reciprocal_lattice_vector_y"
]
recLatticeZ
=
section
[
"x_elk_geometry_reciprocal_lattice_vector_z"
]
recCell
=
[[
recLatticeX
[
0
],
recLatticeY
[
0
],
recLatticeZ
[
0
]],
recCell
=
np
.
array
(
[[
recLatticeX
[
0
],
recLatticeY
[
0
],
recLatticeZ
[
0
]],
[
recLatticeX
[
1
],
recLatticeY
[
1
],
recLatticeZ
[
1
]],
[
recLatticeX
[
2
],
recLatticeY
[
2
],
recLatticeZ
[
2
]]]
backend
.
add
Value
(
"x_elk_simulation_reciprocal_cell"
,
recCell
)
[
recLatticeX
[
2
],
recLatticeY
[
2
],
recLatticeZ
[
2
]]]
)
backend
.
add
ArrayValues
(
"x_elk_simulation_reciprocal_cell"
,
recCell
)
def
onClose_x_elk_section_xc
(
self
,
backend
,
gIndex
,
section
):
xcNr
=
section
[
"x_elk_xc_functional"
][
0
]
...
...
@@ -114,9 +115,24 @@ class ElkContext(object):
backend
.
addArrayValues
(
"eigenvalues_kpoints"
,
np
.
asarray
(
eigvalKpoint
))
backend
.
addArrayValues
(
"eigenvalues_values"
,
np
.
asarray
([
eigvalVal
]))
backend
.
addArrayValues
(
"eigenvalues_occupation"
,
np
.
asarray
([
eigvalOcc
]))
backend
.
closeSection
(
"section_eigenvalues"
,
eigvalGIndex
)
backend
.
addValue
(
"energy_total"
,
self
.
enTot
[
-
1
])
def
onClose_x_elk_section_spin
(
self
,
backend
,
gIndex
,
section
):
# pass
spin
=
section
[
"x_elk_spin_treatment"
][
0
]
# print("prima",len(spin))
spin
=
spin
.
strip
()
# print("dopo",len(spin))
# print("spin=",spin,"spin", type(spin))
if
spin
==
"spin-polarised"
:
# print("Vero")
self
.
spinTreat
=
True
else
:
# print("Falso")
self
.
spinTreat
=
False
def
onClose_section_system
(
self
,
backend
,
gIndex
,
section
):
backend
.
addArrayValues
(
'configuration_periodic_dimensions'
,
np
.
asarray
([
True
,
True
,
True
]))
self
.
secSystemDescriptionIndex
=
gIndex
...
...
@@ -138,7 +154,7 @@ class ElkContext(object):
if
self
.
atom_labels
is
not
None
:
backend
.
addArrayValues
(
'atom_labels'
,
np
.
asarray
(
self
.
atom_labels
))
self
.
atom_labels
=
[]
# print("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
]
...
...
@@ -186,13 +202,18 @@ mainFileDescription = \
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.]+)"
),
#
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.]+)"),
SM
(
startReStr
=
r"\s*atomic positions\s*\(lattice\)\, magnetic fields \(Cartesian\)\s*:\s*"
,
subMatchers
=
[
SM
(
r"\s*(?P<x_elk_geometry_atom_number>[+0-9]+)\s*:\s*(?P<x_elk_geometry_atom_positions_x__bohr>[-+0-9.]+)\s*(?P<x_elk_geometry_atom_positions_y__bohr>[-+0-9.]+)\s*(?P<x_elk_geometry_atom_positions_z__bohr>[-+0-9.]+)"
,
repeats
=
True
)
])
]),
SM
(
startReStr
=
r"\s*Spin treatment\s*:\s*"
,
sections
=
[
"x_elk_section_spin"
],
subMatchers
=
[
SM
(
r"\s*(?P<x_elk_spin_treatment>[-a-zA-Z\s*]+)"
)
]),
SM
(
r"\s*k-point grid\s*:\s*(?P<x_elk_number_kpoint_x>[-0-9.]+)\s+(?P<x_elk_number_kpoint_y>[-0-9.]+)\s+(?P<x_elk_number_kpoint_z>[-0-9.]+)"
),
SM
(
r"\s*k-point offset\s*:\s*(?P<x_elk_kpoint_offset_x>[-0-9.]+)\s+(?P<x_elk_kpoint_offset_y>[-0-9.]+)\s+(?P<x_elk_kpoint_offset_z>[-0-9.]+)"
),
SM
(
r"\s*Total number of k-points\s*:\s*(?P<x_elk_number_kpoints>[-0-9.]+)"
),
...
...
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