Make Constraints a proper class
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 2 Mar 2018 08:58:19 +0000 (09:58 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 5 Jun 2018 01:05:32 +0000 (03:05 +0200)
commite384d5305245eb6171ee0a299ebb92251430eb6a
treeadaa8cfc869b7d2e132e8372ae1d52868776e4af
parent073c284a6ee216acde849433eee9bd6d13124ed1
Make Constraints a proper class

Converted the opaque C struct to a pimpl-ed C++ class.

Numerous callers of constraint routines now don't have to pass
parameters that are embedded within the class at setup time,
e.g. for logging, communication, per-atom information,
performance counters.

Some of those parameters have been converted to use const references
per style, which requires various callers and callees to be modified
accordingly. In particular, the mtop utility functions that take const
pointers have been deprecated, and some temporary wrapper functions
used so that we can defer the update of code completely unrelated to
constraints until another time. Similarly, t_commrec is retained as a
pointer, since it also makes sense to change globally.

Made ConstraintVariable an enum class. This generates some compiler
warnings to force us to cover potential bug cases with fatal errors.
Used more complete names for some of the enum members.

Introduced a factory function to continue the design that constr is
nullptr when we're not using constraints.

Added some const correctness where it now became necessary.

Refs #2423

Change-Id: I7a3833489b675f30863ca37c0359cd3e950b5494
26 files changed:
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/constr.h
src/gromacs/mdlib/lincs.cpp
src/gromacs/mdlib/lincs.h
src/gromacs/mdlib/makeconstraints.h [new file with mode: 0644]
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/settle.cpp
src/gromacs/mdlib/settle.h
src/gromacs/mdlib/shake.cpp
src/gromacs/mdlib/shake.h
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/stat.cpp
src/gromacs/mdlib/tests/settle.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/gromacs/mdrun/md.cpp
src/gromacs/mdrun/minimize.cpp
src/gromacs/mdrun/runner.cpp
src/gromacs/topology/mtop_lookup.h
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/mtop_util.h