Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
parser-exciting
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-exciting
Commits
c33c2e76
Commit
c33c2e76
authored
7 years ago
by
Pardini, Lorenzo (lopa)
Browse files
Options
Downloads
Patches
Plain Diff
added gw bandgap, frequencies and more
parent
56c1aefd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
parser/parser-exciting/exciting_parser_gw.py
+69
-0
69 additions, 0 deletions
parser/parser-exciting/exciting_parser_gw.py
parser/parser-exciting/parser_exciting.py
+8
-0
8 additions, 0 deletions
parser/parser-exciting/parser_exciting.py
with
77 additions
and
0 deletions
parser/parser-exciting/exciting_parser_gw.py
+
69
−
0
View file @
c33c2e76
...
@@ -20,6 +20,14 @@ class GWParser(object):
...
@@ -20,6 +20,14 @@ class GWParser(object):
self
.
vertexDist
=
[]
self
.
vertexDist
=
[]
self
.
vertexLabels
=
[]
self
.
vertexLabels
=
[]
self
.
vertexNum
=
0
self
.
vertexNum
=
0
self
.
parser
=
None
self
.
secSingleConfIndex
=
None
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()
def
parseGW
(
self
,
gwFile
,
backend
,
dftMethodSectionGindex
,
dftSingleConfigurationGindex
,
xcName
,
unitCellVol
,
gmaxvr
):
def
parseGW
(
self
,
gwFile
,
backend
,
dftMethodSectionGindex
,
dftSingleConfigurationGindex
,
xcName
,
unitCellVol
,
gmaxvr
):
# logging.error("GW onClose_section_single_configuration_calculation")
# logging.error("GW onClose_section_single_configuration_calculation")
...
@@ -324,3 +332,64 @@ class GWParser(object):
...
@@ -324,3 +332,64 @@ class GWParser(object):
backend
.
closeNonOverlappingSection
(
"
section_single_configuration_calculation
"
)
backend
.
closeNonOverlappingSection
(
"
section_single_configuration_calculation
"
)
# logging.error("done GW onClose_section_single_configuration_calculation")
# logging.error("done GW onClose_section_single_configuration_calculation")
# def onOpen_section_method(self, backend, gIndex, section):
# fava = section["gw_frequency_number"]
# print("fava=",fava)
# def onClose_section_single_configuration_calculation(self, backend, gIndex, section):
# if dftSingleConfigurationGindex is not None:
## if self.secSingleConfIndex is None:
## self.secSingleConfIndex = gIndex
## singleGIndex = backend.openSection("section_single_configuration_calculation")
# fermi = section["gw_fermi_energy"]
# fundamental = section["gw_fundamental_gap"]
# optical = section["gw_optical_gap"]
# backend.addValue("gw_fermi_energy", fermi)
# backend.addValue("gw_fundamental_gap", fundamental)
# backend.addValue("gw_optical_gap", optical)
## backend.closeSection("section_single_configuration_calculation",singleGIndex)
# else:
# singleGIndex = backend.openSection("section_single_configuration_calculation")
# fermi = section["gw_fermi_energy"]
# fundamental = section["gw_fundamental_gap"]
# optical = section["gw_optical_gap"]
# backend.addValue("gw_fermi_energy", fermi)
# backend.addValue("gw_fundamental_gap", fundamental)
# backend.addValue("gw_optical_gap", optical)
# backend.closeSection("section_single_configuration_calculation",singleGIndex)
def
buildGWMatchers
():
return
SM
(
name
=
'
root
'
,
weak
=
True
,
startReStr
=
"
\=\s*Main GW output file\s*\=
"
,
# sections = ["section_run"],
subMatchers
=
[
SM
(
startReStr
=
"
\-\s*frequency grid\s*\-
"
,
endReStr
=
"
\-\s*Peak memory estimate \(Mb, per process\)\:\s*\-
"
,
sections
=
[
"
section_method
"
],
subMatchers
=
[
# SM(r"\s*Type\:\s*\<\s*(?P<gw_dummy>[-a-zA-Z]+)\s*\>"),
SM
(
r
"
\s*(?P<gw_frequency_number>[0-9]+)\s*(?P<gw_frequency_values__hartree>[0-9]\.[0-9]*([E]?[-]?[-0-9]+))\s*(?P<gw_frequency_weights>[0-9]\.[0-9]*([E]?[-]?[-0-9]+))
"
,
repeats
=
True
)
]),
SM
(
startReStr
=
"
\-\s*G0W0\s*\-
"
,
endReStr
=
"
\=\s*GW timing info \(seconds\)\s*\=
"
,
sections
=
[
"
section_single_configuration_calculation
"
],
subMatchers
=
[
SM
(
r
"
\s*Fermi energy\:\s*(?P<gw_fermi_energy__hartree>[-0-9.]+)
"
),
SM
(
r
"
\s* Fundamental BandGap \(eV\)\:\s*(?P<gw_fundamental_gap__eV>[0-9.]+)
"
),
SM
(
r
"
\s*Direct BandGap \(eV\)\:\s*(?P<gw_fundamental_gap__eV>[0-9.]+)
"
),
SM
(
r
"
\s* Optical BandGap \(eV\)\:\s*(?P<gw_optical_gap__eV>[0-9.]+)
"
)
])
])
def
get_cachingLevelForMetaName
(
metaInfoEnv
,
CachingLvl
):
cachingLevelForMetaName
=
{}
# 'section_single_configuration_calculation': CachingLvl
# }
# cachingLevelForMetaName["gw_fundamental_gap"] = CachingLevel.Cache
# cachingLevelForMetaName["gw_optical_gap"] = CachingLevel.Cache
# cachingLevelForMetaName["gw_fermi_energy"] = CachingLevel.Cache
return
cachingLevelForMetaName
This diff is collapsed.
Click to expand it.
parser/parser-exciting/parser_exciting.py
+
8
−
0
View file @
c33c2e76
...
@@ -58,6 +58,7 @@ class ExcitingParserContext(object):
...
@@ -58,6 +58,7 @@ class ExcitingParserContext(object):
# print("xcName= ",self.xcName)
# print("xcName= ",self.xcName)
for
gFile
in
[
gw_File
,
gwFile
]:
for
gFile
in
[
gw_File
,
gwFile
]:
if
os
.
path
.
exists
(
gFile
):
if
os
.
path
.
exists
(
gFile
):
# print("gFile=",gFile)
# logging.error("Starting GW")
# logging.error("Starting GW")
gwParser
=
exciting_parser_gw
.
GWParser
()
gwParser
=
exciting_parser_gw
.
GWParser
()
gwParser
.
parseGW
(
gFile
,
backend
,
gwParser
.
parseGW
(
gFile
,
backend
,
...
@@ -67,6 +68,13 @@ class ExcitingParserContext(object):
...
@@ -67,6 +68,13 @@ class ExcitingParserContext(object):
unitCellVol
=
self
.
unit_cell_vol
,
unitCellVol
=
self
.
unit_cell_vol
,
gmaxvr
=
self
.
gmaxvr
)
gmaxvr
=
self
.
gmaxvr
)
subParser
=
AncillaryParser
(
fileDescription
=
exciting_parser_gw
.
buildGWMatchers
(),
parser
=
self
.
parser
,
cachingLevelForMetaName
=
exciting_parser_gw
.
get_cachingLevelForMetaName
(
self
.
metaInfoEnv
,
CachingLevel
.
PreOpenedIgnore
),
superContext
=
gwParser
)
with
open
(
gFile
)
as
fIn
:
subParser
.
parseFile
(
fIn
)
# logging.error("Finished GW")
# logging.error("Finished GW")
break
break
# logging.error("done BASE onClose_section_run")
# logging.error("done BASE onClose_section_run")
...
...
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