Commit 0e7820e6 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue in recognizing version ID, added support for parsing VWN5 correlation function.

parent 6987d953
......@@ -25,7 +25,7 @@ class NWChemParser(ParserInterface):
"""
# Search for the NWChem version specification. The correct parser is
# initialized based on this information.
regex_version = re.compile(" Northwest Computational Chemistry Package \(NWChem\) (\d+\.\d+)")
regex_version = re.compile("\s+Northwest Computational Chemistry Package \(NWChem\) (\d+\.\d+(?:\.\d+)?)")
version_id = None
with open(self.parser_context.main_file, 'r') as outputfile:
for line in outputfile:
......
......@@ -301,7 +301,7 @@ class NWChemMainParser(MainHierarchicalParser):
def header(self):
"""Returns the simplematcher that parser the NWChem header
"""
return SM( " Northwest Computational Chemistry Package \(NWChem\) (?P<program_version>{})".format(self.regexs.float),
return SM( "\s+Northwest Computational Chemistry Package \(NWChem\) (?P<program_version>(\d+\.\d+(?:\.\d+)?))",
sections=["x_nwchem_section_start_information"],
subMatchers=[
SM( r"\s+hostname\s+= (?P<x_nwchem_run_host_name>{})".format(self.regexs.eol)),
......@@ -372,6 +372,7 @@ class NWChemMainParser(MainHierarchicalParser):
SM("\s+(?P<x_nwchem_xc_functional_name>OPTX Exchange Functional)\s+(?P<x_nwchem_xc_functional_weight>{})\s+(?P<x_nwchem_xc_functional_type>{})".format(self.regexs.float, self.regexs.eol), sections=["x_nwchem_section_xc_part"]),
SM("\s+(?P<x_nwchem_xc_functional_name>TPSS metaGGA Exchange Functional)\s+(?P<x_nwchem_xc_functional_weight>{})".format(self.regexs.float, self.regexs.eol), sections=["x_nwchem_section_xc_part"]),
SM("\s+(?P<x_nwchem_xc_functional_name>TPSS03 metaGGA Correlation Functional)\s+(?P<x_nwchem_xc_functional_weight>{})".format(self.regexs.float, self.regexs.eol), sections=["x_nwchem_section_xc_part"]),
SM("\s+(?P<x_nwchem_xc_functional_name>VWN V Correlation Functional)\s+(?P<x_nwchem_xc_functional_weight>{})".format(self.regexs.float, self.regexs.eol), sections=["x_nwchem_section_xc_part"]),
],
),
]
......@@ -533,12 +534,14 @@ class NWChemMainParser(MainHierarchicalParser):
"Hartree-Fock \(Exact\) Exchange": "HF_X",
"TPSS metaGGA Exchange Functional": "MGGA_X_TPSS",
"TPSS03 metaGGA Correlation Functional": "MGGA_C_TPSS",
"Slater Exchange Functional": "LDA_X",
"VWN V Correlation Functional": "LDA_C_VWN",
}
name = xc.name
locality = xc.locality
weight = xc.weight
norm_name = component_map.get(name)
if norm_name and (locality is None or locality == ""):
if norm_name:
xc = XCFunctional(norm_name, weight)
xc_final_list.append(xc)
......
start decomp
echo
Title "argon"
charge 0
geometry units angstrom noautoz
Al 0.000000000 0.000000000 0.000000000
end
basis spherical
Al s
0.0025 1
Al s
0.005 1
Al s
0.01 1
Al s
0.0175 1
Al s
0.030625 1
Al s
0.05359375 1
Al s
0.0937890625 1
Al s
0.164130859375 1
Al s
0.28722900390625 1
Al s
0.50265075683594 1
Al s
0.87963882446289 1
Al s
1.53936794281006 1
Al s
2.6938938999176 1
Al s
4.71431432485581 1
Al s
8.25005006849766 1
Al s
14.4375876198709 1
Al s
25.2657783347741 1
Al s
44.2151120858546 1
Al s
77.3764461502456 1
Al s
135.40878076293 1
Al s
236.965366335127 1
Al s
414.689391086473 1
Al s
725.706434401327 1
Al s
1269.98626020232 1
Al s
2222.47595535406 1
Al s
3889.33292186961 1
Al s
6806.33261327182 1
Al s
11911.0820732257 1
Al s
20844.3936281449 1
Al s
36477.6888492537 1
Al s
63835.9554861939 1
Al s
111712.922100839 1
Al s
195497.613676469 1
Al s
342120.82393382 1
Al s
598711.441884186 1
Al s
1047745.02329733 1
Al s
1833553.79077032 1
Al s
3208719.13384806 1
Al s
5615258.4842341 1
Al s
9826702.34740968 1
Al s
17196729.1079669 1
Al s
30094275.9389421 1
Al s
52664982.8931488 1
Al s
92163720.0630103 1
Al p
0.0025 1
Al p
0.005 1
Al p
0.01 1
Al p
0.0175 1
Al p
0.030625 1
Al p
0.05359375 1
Al p
0.0937890625 1
Al p
0.164130859375 1
Al p
0.28722900390625 1
Al p
0.50265075683594 1
Al p
0.87963882446289 1
Al p
1.53936794281006 1
Al p
2.6938938999176 1
Al p
4.71431432485581 1
Al p
8.25005006849766 1
Al p
14.4375876198709 1
Al p
25.2657783347741 1
Al p
44.2151120858546 1
Al p
77.3764461502456 1
Al p
135.40878076293 1
Al p
236.965366335127 1
Al p
414.689391086473 1
Al p
725.706434401327 1
Al p
1269.98626020232 1
Al p
2222.47595535406 1
Al p
3889.33292186961 1
Al p
6806.33261327182 1
Al p
11911.0820732257 1
Al p
20844.3936281449 1
Al d
0.005 1
Al d
0.01 1
Al d
0.02 1
Al d
0.04 1
Al d
0.08 1
Al d
0.16 1
Al d
0.32 1
Al d
0.64 1
Al d
1.28 1
Al d
2.56 1
Al d
5.12 1
Al d
10.24 1
Al d
20.48 1
Al d
40.96 1
Al d
81.92 1
Al f
0.005 1
Al f
0.01 1
Al f
0.02 1
Al f
0.04 1
Al f
0.08 1
Al f
0.16 1
Al f
0.32 1
Al f
0.64 1
Al f
1.28 1
Al f
2.56 1
Al f
5.12 1
Al f
10.24 1
Al f
20.48 1
Al g
0.005 1
Al g
0.01 1
Al g
0.02 1
Al g
0.04 1
Al g
0.08 1
Al g
0.16 1
Al g
0.32 1
Al g
0.64 1
Al g
1.28 1
Al g
2.56 1
Al g
5.12 1
Al g
10.24 1
Al g
20.48 1
Al h
0.005 1
Al h
0.01 1
Al h
0.02 1
Al h
0.04 1
Al h
0.08 1
Al h
0.16 1
Al h
0.32 1
Al h
0.64 1
Al h
1.28 1
Al i
0.005 1
Al i
0.02 1
Al i
0.08 1
Al i
0.32 1
end
dft
xc slater vwn_5
grid xfine
odft
mult 2
tolerances tight
convergence energy 1.000000E-07
end
task dft energy
......@@ -611,6 +611,10 @@ class TestDFTGaussianXCFunctional(unittest.TestCase):
xc = get_result("dft_gaussian/functionals/tpss", "XC_functional")
self.assertEqual(xc, "1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS")
def test_slater_vwn5(self):
xc = get_result("dft_gaussian/functionals/slater_vwn5", "XC_functional")
self.assertEqual(xc, "1.0*LDA_C_VWN+1.0*LDA_X")
class TestDFTPWEnergy(unittest.TestCase):
"""Tests that the parser can handle plane-wave DFT energy calculations.
......
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