Gromacs
2025.0-dev-20241011-013a99c
|
#include <gromacs/mdtypes/forceoutput.h>
Container for force and virial for algorithms that compute shift forces for virial calculation.
This force output class should be used when computing forces whos virial contribution is computed using the "single sum virial" algorithm (see the reference manual for details). To handle the virial contributions of forces working between periodic images correctly, so-called "shift forces" need to be accumulated for the different periodic images.
Public Member Functions | |
ForceWithShiftForces (const gmx::ArrayRefWithPadding< gmx::RVec > &force, const bool computeVirial, const gmx::ArrayRef< gmx::RVec > &shiftForces) | |
Constructor. More... | |
gmx::ArrayRef< gmx::RVec > | force () |
Returns an arrayref to the force buffer without padding. | |
gmx::ArrayRef< const gmx::RVec > | force () const |
Returns a const arrayref to the force buffer without padding. | |
bool | computeVirial () const |
Returns whether the virial needs to be computed. | |
gmx::ArrayRef< gmx::RVec > | shiftForces () |
Returns the shift forces buffer. | |
gmx::ArrayRef< const gmx::RVec > | shiftForces () const |
Returns a const shift forces buffer. | |
bool & | haveSpreadVsiteForces () |
Returns a reference to the boolean which tells whether we have spread forces on vsites. | |
|
inline |
Constructor.
[in] | force | A force buffer that will be used for storing forces |
[in] | computeVirial | True when algorithms are required to provide their virial contribution (for the current force evaluation) |
[in] | shiftForces | A shift forces buffer of size c_numShiftVectors, only used with computeVirial = true |