Gromacs  2023.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
gmx::Site Class Reference

#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...
Siteoperator= (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...

Constructor & Destructor Documentation

gmx::Site::Site ( int  globalIndex)

Construct from global atom indices.

globalIndexAtom index in the global state (as input to the simulation)
gmx::Site::Site ( const Site site)

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.

Member Function Documentation

RVec gmx::Site::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.

crCommunications record.
nxNumber of locally available atoms (size of local atom data arrays)
xArray of locally available atom coordinates.
tthe current time.
position vector.
int gmx::Site::index ( ) const

Get the global atom index of an atomic site.

global index provided at construction.
Site& gmx::Site::operator= ( const 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.

The documentation for this class was generated from the following file: