Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-dftb-plus
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nomad-lab
parser-dftb-plus
Commits
5635f871
Commit
5635f871
authored
8 years ago
by
Adriel Domínguez
Browse files
Options
Downloads
Patches
Plain Diff
added on-close actions for molecule type and eigenvalues sections
parent
a0ed1f98
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser/parser-dftb+/parser_dftb_plus.py
+14
-3
14 additions, 3 deletions
parser/parser-dftb+/parser_dftb_plus.py
with
14 additions
and
3 deletions
parser/parser-dftb+/parser_dftb_plus.py
+
14
−
3
View file @
5635f871
...
...
@@ -2,6 +2,7 @@ import setup_paths
from
builtins
import
object
from
nomadcore.simple_parser
import
SimpleMatcher
as
SM
,
mainFunction
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
from
nomadcore.unit_conversion
import
unit_conversion
import
os
,
sys
,
json
import
numpy
as
np
...
...
@@ -27,6 +28,16 @@ class dftb_plusContext(object):
if
atom_charge
is
not
None
:
backend
.
addArrayValues
(
'
atom_in_molecule_charge
'
,
np
.
asarray
(
atom_charge
))
def
onClose_section_eigenvalues
(
self
,
backend
,
gIndex
,
section
):
eigenvalues
=
section
[
'
x_dftbp_eigenvalues_values
'
]
occ
=
section
[
'
x_dftbp_eigenvalues_occupation
'
]
if
eigenvalues
is
not
None
:
backend
.
addArrayValues
(
'
eigenvalues_values
'
,
np
.
asarray
(
eigenvalues
))
if
occ
is
not
None
:
backend
.
addArrayValues
(
'
eigenvalues_occupation
'
,
np
.
asarray
(
occ
))
# description of the input
mainFileDescription
=
SM
(
...
...
@@ -73,7 +84,7 @@ mainFileDescription = SM(
sections
=
[
'
section_eigenvalues
'
],
subMatchers
=
[
SM
(
r
"
\s*Eigenvalues /H
"
),
SM
(
r
"
\s*(?P<eigenvalues_values__hartree>[+-]?\d+\.\d+)\s*
"
,
repeats
=
True
),
SM
(
r
"
\s*(?P<
x_dftbp_
eigenvalues_values__hartree>[+-]?\d+\.\d+)\s*
"
,
repeats
=
True
),
],
),
SM
(
name
=
'
eigenvalues_eV
'
,
...
...
@@ -82,7 +93,7 @@ mainFileDescription = SM(
sections
=
[
'
section_eigenvalues
'
],
subMatchers
=
[
SM
(
r
"
\s*Eigenvalues /eV
"
),
SM
(
r
"
\s*(?P<eigenvalues_values>[+-]?\d+\.\d+)\s*
"
,
repeats
=
True
),
SM
(
r
"
\s*(?P<
x_dftbp_
eigenvalues_values
__eV
>[+-]?\d+\.\d+)\s*
"
,
repeats
=
True
),
],
),
SM
(
name
=
'
Occupations
'
,
...
...
@@ -91,7 +102,7 @@ mainFileDescription = SM(
sections
=
[
'
section_eigenvalues
'
],
subMatchers
=
[
SM
(
r
"
\s*Fillings
"
),
SM
(
r
"
\s*(?P<eigenvalues_occupation>\d+\.\d+)\s*
"
,
repeats
=
True
),
SM
(
r
"
\s*(?P<
x_dftbp_
eigenvalues_occupation>\d+\.\d+)\s*
"
,
repeats
=
True
),
],
),
SM
(
name
=
'
energies
'
,
...
...
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
register
or
sign in
to comment