Move remaining C files in utility to C++
[gromacs.git] / src / gromacs / swap / swapcoords.h
blob1693e1b6703c90d93674f729f6f01b38a8deb72f
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2013, The GROMACS development team.
5 * Copyright (c) 2013,2014, by the GROMACS development team, led by
6 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
7 * and including many others, as listed in the AUTHORS file in the
8 * top-level source directory and at http://www.gromacs.org.
10 * GROMACS is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public License
12 * as published by the Free Software Foundation; either version 2.1
13 * of the License, or (at your option) any later version.
15 * GROMACS is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with GROMACS; if not, see
22 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * If you want to redistribute modifications to GROMACS, please
26 * consider that scientific software is very special. Version
27 * control is crucial - bugs must be traceable. We will be happy to
28 * consider code for inclusion in the official distribution, but
29 * derived work must not be called official GROMACS. Details are found
30 * in the README & COPYING files - if they are missing, get the
31 * official version at http://www.gromacs.org.
33 * To help us fund GROMACS development, we humbly ask that you cite
34 * the research papers on the package. Check out http://www.gromacs.org.
36 /*! \libinternal
37 * \defgroup module_swap "Computational Electrophysiology" position swapping (swap)
38 * \ingroup group_mdrun
39 * \brief
40 * Implements the "Computational Electrophysiology" protocol.
42 * \author Carsten Kutzner <ckutzne@gwdg.de>
44 /*! \libinternal \file
45 * \brief
46 * The "Computational Electrophysiology" protocol for ion/water position swapping.
48 * \author Carsten Kutzner <ckutzne@gwdg.de>
49 * \inlibraryapi
50 * \ingroup module_swap
52 #ifndef GMX_SWAP_SWAPCOORDS_H
53 #define GMX_SWAP_SWAPCOORDS_H
55 #include "gromacs/legacyheaders/typedefs.h"
56 #include "gromacs/legacyheaders/types/commrec.h"
57 #include "gromacs/timing/wallcycle.h"
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
64 /*! \brief Initialize ion / water position swapping ("Computational Electrophysiology").
66 * This routine does the memory allocation for various helper arrays, opens
67 * the output file, sets up swap data checkpoint writing, etc.
69 * \param[in] fplog General output file, normally md.log.
70 * \param[in] bVerbose Should we be quiet or verbose?
71 * \param[in] ir Structure containing MD input parameters, among those
72 * also the structure needed for position swapping.
73 * \param[in] fn Output file name for swap data.
74 * \param[in] mtop Molecular topology.
75 * \param[in] x The initial positions of all particles.
76 * \param[in] box The simulation box.
77 * \param[in] swapstate Swap-related data that is read from or written to checkpoint.
78 * \param[in] cr Pointer to MPI communication data.
79 * \param[in] oenv Needed to open the swap output XVGR file.
80 * \param[in] Flags Flags passed over from main, used to determine
81 * whether we are doing a rerun, appending, etc.
83 extern void init_swapcoords(
84 FILE *fplog,
85 gmx_bool bVerbose,
86 t_inputrec *ir,
87 const char *fn,
88 gmx_mtop_t *mtop,
89 rvec x[],
90 matrix box,
91 swapstate_t *swapstate,
92 t_commrec *cr,
93 const output_env_t oenv,
94 unsigned long Flags);
97 /*! \brief Make a selection of the home atoms for the swap groups. These are
98 * the ions, the water, and the channels. This routine should be called at every
99 * domain decomposition.
101 * \param[in] dd Structure containing domain decomposition data.
102 * \param[in] si_pub Pointer to the swap data structure.
104 extern void dd_make_local_swap_groups(gmx_domdec_t *dd, t_swapcoords *si_pub);
107 /*! \brief "Computational Electrophysiology" main routine within MD loop.
109 * \param[in] cr Pointer to MPI communication data.
110 * \param[in] step The number of the MD time step.
111 * \param[in] t The time.
112 * \param[in] ir Structure containing MD input parameters, among those
113 * also the structure needed for position swapping.
114 * \param[in] wcycle Count wallcycles of swap routines for diagnostic output.
115 * \param[in] x Positions of home particles this node owns.
116 * \param[in] box The simulation box.
117 * \param[in] mtop Molecular topology.
118 * \param[in] bVerbose Should we be quiet or verbose?
119 * \param[in] bRerun Are we doing a rerun?
121 * \returns Whether at least one pair of molecules was swapped.
123 extern gmx_bool do_swapcoords(
124 t_commrec *cr,
125 gmx_int64_t step,
126 double t,
127 t_inputrec *ir,
128 gmx_wallcycle_t wcycle,
129 rvec x[],
130 matrix box,
131 gmx_mtop_t *mtop,
132 gmx_bool bVerbose,
133 gmx_bool bRerun);
136 #ifdef __cplusplus
138 #endif
140 #endif