Clean up trajectory time control
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 15 Dec 2013 11:52:48 +0000 (13:52 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 20 Dec 2013 14:26:23 +0000 (15:26 +0100)
- Create a separate header for the routines defined in tcontrol.c.
  Move declarations there from statutil.h.
- Move the implementation into fileio, since that is mostly where it is
  used.

Change-Id: I59579f0bddd73d182d04c7ab160a0b547f66ebe2

src/gromacs/fileio/timecontrol.c [moved from src/gromacs/gmxlib/tcontrol.c with 95% similarity]
src/gromacs/fileio/timecontrol.h [new file with mode: 0644]
src/gromacs/fileio/trxio.c
src/gromacs/gmxlib/statutil.cpp
src/gromacs/legacyheaders/statutil.h
src/gromacs/trajectoryanalysis/runnercommon.cpp

similarity index 95%
rename from src/gromacs/gmxlib/tcontrol.c
rename to src/gromacs/fileio/timecontrol.c
index 9e6e88177926f0e6ecb7d3ec09722a329d83d81f..df2fdbdb298b7529de343407f4690eac463340a2 100644 (file)
  * And Hey:
  * GROningen Mixture of Alchemy and Childrens' Stories
  */
-#include "gromacs/legacyheaders/statutil.h"
+#include "gromacs/fileio/timecontrol.h"
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#include "typedefs.h"
-#include "gmx_fatal.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/legacyheaders/gmx_fatal.h"
 
 #include "gromacs/legacyheaders/thread_mpi/threads.h"
 
diff --git a/src/gromacs/fileio/timecontrol.h b/src/gromacs/fileio/timecontrol.h
new file mode 100644 (file)
index 0000000..6830168
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2013, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_FILEIO_TIMECONTROL_H
+#define GMX_FILEIO_TIMECONTROL_H
+
+#include "gromacs/legacyheaders/types/simple.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/* The code below is to facilitate controlled begin and end of
+ * trajectory reading.
+ */
+enum {
+    TBEGIN, TEND, TDELTA, TNR
+};
+
+gmx_bool bTimeSet(int tcontrol);
+
+real rTimeValue(int tcontrol);
+
+void setTimeValue(int tcontrol, real value);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 8b5d936b720f70fda0d31dae858336035667f147..710d1a83537d79d755b00bfdd8478a85d44765dc 100644 (file)
@@ -34,7 +34,6 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-
 #include "trxio.h"
 
 #ifdef HAVE_CONFIG_H
@@ -42,6 +41,8 @@
 #endif
 
 #include <ctype.h>
+#include <math.h>
+
 #include "sysstuff.h"
 #include "typedefs.h"
 #include "vmdio.h"
@@ -51,7 +52,6 @@
 #include "statutil.h"
 #include "gmxfio.h"
 #include "trxio.h"
-#include "gromacs/legacyheaders/statutil.h"
 #include "tpxio.h"
 #include "trnio.h"
 #include "names.h"
@@ -62,7 +62,8 @@
 #include "confio.h"
 #include "checkpoint.h"
 #include "g87io.h"
-#include <math.h>
+
+#include "gromacs/fileio/timecontrol.h"
 
 /* defines for frame counter output */
 #define SKIP1   10
index 15456054c5777284621dc0033b0b25fe8f60a631..01542b18cce99b7846e90d1070f902a4e7478376 100644 (file)
@@ -50,6 +50,7 @@
 #include "network.h"
 
 #include "gromacs/commandline/wman.h"
+#include "gromacs/fileio/timecontrol.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/programinfo.h"
index df759a6e9fe4621964e6d26bf08b56a9c2797d8b..e533d7f405f0df9a3e5736e777da6b2e8e827734 100644 (file)
@@ -47,23 +47,6 @@ extern "C" {
 }
 #endif
 
-
-/* The code below is to facilitate controlled begin and end of
-   trajectory reading. Corresponding routines in
-   src/gmxlib/tcontrol.c
- */
-enum {
-    TBEGIN, TEND, TDELTA, TNR
-};
-
-gmx_bool bTimeSet(int tcontrol);
-
-real rTimeValue(int tcontrol);
-
-void setTimeValue(int tcontrol, real value);
-
-/* End trajectory time control */
-
 /* LEGACY FUNCTIONS
 
    The program names, command lines, etc. are now also set in the output_env
index fa12be6c9d8489cde91d631105e718f630ec1a51..e42857bbd5df40b6a7415514b6824ee78010b068 100644 (file)
@@ -51,9 +51,9 @@
 #include "gromacs/legacyheaders/rmpbc.h"
 #include "gromacs/legacyheaders/smalloc.h"
 #include "gromacs/legacyheaders/statutil.h"
+#include "gromacs/fileio/timecontrol.h"
 #include "gromacs/fileio/tpxio.h"
 #include "gromacs/fileio/trxio.h"
-#include "gromacs/legacyheaders/statutil.h"
 #include "gromacs/legacyheaders/vec.h"
 
 #include "gromacs/options/basicoptions.h"