Commit a9a95ab1 authored by Daria Tomecka's avatar Daria Tomecka
Browse files

wien2k: errata - section_XC

parent 268e1923
......@@ -38,6 +38,7 @@ class Wien2kContext(object):
section["x_wien2k_release_date"][0])
def onOpen_section_system(self, backend, gIndex, section):
self.secSystemIndex = gIndex
mainFile = self.parser.fIn.fIn.name
fName = mainFile[:-4] + ".struct"
if os.path.exists(fName):
......@@ -131,11 +132,6 @@ class Wien2kContext(object):
backend.addValue('single_configuration_calculation_to_system_ref', self.secSystemIndex)
def onOpen_section_system(self, backend, gIndex, section):
#if self.secSystemIndex is None:
self.secSystemIndex = gIndex
# self.secSystemIndex["single_configuration_calculation_to_system_ref"] = gIndex
def onClose_section_system(self, backend, gIndex, section):
#backend.addValue("smearing_kind", x_fleur_smearing_kind)
......
......@@ -3,7 +3,7 @@ import setup_paths
from nomadcore.simple_parser import mainFunction, CachingLevel
from nomadcore.simple_parser import SimpleMatcher as SM
from nomadcore.local_meta_info import loadJsonFile, InfoKindEl
import os, sys, json
import os, sys, json, logging
......@@ -30,88 +30,88 @@ class Wien2kIn0Context(object):
def onClose_x_wien2k_section_XC(self, backend, gIndex, section):
xc_index = section["x_wien2k_indxc"] #[0]
# logging.error("winsectxc: %s -> %s", section, xc_index)
if not xc_index:
functional = "XC_PBE"
if functional:
xc_map_legend = {
'5': ['LDA_C_PW_RPA'],
'XC_LDA': ['LDA_X_2D'],
'13': ['GGA_X_PBE', 'GGA_C_PBE'],
'XC_PBE':['GGA_X_PBE', 'GGA_C_PBE'],
'19': ['GGA_X_PBE_SOL', 'GGA_C_PBE_SOL:'],
'XC_PBESOL': ['GGA_X_PBE_SOL', 'GGA_C_PBE_SOL:'],
'11': ['GGA_X_WC'],
'XC_WC': ['GGA_X_WC'],
'17': ['GGA_X_PW91'],
'EC_PW91': ['GGA_X_PW91'],
'VC_PW91': ['GGA_X_PW91'],
'28': ['MGGA_X_TB09'],
'XC_MBJ': ['MGGA_X_TB09'],
'29': ['MGGA_C_REVTPSS, GGA_C_REGTPSS'],
'XC_REVTPSS': ['MGGA_C_REVTPSS, GGA_C_REGTPSS'],
'24': ['GGA_X_B88', 'GGA_C_LYP'],
'EX_B88': ['GGA_X_B88'],
'VX_B88': ['GGA_X_B88'],
'EC_LYP': ['GGA_C_LYP'],
'VC_LYP': ['GGA_C_LYP'],
'18': ['HYB_GGA_XC_B3PW91'],
'XC_B3PW91': ['HYB_GGA_XC_B3PW91'],
'27': ['MGGA_X_TPSS','MGGA_C_TPSS'],
'XC_TPSS': ['MGGA_X_TPSS','MGGA_C_TPSS'],
'46':['GGA_X_HTBS'],
'XC_HTBS': ['GGA_X_HTBS'],
'47': ['HYB_GGA_XC_B3LYP'],
'XC_B3LYP': ['HYB_GGA_XC_B3LYP'],
# 51: ['-'],
# EX_SLDA:
# VX_SLDA:
# 52: ['-'],
# EX_SPBE:
# VX_SPBE:
# 53: ['-'],
# EX_SWC:
# VX_SWC:
# 54: ['-'],
# EX_SPBESOL:
# VX_SPBESOL:
# 55: ['-'],
# EX_SB88:
# VX_SB88:
'6': ['HF_X'],
'EX_LDA': ['HF_X'],
'VX_LDA': ['HF_X']
}
# Push the functional string into the backend
xc_map_legend = xc_map_legend.get(functional)
if not xc_map_legend:
raise Exception("Unhandled xc functional %s found" % functional)
for xc_name in xc_map_legend:
# for xc_name in xc_map_legend[xc_index]:
s = backend.openSection("section_XC_functionals")
backend.addValue("XC_functional_name", xc_name)
backend.closeSection("section_XC_functionals", s)
xc_index = ["XC_PBE"]
xc_map_legend = {
'5': ['LDA_C_PW_RPA'],
'XC_LDA': ['LDA_X_2D'],
'13': ['GGA_X_PBE', 'GGA_C_PBE'],
'XC_PBE':['GGA_X_PBE', 'GGA_C_PBE'],
'19': ['GGA_X_PBE_SOL', 'GGA_C_PBE_SOL:'],
'XC_PBESOL': ['GGA_X_PBE_SOL', 'GGA_C_PBE_SOL:'],
'11': ['GGA_X_WC'],
'XC_WC': ['GGA_X_WC'],
'17': ['GGA_X_PW91'],
'EC_PW91': ['GGA_X_PW91'],
'VC_PW91': ['GGA_X_PW91'],
'28': ['MGGA_X_TB09'],
'XC_MBJ': ['MGGA_X_TB09'],
'29': ['MGGA_C_REVTPSS, GGA_C_REGTPSS'],
'XC_REVTPSS': ['MGGA_C_REVTPSS, GGA_C_REGTPSS'],
'24': ['GGA_X_B88', 'GGA_C_LYP'],
'EX_B88': ['GGA_X_B88'],
'VX_B88': ['GGA_X_B88'],
'EC_LYP': ['GGA_C_LYP'],
'VC_LYP': ['GGA_C_LYP'],
'18': ['HYB_GGA_XC_B3PW91'],
'XC_B3PW91': ['HYB_GGA_XC_B3PW91'],
'27': ['MGGA_X_TPSS','MGGA_C_TPSS'],
'XC_TPSS': ['MGGA_X_TPSS','MGGA_C_TPSS'],
'46':['GGA_X_HTBS'],
'XC_HTBS': ['GGA_X_HTBS'],
'47': ['HYB_GGA_XC_B3LYP'],
'XC_B3LYP': ['HYB_GGA_XC_B3LYP'],
# 51: ['-'],
# EX_SLDA:
# VX_SLDA:
# 52: ['-'],
# EX_SPBE:
# VX_SPBE:
# 53: ['-'],
# EX_SWC:
# VX_SWC:
# 54: ['-'],
# EX_SPBESOL:
# VX_SPBESOL:
# 55: ['-'],
# EX_SB88:
# VX_SB88:
'6': ['HF_X'],
'EX_LDA': ['HF_X'],
'VX_LDA': ['HF_X']
}
# Push the functional string into the backend
xc_map_legend = xc_map_legend.get(xc_index[0])
if not xc_map_legend:
raise Exception("Unhandled xc functional %s found" % xc_index)
for xc_name in xc_map_legend:
# for xc_name in xc_map_legend[xc_index]:
s = backend.openSection("section_XC_functionals")
backend.addValue("XC_functional_name", xc_name)
backend.closeSection("section_XC_functionals", s)
# description of the input
def buildIn0Matchers():
......@@ -119,7 +119,7 @@ def buildIn0Matchers():
name = 'root',
weak = True,
startReStr = "",
sections = ["section_run", "section_method", "section_XC_functionals"],
sections = ["section_run", "section_method"],
subMatchers = [
# SM(name = 'systemName',
# startReStr = r"(?P<x_wien2k_system_nameIn>.*)"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment