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

#include <gromacs/mdlib/vsite.h>

Description

Class that handles construction of vsites and spreading of vsite forces.

Public Types

enum  VirialHandling : int { VirialHandling::None, VirialHandling::Pbc, VirialHandling::NonLinear }
 Tells how to handle virial contributions due to virtual sites. More...
 

Public Member Functions

 VirtualSitesHandler (const gmx_mtop_t &mtop, gmx_domdec_t *domdec, PbcType pbcType, ArrayRef< const RangePartitioning > updateGroupingPerMoleculeType)
 Constructor, used only be the makeVirtualSitesHandler() factory function.
 
int numInterUpdategroupVirtualSites () const
 Returns the number of virtual sites acting over multiple update groups.
 
void setVirtualSites (ArrayRef< const InteractionList > ilist, int numAtoms, int homenr, ArrayRef< const ParticleType > ptype)
 Set VSites and distribute VSite work over threads, should be called after each DD partitioning.
 
void construct (ArrayRef< RVec > x, ArrayRef< RVec > v, const matrix box, VSiteOperation operation) const
 Create positions of vsite atoms based for the local system. More...
 
void spreadForces (ArrayRef< const RVec > x, ArrayRef< RVec > f, VirialHandling virialHandling, ArrayRef< RVec > fshift, matrix virial, t_nrnb *nrnb, const matrix box, gmx_wallcycle *wcycle)
 Spread the force operating on the vsite atoms on the surrounding atoms. More...
 

Member Enumeration Documentation

Tells how to handle virial contributions due to virtual sites.

Enumerator
None 

Do not compute virial contributions.

Pbc 

Add contributions working over PBC to shift forces.

NonLinear 

Compute contributions due to non-linear virtual sites.

Member Function Documentation

void gmx::VirtualSitesHandler::construct ( ArrayRef< RVec x,
ArrayRef< RVec v,
const matrix  box,
VSiteOperation  operation 
) const

Create positions of vsite atoms based for the local system.

Parameters
[in,out]xThe coordinates
[in,out]vThe velocities, needed if operation requires it
[in]boxThe box
[in]operationWhether we calculate positions, velocities, or both
void gmx::VirtualSitesHandler::spreadForces ( ArrayRef< const RVec x,
ArrayRef< RVec f,
VirialHandling  virialHandling,
ArrayRef< RVec fshift,
matrix  virial,
t_nrnb *  nrnb,
const matrix  box,
gmx_wallcycle *  wcycle 
)

Spread the force operating on the vsite atoms on the surrounding atoms.

vsite should point to a valid object. The virialHandling parameter determines how virial contributions are handled. If this is set to Linear, shift forces are accumulated into fshift. If this is set to NonLinear, non-linear contributions are added to virial. This non-linear correction is required when the virial is not calculated afterwards from the particle position and forces, but in a different way, as for instance for the PME mesh contribution.


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