Feature/water_models#223
Conversation
…ation accordingly
…ms in hybrid calculations
…tParser and update related tests
… dftbplus and pyscf
…bomole_rimp2 script
…y in DFTBPlusRunner and TurbomoleRunner
There was a problem hiding this comment.
Pull request overview
This PR introduces dedicated water-model handling to address Issue #3 (water intermolecular interactions) and Issue #4 (water intramolecular interactions), primarily targeting SPC/Fw variants, and updates parsing/tests and a few supporting components to integrate the new model selection and behavior.
Changes:
- Add an
InterWatermodule (strategy-based) and wire it into the build. - Update input parsing/tests to consolidate MM-related parsing and add support for a Turbomole template keyword.
- Adjust virial APIs for const-correctness and add/extend tests (moldescriptor optional water type, hybrid zone edge case).
Reviewed changes
Copilot reviewed 106 out of 106 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/src/input/testMoldescriptorReader.cpp | Adds coverage for optional waterType default state before reading the moldescriptor. |
| tests/src/input/inputFileParsing/testNonCoulombParser.cpp | Removes standalone noncoulomb parser test (moved into MM parser tests). |
| tests/src/input/inputFileParsing/testMMParser.cpp | Consolidates MM parsing tests (force-field + noncoulomb) under MMInputParser. |
| tests/src/input/inputFileParsing/testFilesParser.cpp | Adds test coverage for turbomole_file parsing and file existence behavior. |
| tests/src/input/inputFileParsing/CMakeLists.txt | Updates test sources to use testMMParser.cpp instead of older split tests. |
| tests/src/hybridConfigurator/testHybridConfigurator.cpp | Adds an edge-case test for zero core radius hybrid zone assignment. |
| tests/data/turbomoleReader/tm_define.template | Adds a Turbomole template fixture used by parsing/tests. |
| tests/data/inputFileReader/keywordList.txt | Updates keyword list to include turbomole_file and water/noncoulomb-related keywords. |
| src/waterModels/inter/interWater.cpp | Introduces InterWater dispatcher implementation, including cutoff initialization and strategy forwarding. |
| src/waterModels/inter/CMakeLists.txt | Adds a new interWater library target and its link/include configuration. |
| src/virial/virial.cpp | Makes virial calculation methods const (object constness) and keeps shift-force handling. |
| src/virial/molecularVirial.cpp | Adds a const, side-effect-free intramolecular virial correction tensor method. |
| src/simulationBox/simulationBox_standardMethods.cpp | Switches water/ammonia type getters to std::optional<size_t> and updates includes/usings. |
Comments suppressed due to low confidence (1)
tests/src/input/inputFileParsing/testMMParser.cpp:78
- This test comment lists noncoulomb options as "none", "lj" and "buck", but the parser/test now supports "guff" and "morse" (and does not support "none"). Keeping the comment accurate helps prevent confusion when maintaining the parser/tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… missing in the github suggestion
a34d2c4 to
c01427e
Compare
|
@97gamjak
|
ca063de to
7b8dd40
Compare
The inter-water cell-list kernel classifies every atom as O or H with atom->getName() == "O" per atom per pair, and the general kernels read atom->getPosition() per atom per pair. Both getters returned by value and were defined out-of-line, so each call was a copy across the library boundary (no cross-library inlining without LTO, which is off by default). CellList::getCells() and Cell::getNeighbourCells() additionally returned their vectors by value, deep-copying the whole cell list on every access. Return these by const reference and inline them in the headers: - Atom::getName(), Atom::getPosition() - CellList::getCells(), Cell::getNeighbourCells() Results are unchanged (the inter-water benchmark energy is byte-identical and the full test suite passes); the inter-water cell-list kernel drops ~22% of its instruction count, and the change benefits every per-atom-pair loop in the engine. Adds benchmarks/perf/interWater.cpp, a fixed-work micro-benchmark of the inter-water cell-list kernel (the water path previously had no perf-gate coverage).
|
@ape33 I pushed a performance commit ( What it does: the inter-water cell-list kernel classifies every atom as O/H with Effect: results unchanged (benchmark energy byte-identical, full test suite green); the inter-water cell-list kernel drops ~22% of its instruction count, and it helps every per-atom-pair loop in the engine. I also added One gotcha worth flagging for the water model: I tried a bigger win — computing one minimum-image shift per water molecule pair instead of per atom pair ( Next candidates if useful: inline the remaining out-of-line hot getters ( |
|
@galjos |
Move the trivial bodies of Atom::addForce/addShiftForce/getPartialCharge, Molecule::isActive/getMoltype and Cell::getMolecule/getAtoms into the headers. They are called per atom / per atom pair in the intermolecular cell-list loops and were out-of-line, so each was a call across the library boundary (no cross-library inlining with LTO off). Results are unchanged (inter-water benchmark energy byte-identical, full test suite passes); the inter-water cell-list kernel drops a further ~11% of its instruction count, ~31% below the original.
|
@galjos |

This PR solves issue #3 and issue #4