Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-atk
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
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-atk
Commits
8b3a4a36
Commit
8b3a4a36
authored
8 years ago
by
Mikkel Strange
Browse files
Options
Downloads
Patches
Plain Diff
split up libxc names in X and C if needed
parent
6debb5d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
parser/parser-atk/libxc_names.py
+35
-2
35 additions, 2 deletions
parser/parser-atk/libxc_names.py
parser/parser-atk/parser_atk.py
+9
-3
9 additions, 3 deletions
parser/parser-atk/parser_atk.py
with
44 additions
and
5 deletions
parser/parser-atk/libxc_names.py
+
35
−
2
View file @
8b3a4a36
from
__future__
import
print_function
from
__future__
import
print_function
import
re
p
=
re
.
compile
(
'
((?P<x_name>(GGA|LDA|MGGA|HF|HYB_MGGA)_X.*)|(?P<c_name>(GGA|LDA|MGGA)_C.*))
'
)
short_names
=
{
short_names
=
{
'
LDA.RPA
'
:
'
LDA_X+LDA_C_RPA
'
,
'
LDA.RPA
'
:
'
LDA_X+LDA_C_RPA
'
,
...
@@ -27,6 +30,36 @@ def get_libxc_name(name):
...
@@ -27,6 +30,36 @@ def get_libxc_name(name):
return
libxc_name
return
libxc_name
def
get_libxc_xc_names
(
name
):
"""
get dictionary with
x_name: Exchange name (None if xc_name is not None)
c_name: Correlation name (-||-)
xc_name: XC name
"""
name
=
get_libxc_name
(
name
)
xc
=
{
'
xc_name
'
:
None
,
'
x_name
'
:
None
,
'
c_name
'
:
None
}
if
'
_XC_
'
in
name
:
xc
[
'
xc_name
'
]
=
name
return
xc
if
'
+
'
in
name
:
s
=
name
.
split
(
'
+
'
)
xc
[
'
x_name
'
]
=
s
[
0
]
xc
[
'
c_name
'
]
=
s
[
1
]
return
xc
m
=
re
.
search
(
p
,
name
)
if
m
is
not
None
:
# it is either a correlation or exchange functional
xc
.
update
(
m
.
groupdict
())
return
xc
xc
[
'
xc_name
'
]
=
name
# for something like BEEF-vdW
return
xc
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
print
(
get_libxc_name
(
'
LDA
'
))
print
(
get_libxc_
xc_
name
s
(
'
LDA
.PZ
'
))
print
(
get_libxc_name
(
'
GGA_X_PBE
'
))
#
print(get_libxc_name('GGA_X_PBE'))
This diff is collapsed.
Click to expand it.
parser/parser-atk/parser_atk.py
+
9
−
3
View file @
8b3a4a36
...
@@ -10,7 +10,7 @@ import setup_paths
...
@@ -10,7 +10,7 @@ import setup_paths
from
nomadcore.unit_conversion.unit_conversion
import
convert_unit
as
cu
from
nomadcore.unit_conversion.unit_conversion
import
convert_unit
as
cu
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
from
nomadcore.local_meta_info
import
loadJsonFile
,
InfoKindEl
from
nomadcore.parser_backend
import
JsonParseEventsWriterBackend
from
nomadcore.parser_backend
import
JsonParseEventsWriterBackend
from
libxc_names
import
get_libxc_name
from
libxc_names
import
get_libxc_
xc_
name
s
@contextmanager
@contextmanager
...
@@ -87,8 +87,14 @@ def parse(filename):
...
@@ -87,8 +87,14 @@ def parse(filename):
electron_temperature
,
'
K
'
))
electron_temperature
,
'
K
'
))
p
.
addRealValue
(
'
total_charge
'
,
r
.
c
.
charge
)
p
.
addRealValue
(
'
total_charge
'
,
r
.
c
.
charge
)
with
o
(
p
,
'
section_XC_functionals
'
):
with
o
(
p
,
'
section_XC_functionals
'
):
p
.
addValue
(
'
XC_functional_name
'
,
xc
=
get_libxc_xc_names
(
r
.
c
.
exchange_correlation
)
get_libxc_name
(
r
.
c
.
exchange_correlation
))
if
xc
[
'
xc_name
'
]
is
not
None
:
p
.
addValue
(
'
XC_functional_name
'
,
xc
[
'
xc_name
'
])
if
xc
[
'
x_name
'
]
is
not
None
:
p
.
addValue
(
'
XC_functional_name
'
,
xc
[
'
x_name
'
])
if
xc
[
'
c_name
'
]
is
not
None
:
p
.
addValue
(
'
XC_functional_name
'
,
xc
[
'
c_name
'
])
with
o
(
p
,
'
section_single_configuration_calculation
'
):
with
o
(
p
,
'
section_single_configuration_calculation
'
):
p
.
addValue
(
'
single_configuration_calculation_to_system_ref
'
,
p
.
addValue
(
'
single_configuration_calculation_to_system_ref
'
,
system_gid
)
system_gid
)
...
...
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