Add lambda state to dhdl.xvg with AWH fep
[alexxy/gromacs.git] / src / gromacs / mdlib / energyoutput.h
index 1adbc1c8277dd4e1de42b5fb26e72957deb24cc6..54ae8b01b278139a37aa3a74bf52cae7ac09b217 100644 (file)
 
 #include <memory>
 
+#include "gromacs/math/vectypes.h"
+#include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/enerdata.h"
+#include "gromacs/topology/ifunc.h"
+#include "gromacs/utility/arrayref.h"
+#include "gromacs/utility/real.h"
 
 class energyhistory_t;
 struct ener_file;
@@ -60,7 +65,6 @@ struct gmx_mtop_t;
 struct gmx_output_env_t;
 struct pull_t;
 struct t_ebin;
-struct t_expanded;
 struct t_fcdata;
 struct t_grpopts;
 struct t_inputrec;
@@ -124,7 +128,6 @@ struct PTCouplingArrays
  * be written out to the .edr file.
  *
  * \todo Use more std containers.
- * \todo Remove GMX_CONSTRAINTVIR
  * \todo Write free-energy output also to energy file (after adding more tests)
  */
 class EnergyOutput
@@ -164,12 +167,9 @@ public:
      * \param[in] tmass             Total mass
      * \param[in] enerd             Energy data object.
      * \param[in] fep               FEP data.
-     * \param[in] expand            Expanded ensemble (for FEP).
      * \param[in] lastbox           PBC data.
      * \param[in] ptCouplingArrays  Arrays connected to pressure and temperature coupling.
      * \param[in] fep_state         The current alchemical state we are in.
-     * \param[in] svir              Constraint virial.
-     * \param[in] fvir              Force virial.
      * \param[in] vir               Total virial.
      * \param[in] pres              Pressure.
      * \param[in] ekind             Kinetic energy data.
@@ -182,12 +182,9 @@ public:
                              real                    tmass,
                              const gmx_enerdata_t*   enerd,
                              const t_lambda*         fep,
-                             const t_expanded*       expand,
                              const matrix            lastbox,
                              PTCouplingArrays        ptCouplingArrays,
                              int                     fep_state,
-                             const tensor            svir,
-                             const tensor            fvir,
                              const tensor            vir,
                              const tensor            pres,
                              const gmx_ekindata_t*   ekind,
@@ -342,14 +339,6 @@ private:
     //! Index for entalpy (pV + total energy)
     int ienthalpy_ = 0;
 
-    /*! \brief If the constraints virial should be printed.
-     * Can only be true if "GMX_CONSTRAINTVIR" environmental variable is set */
-    bool bConstrVir_ = false;
-    //! Index for constrains virial
-    int isvir_ = 0;
-    //! Index for force virial
-    int ifvir_ = 0;
-
     //! If we have pressure computed
     bool bPres_ = false;
     //! Index for total virial
@@ -410,10 +399,12 @@ private:
 
     //! The dhdl.xvg output file
     FILE* fp_dhdl_ = nullptr;
+    //! Whether the free-energy lambda moves dynamically between lambda states
+    bool haveFepLambdaMoves_;
     //! Energy components for dhdl.xvg output
     std::vector<double> dE_;
     //! The delta U components (raw data + histogram)
-    t_mde_delta_h_coll* dhc_ = nullptr;
+    std::unique_ptr<t_mde_delta_h_coll> dhc_;
     //! Temperatures for simulated tempering groups
     std::vector<real> temperatures_;