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

#include <gromacs/mdtypes/forceoutput.h>

+ Collaboration diagram for gmx::ForceWithVirial:

Description

Container for force and virial for algorithms that provide their own virial tensor contribution.

Note
The force_ data member is a reference to an external force buffer.

Public Member Functions

 ForceWithVirial (ArrayRef< RVec > force, bool computeVirial)
 Constructor. More...
 
void addVirialContribution (const matrix virial)
 Adds a virial contribution. More...
 
void addVirialContribution (const RVec virial)
 Adds a virial diagonal contribution. More...
 
const matrix & getVirial () const
 Returns the accumulated virial contributions.
 

Public Attributes

const ArrayRef< RVecforce_
 Force accumulation buffer reference.
 
const bool computeVirial_
 True when algorithms are required to provide their virial contribution (for the current force evaluation)
 

Constructor & Destructor Documentation

gmx::ForceWithVirial::ForceWithVirial ( ArrayRef< RVec force,
bool  computeVirial 
)
inline

Constructor.

Parameters
[in]forceA force buffer that will be used for storing forces
[in]computeVirialTrue when algorithms are required to provide their virial contribution (for the current force evaluation)

Member Function Documentation

void gmx::ForceWithVirial::addVirialContribution ( const matrix  virial)
inline

Adds a virial contribution.

Note
Can be called with computeVirial=false.
It is recommended to accumulate the virial contributions of a module internally before calling this method, as that will reduce rounding errors.
Parameters
[in]virialThe virial contribution to add
void gmx::ForceWithVirial::addVirialContribution ( const RVec  virial)
inline

Adds a virial diagonal contribution.

Note
Can be called with computeVirial=false.
It is recommended to accumulate the virial contributions of a module internally before calling this method, as that will reduce rounding errors.
Parameters
[in]virialThe virial contribution to add

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