Added pull geometry direction-relative
[alexxy/gromacs.git] / src / gromacs / fileio / tpxio.c
index 84cb9d478ea9026bad0e47be048b6bdd35cd0ff9..e3defd42f6eaea46bce8de1678738e0297710fe1 100644 (file)
@@ -91,7 +91,8 @@ enum tpxv {
     tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, /**< potentials for supporting coarse-grained force fields */
     tpxv_InteractiveMolecularDynamics,                       /**< interactive molecular dynamics (IMD) */
     tpxv_RemoveObsoleteParameters1,                          /**< remove optimize_fft, dihre_fc, nstcheckpoint */
-    tpxv_PullCoordTypeGeom                                   /**< add pull type and geometry per group and flat-bottom */
+    tpxv_PullCoordTypeGeom,                                  /**< add pull type and geometry per group and flat-bottom */
+    tpxv_PullGeomDirRel                                      /**< add pull geometry direction-relative */
 };
 
 /*! \brief Version number of the file format written to run input
@@ -105,7 +106,7 @@ enum tpxv {
  *
  * When developing a feature branch that needs to change the run input
  * file format, change tpx_tag instead. */
-static const int tpx_version = tpxv_PullCoordTypeGeom;
+static const int tpx_version = tpxv_PullGeomDirRel;
 
 
 /* This number should only be increased when you edit the TOPOLOGY section
@@ -299,6 +300,11 @@ static void do_pull_coord(t_fileio *fio, t_pull_coord *pcrd, int file_version,
     {
         gmx_fio_do_int(fio,  pcrd->eType);
         gmx_fio_do_int(fio,  pcrd->eGeom);
+        if (pcrd->eGeom == epullgDIRRELATIVE)
+        {
+            gmx_fio_do_int(fio, pcrd->group[2]);
+            gmx_fio_do_int(fio, pcrd->group[3]);
+        }
         gmx_fio_do_ivec(fio, pcrd->dim);
     }
     else