Gromacs
2024.4
|
#include <gromacs/restraint/restraintpotential.h>
Inherited by anonymous_namespace{manager.cpp}::DummyRestraint.
Interface for Restraint potentials.
Derive from this interface class to implement a restraint potential. The derived class must implement the evaluate() member function that produces a PotentialPointData instance. For various convenience functions and to decouple the internal library interface from implementations of potentials, it is expected that restraints will be programmed by subclassing gmx::RestraintPotential<> rather than gmx::IRestraintPotential.
For a set of coordinates, generate a force field according to a scalar potential that is a fun.
Potentials implemented with these classes may be long ranged and are appropriate for only a small number of particles to avoid substantial performance impact.
The indices in the above equation refer to the input and output sites specified before the simulation is started. In the current interface, the evaluate() virtual function allows an implementer to calculate the energy and force acting at the first of a pair of sites. The equal and opposite force is applied at the second site.
The potential function is evaluated with a time argument and can be updated during the simulation. For non-time-varying potentials, the time argument may still be useful for internal optimizations, such as managing cached values.
In the simplest and most common case, pairs of sites (atoms or groups) are specified by the user and then, during integration, GROMACS provides the current positions of each pair for the restraint potential to be evaluated. In such a case, the potential can be implemented by overriding evaluate().
target_link_libraries(... Gromacs::libgromacs)
in the client's CMakeLists.txt
. Public Member Functions | |
virtual PotentialPointData | evaluate (Vector r1, Vector r2, double t)=0 |
Calculate a force vector according to two input positions at a given time. More... | |
virtual void | update (gmx::Vector v, gmx::Vector v0, double t) |
Call-back hook for restraint implementations. More... | |
virtual std::vector< int > | sites () const =0 |
Find out what sites this restraint is configured to act on. More... | |
virtual void | bindSession (gmxapi::SessionResources *resources) |
Allow Session-mediated interaction with other resources or workflow elements. More... | |
|
inlinevirtual |
Allow Session-mediated interaction with other resources or workflow elements.
resources | temporary access to the resources provided by the session for additional configuration. |
A module implements this method to receive a handle to resources configured for this particular workflow element.
|
pure virtual |
Calculate a force vector according to two input positions at a given time.
If not overridden by derived class, returns a zero vector.
r1 | position of first site |
r2 | position of second site |
t | simulation time in picoseconds |
|
pure virtual |
Find out what sites this restraint is configured to act on.
|
inlinevirtual |
Call-back hook for restraint implementations.
An update function to be called on the simulation main rank/thread periodically by the Restraint framework. Receives the same input as the evaluate() method, but is only called on the main rank of a simulation to allow implementation code to be thread-safe without knowing anything about the domain decomposition.
v | position of the first site |
v0 | position of the second site |
t | simulation time |
We give the definition here because we don't want plugins to have to link against libgromacs right now (complicated header maintenance and no API stability guarantees). But once we've had plugin restraints wrap themselves in a Restraint template, we can set update = 0