Lift atom type lookup out of inner loops
authorMark Abraham <mark.j.abraham@gmail.com>
Mon, 26 Jul 2021 08:31:26 +0000 (10:31 +0200)
committerArtem Zhmurov <zhmurov@gmail.com>
Thu, 5 Aug 2021 14:10:24 +0000 (14:10 +0000)
commit171e720b7b6a4daa2786d11097043d66759fe80b
treebe56aa421a104ab8aaa59cb5ec809abe42d7bad4
parentb7ddf29ed3b0fd4fb4eb8e797177ae4b1d3cc64c
Lift atom type lookup out of inner loops

Grompp loops over molecule types, looking up force parameters for each
interaction from the associated bond types for the system (e.g. from
the force field). The atom types for that interaction have to be
looked up from the atoms for the molecule type that contains it, but
this should be done only once, before considering each bond type as a
possible match. The lookups for both A- and B-state parameters are now
lifted out of the loops over bond types, simplifying the logic and
significantly improving performance.

Once that is done, one custom function could be replaced by
std::equal.

Improved some variable naming

Apply 1 suggestion(s) to 1 file(s)
src/gromacs/gmxpreprocess/toppush.cpp