Introduce helper classes for force provider input and output
commit960bfd69121d9e4de6949507e7030723fe72b8be
authorCarsten Kutzner <ckutzne@gwdg.de>
Fri, 1 Dec 2017 11:00:32 +0000 (1 12:00 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 10 May 2018 12:45:37 +0000 (10 14:45 +0200)
tree14bb20f2f29e7143dfe4961f2b46a05e74d7dea5
parente9179a6aa0a68e5fc0d6092ea61810fd0c3540ac
Introduce helper classes for force provider input and output

This patch introduces two structs, ForceProviderInput and ForceProviderOutput,
which are used for calling IForceProvider::calculateForces(). These structs
are meant to be short-lived containers only: they just bundle up pointers to
data needed by the force providers and then directly go out of scope again after
the call to calculateForces().

The advantage of assembling all input and output data for a force provider into
two containers is that the signature of the calculateForces() method does not
need to change (again) if someone comes up with a new force provider that needs
additional input or output.

As suggested by Mark and Teemu in https://gerrit.gromacs.org/#/c/6637/

Change-Id: Ib1a076293acd963c995477cb847a7a2d8708f4c3
src/gromacs/applied-forces/electricfield.cpp
src/gromacs/applied-forces/tests/electricfield.cpp
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdtypes/iforceprovider.cpp
src/gromacs/mdtypes/iforceprovider.h