Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Markus Scheidgen
parser-exciting
Commits
c33c2e76
Commit
c33c2e76
authored
Feb 02, 2018
by
Pardini, Lorenzo (lopa)
Browse files
added gw bandgap, frequencies and more
parent
56c1aefd
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser-exciting/exciting_parser_gw.py
View file @
c33c2e76
...
...
@@ -20,6 +20,14 @@ class GWParser(object):
self
.
vertexDist
=
[]
self
.
vertexLabels
=
[]
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
):
# logging.error("GW onClose_section_single_configuration_calculation")
...
...
@@ -324,3 +332,64 @@ class GWParser(object):
backend
.
closeNonOverlappingSection
(
"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
parser/parser-exciting/parser_exciting.py
View file @
c33c2e76
...
...
@@ -58,6 +58,7 @@ class ExcitingParserContext(object):
# print("xcName= ",self.xcName)
for
gFile
in
[
gw_File
,
gwFile
]:
if
os
.
path
.
exists
(
gFile
):
# print("gFile=",gFile)
# logging.error("Starting GW")
gwParser
=
exciting_parser_gw
.
GWParser
()
gwParser
.
parseGW
(
gFile
,
backend
,
...
...
@@ -67,6 +68,13 @@ class ExcitingParserContext(object):
unitCellVol
=
self
.
unit_cell_vol
,
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")
break
# logging.error("done BASE onClose_section_run")
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment