Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
parser-nwchem
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nomad-lab
parser-nwchem
Commits
ea52d86d
Commit
ea52d86d
authored
Feb 23, 2017
by
Lauri Himanen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the issue with mixed basis set types.
parent
c7f236b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
parser/parser-nwchem/nwchemparser/regtest/nwchem_6.6/run_tests.py
...arser-nwchem/nwchemparser/regtest/nwchem_6.6/run_tests.py
+20
-0
parser/parser-nwchem/nwchemparser/versions/nwchem66/mainparser.py
...arser-nwchem/nwchemparser/versions/nwchem66/mainparser.py
+15
-3
No files found.
parser/parser-nwchem/nwchemparser/regtest/nwchem_6.6/run_tests.py
View file @
ea52d86d
...
...
@@ -68,6 +68,10 @@ class TestDFTGaussianEnergy(unittest.TestCase):
result
=
self
.
results
[
"program_version"
]
self
.
assertEqual
(
result
,
"6.6"
)
def
test_program_basis_set_type
(
self
):
result
=
self
.
results
[
"program_basis_set_type"
]
self
.
assertEqual
(
result
,
"gaussians"
)
def
test_xc_functional
(
self
):
result
=
self
.
results
[
"XC_functional"
]
self
.
assertEqual
(
result
,
"1.0*MGGA_C_TPSS+1.0*MGGA_X_TPSS"
)
...
...
@@ -207,6 +211,10 @@ class TestDFTGaussianForce(unittest.TestCase):
result
=
self
.
results
[
"configuration_periodic_dimensions"
]
self
.
assertTrue
(
np
.
array_equal
(
result
,
np
.
array
([
False
,
False
,
False
])))
def
test_program_basis_set_type
(
self
):
result
=
self
.
results
[
"program_basis_set_type"
]
self
.
assertEqual
(
result
,
"gaussians"
)
def
test_electronic_structure_method
(
self
):
result
=
self
.
results
[
"electronic_structure_method"
]
self
.
assertEqual
(
result
,
"DFT"
)
...
...
@@ -236,6 +244,10 @@ class TestDFTGaussianGeoOpt(unittest.TestCase):
def
setUpClass
(
cls
):
cls
.
results
=
get_results
(
"dft_gaussian/geo_opt"
,
"section_run"
)
def
test_program_basis_set_type
(
self
):
result
=
self
.
results
[
"program_basis_set_type"
]
self
.
assertEqual
(
result
,
"gaussians"
)
def
test_configuration_periodic_dimensions
(
self
):
result
=
self
.
results
[
"configuration_periodic_dimensions"
][
0
]
self
.
assertTrue
(
np
.
array_equal
(
result
,
np
.
array
([
False
,
False
,
False
])))
...
...
@@ -414,6 +426,10 @@ class TestDFTGaussianMD(unittest.TestCase):
"K"
)
def
test_program_basis_set_type
(
self
):
result
=
self
.
results
[
"program_basis_set_type"
]
self
.
assertEqual
(
result
,
"gaussians"
)
def
get_system
(
self
,
index
):
scc
=
self
.
get_scc
(
index
)
system_ref
=
scc
[
"single_configuration_calculation_to_system_ref"
]
...
...
@@ -636,6 +652,10 @@ class TestDFTPWEnergy(unittest.TestCase):
result
=
self
.
results
[
"program_name"
]
self
.
assertEqual
(
result
,
"NWChem"
)
def
test_program_basis_set_type
(
self
):
result
=
self
.
results
[
"program_basis_set_type"
]
self
.
assertEqual
(
result
,
"plane waves"
)
def
test_configuration_periodic_dimensions
(
self
):
result
=
self
.
results
[
"configuration_periodic_dimensions"
][
0
]
self
.
assertTrue
(
np
.
array_equal
(
result
,
np
.
array
([
True
,
True
,
True
])))
...
...
parser/parser-nwchem/nwchemparser/versions/nwchem66/mainparser.py
View file @
ea52d86d
...
...
@@ -21,6 +21,7 @@ class NWChemMainParser(MainHierarchicalParser):
# Cache for storing current method settings
self
.
method_cache
=
CacheService
(
self
.
parser_context
)
self
.
method_cache
.
add
(
"single_configuration_to_calculation_method_ref"
,
single
=
False
,
update
=
False
)
self
.
method_cache
.
add
(
"program_basis_set_type"
,
single
=
True
,
update
=
False
)
# Cache for storing current sampling method settings
self
.
sampling_method_cache
=
CacheService
(
self
.
parser_context
)
...
...
@@ -80,7 +81,7 @@ class NWChemMainParser(MainHierarchicalParser):
subMatchers
=
[
self
.
energy_force_gaussian_task
(),
self
.
energy_force_pw_task
(),
self
.
geo_opt_module
(),
self
.
g
aussian_g
eo_opt_module
(),
self
.
dft_gaussian_md_task
(),
]
),
...
...
@@ -107,6 +108,7 @@ class NWChemMainParser(MainHierarchicalParser):
def
energy_force_gaussian_task
(
self
):
return
SM
(
" NWChem DFT Module"
,
startReAction
=
self
.
set_gaussian_basis
,
forwardMatch
=
True
,
subMatchers
=
[
self
.
dft_calculation_full
(),
...
...
@@ -117,6 +119,7 @@ class NWChemMainParser(MainHierarchicalParser):
def
energy_force_pw_task
(
self
):
return
SM
(
" \* NWPW PSPW Calculation \*"
,
sections
=
[
"section_single_configuration_calculation"
,
"section_system"
,
"section_method"
],
startReAction
=
self
.
set_plane_wave_basis
,
fixedStartValues
=
{
"electronic_structure_method"
:
"DFT"
,
},
...
...
@@ -162,8 +165,9 @@ class NWChemMainParser(MainHierarchicalParser):
],
)
def
geo_opt_module
(
self
):
def
g
aussian_g
eo_opt_module
(
self
):
return
SM
(
" NWChem Geometry Optimization"
,
startReAction
=
self
.
set_gaussian_basis
,
sections
=
[
"section_frame_sequence"
,
"section_sampling_method"
,
"x_nwchem_section_geo_opt_module"
],
subFlags
=
SM
.
SubFlags
.
Sequenced
,
subMatchers
=
[
...
...
@@ -221,6 +225,7 @@ class NWChemMainParser(MainHierarchicalParser):
def
dft_gaussian_md_task
(
self
):
return
SM
(
" NWChem QMD Module"
,
startReAction
=
self
.
set_gaussian_basis
,
sections
=
[
"section_frame_sequence"
,
"section_sampling_method"
,
"x_nwchem_section_qmd_module"
],
subMatchers
=
[
SM
(
" QMD Run Parameters"
,
...
...
@@ -421,7 +426,8 @@ class NWChemMainParser(MainHierarchicalParser):
# onClose triggers
def
onClose_section_run
(
self
,
backend
,
gIndex
,
section
):
backend
.
addValue
(
"program_name"
,
"NWChem"
)
backend
.
addValue
(
"program_basis_set_type"
,
"gaussians+plane_waves"
)
self
.
method_cache
.
addValue
(
"program_basis_set_type"
)
# backend.addValue("program_basis_set_type", "gaussians+plane_waves")
def
onClose_section_single_configuration_calculation
(
self
,
backend
,
gIndex
,
section
):
self
.
scc_cache
.
addValue
(
"single_configuration_calculation_to_system_ref"
)
...
...
@@ -759,6 +765,12 @@ class NWChemMainParser(MainHierarchicalParser):
charge
=
groups
[
0
]
self
.
backend
.
addValue
(
"total_charge"
,
round
(
float
(
charge
)))
def
set_gaussian_basis
(
self
,
backend
,
groups
):
self
.
method_cache
[
"program_basis_set_type"
]
=
"gaussians"
def
set_plane_wave_basis
(
self
,
backend
,
groups
):
self
.
method_cache
[
"program_basis_set_type"
]
=
"plane waves"
#=======================================================================
# Misc
def
debug_end
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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