Move pull code to separate subdirectory
authorCarsten Kutzner <ckutzne@gwdg.de>
Mon, 13 Jan 2014 10:53:49 +0000 (11:53 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 13 Jan 2014 19:06:29 +0000 (20:06 +0100)
Another part of #1415 Get rid of legacy headers.

Other changes:
- updated pulling-related include guards to new format
- updated documentation for doxygen
- updated .h includes
- uncrustified pull.h and pull_rotation.h
- updated copyright year for all files touched by this commit

Change-Id: Ief1ed3543b84f651d1bff01f1952b342850f5c22

17 files changed:
src/gromacs/CMakeLists.txt
src/gromacs/gmxpreprocess/readpull.c
src/gromacs/legacyheaders/mdrun.h
src/gromacs/legacyheaders/pull.h [deleted file]
src/gromacs/legacyheaders/update.h
src/gromacs/mdlib/constr.c
src/gromacs/mdlib/domdec.c
src/gromacs/mdlib/sim_util.c
src/gromacs/mdlib/update.c
src/gromacs/pulling/CMakeLists.txt [new file with mode: 0644]
src/gromacs/pulling/pull.c [moved from src/gromacs/mdlib/pull.c with 99% similarity]
src/gromacs/pulling/pull.h [new file with mode: 0644]
src/gromacs/pulling/pull_rotation.c [moved from src/gromacs/mdlib/pull_rotation.c with 99% similarity]
src/gromacs/pulling/pull_rotation.h [moved from src/gromacs/legacyheaders/pull_rotation.h with 53% similarity]
src/gromacs/pulling/pullutil.c [moved from src/gromacs/mdlib/pullutil.c with 99% similarity]
src/programs/mdrun/md.c
src/programs/mdrun/runner.c

index cae997f4e6adb37ae24f1c973c1f8064c687a1aa..378af42d21c56f77c161a816c7a286ca5b20d7f3 100644 (file)
@@ -58,6 +58,7 @@ add_subdirectory(timing)
 add_subdirectory(utility)
 add_subdirectory(fileio)
 add_subdirectory(essentialdynamics)
+add_subdirectory(pulling)
 if (NOT GMX_BUILD_MDRUN_ONLY)
     add_subdirectory(legacyheaders)
     add_subdirectory(gmxana)
index 6bec3ca392bbb4bfda48942db43feb0009cb8ee3..b4ba14531295a4bdf7aa1a7ce1540a32bec5ff91 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014 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.
@@ -56,7 +56,7 @@
 #include <string.h>
 #include "mdatoms.h"
 #include "pbc.h"
-#include "pull.h"
+#include "gromacs/pulling/pull.h"
 
 
 static char pulldim[STRLEN];
index 51c370f08a9fdaff0cd1c697b21a0c767f0f77ab..013a266beee56d393967adfc45d1fa27928d8150 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -49,7 +49,6 @@
 #include "mdebin.h"
 #include "vcm.h"
 #include "vsite.h"
-#include "pull.h"
 #include "update.h"
 #include "types/membedt.h"
 #include "types/globsig.h"
diff --git a/src/gromacs/legacyheaders/pull.h b/src/gromacs/legacyheaders/pull.h
deleted file mode 100644 (file)
index 7492d92..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * 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 _pull_h
-#define _pull_h
-
-#include "vec.h"
-#include "typedefs.h"
-#include "../fileio/filenm.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* This file contains datatypes and function declarations necessary
-   for mdrun to interface with the pull code */
-
-/* Get the distance to the reference and deviation for pull coord coord_ind */
-void get_pull_coord_distance(const t_pull *pull,
-                             int coord_ind,
-                             const t_pbc *pbc, double t,
-                             dvec dr, double *dev);
-
-/* Set the all the pull forces to zero */
-void clear_pull_forces(t_pull *pull);
-
-/* Determine the COM pull forces and add them to f, return the potential */
-real pull_potential(int ePull, t_pull *pull, t_mdatoms *md, t_pbc *pbc,
-                    t_commrec *cr, double t, real lambda,
-                    rvec *x, rvec *f, tensor vir, real *dvdlambda);
-
-/* Constrain the coordinates xp in the directions in x
- * and also constrain v when v!=NULL.
- */
-void pull_constraint(t_pull *pull, t_mdatoms *md, t_pbc *pbc,
-                     t_commrec *cr, double dt, double t,
-                     rvec *x, rvec *xp, rvec *v, tensor vir);
-
-/* Make a selection of the home atoms for all pull groups.
- * Should be called at every domain decomposition.
- */
-void dd_make_local_pull_groups(gmx_domdec_t *dd,
-                               t_pull *pull, t_mdatoms *md);
-
-/* get memory and initialize the fields of pull that still need it, and
-   do runtype specific initialization */
-void init_pull(FILE              *fplog,
-               t_inputrec        *ir,       /* the inputrec */
-               int                nfile,
-               const t_filenm     fnm[],    /* standard filename struct */
-               gmx_mtop_t        *mtop,     /* the topology of the whole system */
-               t_commrec        * cr,       /* struct for communication info */
-               const output_env_t oenv,     /* output options */
-               real               lambda,   /* FEP lambda */
-               gmx_bool           bOutFile, /* open output files */
-               unsigned long      Flags);
-
-/* Close the pull output files */
-void finish_pull(t_pull *pull);
-
-/* Print the pull output (x and/or f) */
-void pull_print_output(t_pull *pull, gmx_int64_t step, double time);
-
-/* In pullutil.c */
-
-/* Calculates centers of mass all pull groups */
-void pull_calc_coms(t_commrec *cr,
-                    t_pull    *pull, /* the pull group */
-                    t_mdatoms *md,   /* all atoms */
-                    t_pbc     *pbc,
-                    double     t,    /* only used for cylinder ref. */
-                    rvec       x[],  /* local coordinates */
-                    rvec      *xp    /* updated x, can be NULL */
-                    );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 613d1231359bf32c7c5bce102781f0cd681ea4aa..9ebaeeaca52e0814354f7d6a448cac9a8abbe4a4 100644 (file)
@@ -42,8 +42,9 @@
 #include "mshift.h"
 #include "tgroup.h"
 #include "network.h"
-#include "pull.h"
 #include "gmx_random.h"
+#include "vec.h"
+
 
 #ifdef __cplusplus
 extern "C" {
index e73e77d274c429062eeb107eaa621305fc107192..f0d6f242a32f3b7024a19b3bbbbaae95527605fd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -59,6 +59,7 @@
 #include "macros.h"
 #include "gmx_omp_nthreads.h"
 #include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/pulling/pull.h"
 
 
 typedef struct gmx_constr {
index da45b8f573fff3b2230921e3d39ab641801ee20c..fca780fc8005d986064423710be1f63bfccbdfe4 100644 (file)
@@ -57,8 +57,6 @@
 #include "names.h"
 #include "force.h"
 #include "pme.h"
-#include "pull.h"
-#include "pull_rotation.h"
 #include "mdrun.h"
 #include "nsgrid.h"
 #include "shellfc.h"
@@ -76,6 +74,8 @@
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/qsort_threadsafe.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/pulling/pull_rotation.h"
 
 #define DDRANK(dd, rank)    (rank)
 #define DDMASTERRANK(dd)   (dd->masterrank)
index 3ae2e92c55551716065f592bfaa0d94b03456dd5..d33ba4a1fa42ae77e5efd2c7fa86841dd92bdbf3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -70,7 +70,6 @@
 #include "constr.h"
 #include "xvgr.h"
 #include "copyrite.h"
-#include "pull_rotation.h"
 #include "gmx_random.h"
 #include "domdec.h"
 #include "partdec.h"
@@ -86,6 +85,8 @@
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/pulling/pull_rotation.h"
 
 #include "adress.h"
 #include "qmmm.h"
index 06ea1fec250ab1991d47ef0753e34de0160c4e9f..249d1d2ecd204a45e1acdb9124d3ccc9aaa1c0b6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -60,7 +60,6 @@
 #include "txtdump.h"
 #include "mdrun.h"
 #include "constr.h"
-#include "pull.h"
 #include "disre.h"
 #include "orires.h"
 #include "gmx_omp_nthreads.h"
@@ -69,6 +68,7 @@
 #include "gromacs/fileio/futil.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/gmxomp.h"
+#include "gromacs/pulling/pull.h"
 
 /*For debugging, start at v(-dt/2) for velolcity verlet -- uncomment next line */
 /*#define STARTFROMDT2*/
diff --git a/src/gromacs/pulling/CMakeLists.txt b/src/gromacs/pulling/CMakeLists.txt
new file mode 100644 (file)
index 0000000..1938731
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2014, 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.
+
+file(GLOB PULLING_SOURCES *.cpp *.c)
+set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PULLING_SOURCES} PARENT_SCOPE)
+
+if (BUILD_TESTING)
+#    add_subdirectory(tests)
+endif (BUILD_TESTING)
similarity index 99%
rename from src/gromacs/mdlib/pull.c
rename to src/gromacs/pulling/pull.c
index a63733e537404ff12444595da877b3cf1db67b02..ab96a3a909688458d07e563cb0e216cd3b1a5068 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
@@ -61,6 +61,7 @@
 #include "gmx_ga2la.h"
 #include "copyrite.h"
 #include "macros.h"
+#include "vec.h"
 
 static void pull_print_group_x(FILE *out, ivec dim, const t_pull_group *pgrp)
 {
diff --git a/src/gromacs/pulling/pull.h b/src/gromacs/pulling/pull.h
new file mode 100644 (file)
index 0000000..4ef61ba
--- /dev/null
@@ -0,0 +1,200 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014, 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.
+ */
+
+/*! \libinternal \file
+ *
+ *
+ * \brief
+ * This file contains datatypes and function declarations necessary
+   for mdrun to interface with the pull code.
+ *
+ * \author Berk Hess
+ *
+ * \inlibraryapi
+ */
+
+#ifndef GMX_PULLING_PULL_H
+#define GMX_PULLING_PULL_H
+
+#include "typedefs.h"
+#include "../fileio/filenm.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/*! \brief Get the distance to the reference and deviation for pull coord coord_ind.
+ *
+ * \param[in]  pull         The pull group.
+ * \param[in]  coord_ind    Number of the pull coordinate.
+ * \param[in]  pbc          Information structure about periodicity.
+ * \param[in]  t            Time.
+ * \param[out] dr           The pull coordinate difference vector.
+ * \param[out] dev          The deviation from the reference distance.
+ */
+void get_pull_coord_distance(const t_pull *pull,
+                             int coord_ind,
+                             const t_pbc *pbc, double t,
+                             dvec dr, double *dev);
+
+
+/*! \brief Set the all the pull forces to zero.
+ *
+ * \param pull              The pull group.
+ */
+void clear_pull_forces(t_pull *pull);
+
+
+/*! \brief Determine the COM pull forces and add them to f, return the potential
+ *
+ * \param[in] ePull      Enum defining the type of pulling: umbrella, const force, ...
+ * \param[in] pull       The pull group.
+ * \param[in] md         All atoms.
+ * \param[in] pbc        Information struct about periodicity.
+ * \param[in] cr         Struct for communication info.
+ * \param[in] t          Time.
+ * \param[in] lambda     The value of lambda in FEP calculations.
+ * \param[in] x          Positions.
+ * \param[in] f          Forces.
+ * \param[in,out] vir    The virial, which, if != NULL, gets a pull correction.
+ * \param[out] dvdlambda Pull contribution to dV/d(lambda).
+ *
+ * \returns The pull potential energy.
+ */
+real pull_potential(int ePull, t_pull *pull, t_mdatoms *md, t_pbc *pbc,
+                    t_commrec *cr, double t, real lambda,
+                    rvec *x, rvec *f, tensor vir, real *dvdlambda);
+
+
+/*! \brief Constrain the coordinates xp in the directions in x
+ * and also constrain v when v != NULL.
+ *
+ * \param[in] pull       The pull group.
+ * \param[in] md         All atoms.
+ * \param[in] pbc        Information struct about periodicity.
+ * \param[in] cr         Struct for communication info.
+ * \param[in] dt         The time step length.
+ * \param[in] t          The time.
+ * \param[in] x          Positions.
+ * \param[in,out] xp     Updated x, can be NULL.
+ * \param[in,out] v      Velocities, which may get a pull correction.
+ * \param[in,out] vir    The virial, which, if != NULL, gets a pull correction.
+ */
+void pull_constraint(t_pull *pull, t_mdatoms *md, t_pbc *pbc,
+                     t_commrec *cr, double dt, double t,
+                     rvec *x, rvec *xp, rvec *v, tensor vir);
+
+
+/*! \brief Make a selection of the home atoms for all pull groups.
+ * Should be called at every domain decomposition.
+ *
+ * \param dd             Structure containing domain decomposition data.
+ * \param pull           The pull group.
+ * \param md             All atoms.
+ */
+void dd_make_local_pull_groups(gmx_domdec_t *dd,
+                               t_pull *pull, t_mdatoms *md);
+
+
+/*! \brief Get memory and initialize the fields of pull that still need it, and
+ * do runtype specific initialization.
+ *
+ * \param fplog      General output file, normally md.log.
+ * \param ir         The inputrec.
+ * \param nfile      Number of files.
+ * \param fnm        Standard filename struct.
+ * \param mtop       The topology of the whole system.
+ * \param cr         Struct for communication info.
+ * \param oenv       Output options.
+ * \param lambda     FEP lambda.
+ * \param bOutFile   Open output files?
+ * \param Flags      Flags passed over from main, used to determine
+ *                   whether or not we are appending.
+ */
+void init_pull(FILE              *fplog,
+               t_inputrec        *ir,
+               int                nfile,
+               const t_filenm     fnm[],
+               gmx_mtop_t        *mtop,
+               t_commrec        * cr,
+               const output_env_t oenv,
+               real               lambda,
+               gmx_bool           bOutFile,
+               unsigned long      Flags);
+
+
+/*! \brief Close the pull output files.
+ *
+ * \param pull       The pull group.
+ */
+void finish_pull(t_pull *pull);
+
+
+/*! \brief Print the pull output (x and/or f)
+ *
+ * \param pull     The pull group.
+ * \param step     Time step number.
+ * \param time     Time.
+ */
+void pull_print_output(t_pull *pull, gmx_int64_t step, double time);
+
+
+/*! \brief Calculates centers of mass all pull groups.
+ *
+ * \param[in] cr       Struct for communication info.
+ * \param[in] pull     The pull group.
+ * \param[in] md       All atoms.
+ * \param[in] pbc      Information struct about periodicity.
+ * \param[in] t        Time, only used for cylinder ref.
+ * \param[in] x        The local positions.
+ * \param[in,out] xp   Updated x, can be NULL.
+ *
+ */
+void pull_calc_coms(t_commrec *cr,
+                    t_pull    *pull,
+                    t_mdatoms *md,
+                    t_pbc     *pbc,
+                    double     t,
+                    rvec       x[],
+                    rvec      *xp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
similarity index 99%
rename from src/gromacs/mdlib/pull_rotation.c
rename to src/gromacs/pulling/pull_rotation.c
index aaef3d70fcbc02ab0f9b0f2078b0176fd3a7f972..edd84a4f3ebb3796b0a6062912b22cc080bd6cad 100644 (file)
@@ -54,8 +54,6 @@
 #include "vec.h"
 #include "gmx_ga2la.h"
 #include "xvgr.h"
-#include "groupcoord.h"
-#include "pull_rotation.h"
 #include "copyrite.h"
 #include "macros.h"
 
@@ -65,6 +63,8 @@
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/qsort_threadsafe.h"
+#include "gromacs/pulling/pull_rotation.h"
+#include "gromacs/mdlib/groupcoord.h"
 
 static char *RotStr = {"Enforced rotation:"};
 
similarity index 53%
rename from src/gromacs/legacyheaders/pull_rotation.h
rename to src/gromacs/pulling/pull_rotation.h
index 492e527687defee80683d3ca405216277a43f0ba..e7d1cfd1c465c415a7a29fef8672339a8fbfec2a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-/*! \file pull_rotation.h
+/*! \libinternal \file
  *
- *  @brief Enforced rotation of protein parts or other groups of particles.
+ * \brief
+ * Declares functions to enforce rotational motion upon a group of particles.
  *
- *  This file contains routines that are used to enforce rotational motion
- *  upon a subgroup of particles.
+ * \author Carsten Kutzner <ckutzne@gwdg.de>
  *
+ * \inlibraryapi
  */
 
-#ifndef _pull_rotation_h
-#define _pull_rotation_h
+#ifndef GMX_PULLING_PULL_ROTATION_H
+#define GMX_PULLING_PULL_ROTATION_H
 
-#include "vec.h"
 #include "typedefs.h"
+#include "../fileio/filenm.h"
 
 
 #ifdef __cplusplus
@@ -56,25 +57,25 @@ extern "C" {
 #endif
 
 
-/*! \brief Initialize the enforced rotation groups.
+/*! \brief Initializes the enforced rotation groups.
  *
  * This routine does the memory allocation for various helper arrays, opens
  * the output files etc.
  *
- * \param fplog             General output file, normally md.log.
- * \param ir                Struct containing MD input parameters, among those
- *                          also the enforced rotation parameters.
- * \param nfile             Number of entries in the fnm structure.
- * \param fnm               The filenames struct containing also the names
- *                          of the rotation output files.
- * \param cr                Pointer to MPI communication data.
- * \param x                 The positions of all MD particles.
- * \param box               The simulation box.
- * \param mtop              Molecular topology.
- * \param oenv              Needed to open the rotation output xvgr file.
- * \param bVerbose          Whether to print extra status information.
- * \param Flags             Flags passed over from main, used to determine
- *                          whether or not we are doing a rerun.
+ * \param fplog    General output file, normally md.log.
+ * \param ir       Struct containing MD input parameters, among those
+ *                 also the enforced rotation parameters.
+ * \param nfile    Number of entries in the fnm structure.
+ * \param fnm      The filenames struct containing also the names
+ *                 of the rotation output files.
+ * \param cr       Pointer to MPI communication data.
+ * \param x        The positions of all MD particles.
+ * \param box      The simulation box.
+ * \param mtop     Molecular topology.
+ * \param oenv     Needed to open the rotation output xvgr file.
+ * \param bVerbose Whether to print extra status information.
+ * \param Flags    Flags passed over from main, used to determine
+ *                 whether or not we are doing a rerun.
  */
 extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[],
                      t_commrec *cr, rvec *x, matrix box, gmx_mtop_t *mtop, const output_env_t oenv,
@@ -83,31 +84,31 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
 
 /*! \brief Make a selection of the home atoms for all enforced rotation groups.
  *
- * This routine is similar to dd_make_local_pull_groups, but works only with
+ * This routine is similar to \ref dd_make_local_pull_groups, but works only with
  * domain decomposition. It should be called at every domain decomposition.
  *
- * \param dd                Structure containing domain decomposition data.
- * \param rot               Pointer to all the enforced rotation data.
+ * \param dd      Structure containing domain decomposition data.
+ * \param rot     Pointer to all the enforced rotation data.
  */
 extern void dd_make_local_rotation_groups(gmx_domdec_t *dd, t_rot *rot);
 
 
-/*! \brief Calculation of the enforced rotation potential.
+/*! \brief Calculates the enforced rotation potential(s).
  *
  * This is the main enforced rotation module which is called during every time
  * step. Here the rotation potential as well as the resulting forces are
  * calculated.
  *
- * \param cr                Pointer to MPI communication data.
- * \param ir                Struct containing MD input parameters, among those
- * \param box               Simulation box, needed to make group whole.
- * \param x                 The positions of all the local particles.
- * \param t                 Time.
- * \param step              The time step.
- * \param wcycle            During the potential calculation the wallcycles are
- *                          counted. Later they enter the dynamic load balancing.
- * \param bNS               After domain decomposition / neighborsearching several
- *                          local arrays have to be updated (masses, shifts)
+ * \param cr      Pointer to MPI communication data.
+ * \param ir      Struct containing MD input parameters, among those
+ * \param box     Simulation box, needed to make group whole.
+ * \param x       The positions of all the local particles.
+ * \param t       Time.
+ * \param step    The time step.
+ * \param wcycle  During the potential calculation the wallcycles are
+ *                counted. Later they enter the dynamic load balancing.
+ * \param bNS     After domain decomposition / neighbor searching several
+ *                local arrays have to be updated (masses, shifts)
  */
 extern void do_rotation(t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], real t,
                         gmx_int64_t step, gmx_wallcycle_t wcycle, gmx_bool bNS);
@@ -117,24 +118,25 @@ extern void do_rotation(t_commrec *cr, t_inputrec *ir, matrix box, rvec x[], rea
  *
  * Adds the forces from enforced rotation potential to the local forces and
  * sums up the contributions to the rotation potential from all the nodes. Since
- * this needs communication, this routine should be called after the SR forces
- * have been evaluated (in order not to spoil cycle counts).
- * This routine also outputs data to the various rotation output files (e.g.
- * the potential, the angle of the group, torques and more).
- *
- * \param rot               Pointer to all the enforced rotation data.
- * \param f                 The local forces to which the rotational forces have
- *                          to be added.
- * \param cr                Pointer to MPI communication data.
- * \param step              The time step, used for output.
- * \param t                 Time, used for output.
+ * this needs communication, this routine should be called after the short range
+ * forces have been evaluated (in order not to spoil cycle counts).
+ * This routine also outputs data to the rotation output files (e.g.
+ * the potential, the angle of the group(s), and torques).
+ *
+ * \param rot     Pointer to all the enforced rotation data.
+ * \param f       The local forces to which the rotational forces have
+ *                to be added.
+ * \param cr      Pointer to MPI communication data.
+ * \param step    The time step, used for output.
+ * \param t       Time, used for output.
+ * \returns       The potential energy of the rotation potentials.
  */
 extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_int64_t step, real t);
 
 
 /*! \brief Close the enforced rotation output files.
  *
- * \param rot               Pointer to all the enforced rotation data.
+ * \param rot     Pointer to all the enforced rotation data.
  */
 extern void finish_rot(t_rot *rot);
 
similarity index 99%
rename from src/gromacs/mdlib/pullutil.c
rename to src/gromacs/pulling/pullutil.c
index bbcb85f9e7c4408c69af0ed2dc2543ead738cbdc..4183f23888eaf18d8d95ff09bf3f9353ea691739 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
index 1adeb20d7c43784e8fecfd87274e2c031274033b..4d11e497655cf8709bc9ad099a2fa9d4467cd82f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
@@ -54,7 +54,6 @@
 #include "md_support.h"
 #include "md_logging.h"
 #include "network.h"
-#include "pull.h"
 #include "xvgr.h"
 #include "physics.h"
 #include "names.h"
@@ -94,6 +93,7 @@
 #include "gromacs/fileio/xtcio.h"
 #include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
+#include "gromacs/pulling/pull.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"
index 6452f7885065c3d76be7a06f13c7e1e4267b6bdc..b83d6318668470d303d6798a81bd82b53b2b3de2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014, 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.
@@ -54,8 +54,6 @@
 #include "md_logging.h"
 #include "md_support.h"
 #include "network.h"
-#include "pull.h"
-#include "pull_rotation.h"
 #include "names.h"
 #include "disre.h"
 #include "orires.h"
@@ -74,7 +72,6 @@
 #include "txtdump.h"
 #include "gmx_detect_hardware.h"
 #include "gmx_omp_nthreads.h"
-#include "pull_rotation.h"
 #include "calc_verletbuf.h"
 #include "gmx_fatal_collective.h"
 #include "membed.h"
@@ -88,6 +85,8 @@
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/essentialdynamics/edsam.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/pulling/pull_rotation.h"
 
 #ifdef GMX_FAHCORE
 #include "corewrap.h"