Gromacs
2024.3
|
#include <gromacs/restraint/restraintmdmodule_impl.h>
Abstraction for a restraint interaction site.
A restraint may operate on a single atom or some other entity, such as a selection of atoms. The Restraint implementation is very independent from how coordinates are provided or what they mean.
First implementation can only represent single atoms in a global context.
Ultimately, this should be replaced with a more universal facility for acting on distributed atom data or simple transformations thereof.
Public Member Functions | |
Site (int globalIndex) | |
Construct from global atom indices. More... | |
Site (const Site &site) | |
Explicitly define copies. More... | |
Site & | operator= (const Site &)=delete |
Disallow assignment. More... | |
int | index () const |
Get the global atom index of an atomic site. More... | |
RVec | centerOfMass (const t_commrec &cr, size_t nx, ArrayRef< const RVec > x, double gmx_unused t) |
Get the position of this site at time t. More... | |
|
inlineexplicit |
Construct from global atom indices.
globalIndex | Atom index in the global state (as input to the simulation) |
|
inline |
Explicitly define copies.
Implicit definition is not possible because of the mutex member, and a copy constructor is necessary to use Site in a std::vector. Really, we should make a copy point to the same implementation object to reuse its cache.
|
inline |
Get the position of this site at time t.
cr | Communications record. |
nx | Number of locally available atoms (size of local atom data arrays) |
x | Array of locally available atom coordinates. |
t | the current time. |
By providing the current time, we can cache results in order to use them once per timestep. In the long term, we would prefer to also allow client code to preregister interest in a position at a given time, or issue "futures".
|
inline |
Get the global atom index of an atomic site.
Disallow assignment.
Assignment doesn't make sense because it implies that a site's meaning is fuzzy. If the definition of a site is changing, just make a new site. There's nothing to be gained by reusing one or by creating it uninitialized.