From 904e082beef3f742f9c8bf289fa65b5ad2741b60 Mon Sep 17 00:00:00 2001 From: Carsten Kutzner Date: Mon, 13 Jan 2014 11:53:49 +0100 Subject: [PATCH] Move pull code to separate subdirectory 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 --- src/gromacs/CMakeLists.txt | 1 + src/gromacs/gmxpreprocess/readpull.c | 4 +- src/gromacs/legacyheaders/mdrun.h | 3 +- src/gromacs/legacyheaders/pull.h | 115 ---------- src/gromacs/legacyheaders/update.h | 3 +- src/gromacs/mdlib/constr.c | 3 +- src/gromacs/mdlib/domdec.c | 4 +- src/gromacs/mdlib/sim_util.c | 5 +- src/gromacs/mdlib/update.c | 4 +- src/gromacs/pulling/CMakeLists.txt | 40 ++++ src/gromacs/{mdlib => pulling}/pull.c | 3 +- src/gromacs/pulling/pull.h | 200 ++++++++++++++++++ .../{mdlib => pulling}/pull_rotation.c | 4 +- .../pull_rotation.h | 100 ++++----- src/gromacs/{mdlib => pulling}/pullutil.c | 2 +- src/programs/mdrun/md.c | 4 +- src/programs/mdrun/runner.c | 7 +- 17 files changed, 316 insertions(+), 186 deletions(-) delete mode 100644 src/gromacs/legacyheaders/pull.h create mode 100644 src/gromacs/pulling/CMakeLists.txt rename src/gromacs/{mdlib => pulling}/pull.c (99%) create mode 100644 src/gromacs/pulling/pull.h rename src/gromacs/{mdlib => pulling}/pull_rotation.c (99%) rename src/gromacs/{legacyheaders => pulling}/pull_rotation.h (53%) rename src/gromacs/{mdlib => pulling}/pullutil.c (99%) diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index cae997f4e6..378af42d21 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -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) diff --git a/src/gromacs/gmxpreprocess/readpull.c b/src/gromacs/gmxpreprocess/readpull.c index 6bec3ca392..b4ba145312 100644 --- a/src/gromacs/gmxpreprocess/readpull.c +++ b/src/gromacs/gmxpreprocess/readpull.c @@ -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 #include "mdatoms.h" #include "pbc.h" -#include "pull.h" +#include "gromacs/pulling/pull.h" static char pulldim[STRLEN]; diff --git a/src/gromacs/legacyheaders/mdrun.h b/src/gromacs/legacyheaders/mdrun.h index 51c370f08a..013a266bee 100644 --- a/src/gromacs/legacyheaders/mdrun.h +++ b/src/gromacs/legacyheaders/mdrun.h @@ -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 index 7492d923d6..0000000000 --- a/src/gromacs/legacyheaders/pull.h +++ /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 diff --git a/src/gromacs/legacyheaders/update.h b/src/gromacs/legacyheaders/update.h index 613d123135..9ebaeeaca5 100644 --- a/src/gromacs/legacyheaders/update.h +++ b/src/gromacs/legacyheaders/update.h @@ -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" { diff --git a/src/gromacs/mdlib/constr.c b/src/gromacs/mdlib/constr.c index e73e77d274..f0d6f242a3 100644 --- a/src/gromacs/mdlib/constr.c +++ b/src/gromacs/mdlib/constr.c @@ -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 { diff --git a/src/gromacs/mdlib/domdec.c b/src/gromacs/mdlib/domdec.c index da45b8f573..fca780fc80 100644 --- a/src/gromacs/mdlib/domdec.c +++ b/src/gromacs/mdlib/domdec.c @@ -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) diff --git a/src/gromacs/mdlib/sim_util.c b/src/gromacs/mdlib/sim_util.c index 3ae2e92c55..d33ba4a1fa 100644 --- a/src/gromacs/mdlib/sim_util.c +++ b/src/gromacs/mdlib/sim_util.c @@ -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" diff --git a/src/gromacs/mdlib/update.c b/src/gromacs/mdlib/update.c index 06ea1fec25..249d1d2ecd 100644 --- a/src/gromacs/mdlib/update.c +++ b/src/gromacs/mdlib/update.c @@ -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 index 0000000000..1938731e02 --- /dev/null +++ b/src/gromacs/pulling/CMakeLists.txt @@ -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) diff --git a/src/gromacs/mdlib/pull.c b/src/gromacs/pulling/pull.c similarity index 99% rename from src/gromacs/mdlib/pull.c rename to src/gromacs/pulling/pull.c index a63733e537..ab96a3a909 100644 --- a/src/gromacs/mdlib/pull.c +++ b/src/gromacs/pulling/pull.c @@ -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 index 0000000000..4ef61ba6ad --- /dev/null +++ b/src/gromacs/pulling/pull.h @@ -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 diff --git a/src/gromacs/mdlib/pull_rotation.c b/src/gromacs/pulling/pull_rotation.c similarity index 99% rename from src/gromacs/mdlib/pull_rotation.c rename to src/gromacs/pulling/pull_rotation.c index aaef3d70fc..edd84a4f3e 100644 --- a/src/gromacs/mdlib/pull_rotation.c +++ b/src/gromacs/pulling/pull_rotation.c @@ -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:"}; diff --git a/src/gromacs/legacyheaders/pull_rotation.h b/src/gromacs/pulling/pull_rotation.h similarity index 53% rename from src/gromacs/legacyheaders/pull_rotation.h rename to src/gromacs/pulling/pull_rotation.h index 492e527687..e7d1cfd1c4 100644 --- a/src/gromacs/legacyheaders/pull_rotation.h +++ b/src/gromacs/pulling/pull_rotation.h @@ -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. @@ -35,20 +35,21 @@ * 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 * + * \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); diff --git a/src/gromacs/mdlib/pullutil.c b/src/gromacs/pulling/pullutil.c similarity index 99% rename from src/gromacs/mdlib/pullutil.c rename to src/gromacs/pulling/pullutil.c index bbcb85f9e7..4183f23888 100644 --- a/src/gromacs/mdlib/pullutil.c +++ b/src/gromacs/pulling/pullutil.c @@ -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. diff --git a/src/programs/mdrun/md.c b/src/programs/mdrun/md.c index 1adeb20d7c..4d11e49765 100644 --- a/src/programs/mdrun/md.c +++ b/src/programs/mdrun/md.c @@ -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" diff --git a/src/programs/mdrun/runner.c b/src/programs/mdrun/runner.c index 6452f78850..b83d631866 100644 --- a/src/programs/mdrun/runner.c +++ b/src/programs/mdrun/runner.c @@ -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" -- 2.22.0