Implement velocity terms for virtual sites
[alexxy/gromacs.git] / src / gromacs / mdlib / vsite.h
index 5fa0163d156f97805b3f401575b3c310d9b1fb34..b8f694711d8278bb0a2bf8366f4b879684621de5 100644 (file)
@@ -80,6 +80,15 @@ static constexpr int c_ftypeVsiteEnd = F_VSITEN + 1;
 //! Type for storing PBC atom information for all vsite types in the system
 typedef std::array<std::vector<int>, c_ftypeVsiteEnd - c_ftypeVsiteStart> VsitePbc;
 
+//! Whether we calculate vsite positions, velocities, or both
+enum class VSiteOperation
+{
+    Positions,              //!< Calculate only positions
+    Velocities,             //!< Calculate only velocities
+    PositionsAndVelocities, //!< Calculate both positions and velocities
+    Count                   //!< The number of entries
+};
+
 /*! \libinternal
  * \brief Class that handles construction of vsites and spreading of vsite forces
  */
@@ -99,12 +108,12 @@ public:
 
     /*! \brief Create positions of vsite atoms based for the local system
      *
-     * \param[in,out] x        The coordinates
-     * \param[in]     dt       The time step
-     * \param[in,out] v        When not empty, velocities for vsites are set as displacement/dt
-     * \param[in]     box      The box
+     * \param[in,out] x          The coordinates
+     * \param[in,out] v          The velocities, needed if operation requires it
+     * \param[in]     box        The box
+     * \param[in]     operation  Whether we calculate positions, velocities, or both
      */
-    void construct(ArrayRef<RVec> x, real dt, ArrayRef<RVec> v, const matrix box) const;
+    void construct(ArrayRef<RVec> x, ArrayRef<RVec> v, const matrix box, VSiteOperation operation) const;
 
     //! Tells how to handle virial contributions due to virtual sites
     enum class VirialHandling : int