9631266ac4fa5fea89f01c2efe282cf264b25d4c
[alexxy/gromacs.git] / src / gromacs / mdlib / mdsetup.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 #ifndef GMX_MDLIB_MDSETUP_H
36 #define GMX_MDLIB_MDSETUP_H
37
38 struct bonded_threading_t;
39 struct gmx_localtop_t;
40 struct gmx_mtop_t;
41 struct gmx_shellfc_t;
42 struct gmx_vsite_t;
43 struct t_commrec;
44 struct t_forcerec;
45 struct t_graph;
46 struct t_inputrec;
47
48 namespace gmx
49 {
50 class MDAtoms;
51 }
52
53 /*! \brief Sets atom data for several MD algorithms
54  *
55  * Most MD algorithms require two different setup calls:
56  * one for initialization and parameter setting and one for atom data setup.
57  * This routine sets the atom data for the (locally available) atoms.
58  * This is called at the start of serial runs and during domain decomposition.
59  *
60  * \param[in]     cr         Communication record
61  * \param[in]     ir         Input parameter record
62  * \param[in]     top_global The global topology
63  * \param[in,out] top        The local topology
64  * \param[in,out] fr         The force calculation parameter/data record
65  * \param[out]    graph      The molecular graph, can be NULL
66  * \param[out]    mdAtoms    The MD atom data
67  * \param[in,out] vsite      The virtual site data, can be NULL
68  * \param[in,out] shellfc    The shell/flexible-constraint data, can be NULL
69  */
70 void mdAlgorithmsSetupAtomData(const t_commrec   *cr,
71                                const t_inputrec  *ir,
72                                const gmx_mtop_t  *top_global,
73                                gmx_localtop_t    *top,
74                                t_forcerec        *fr,
75                                t_graph          **graph,
76                                gmx::MDAtoms      *mdAtoms,
77                                gmx_vsite_t       *vsite,
78                                gmx_shellfc_t     *shellfc);
79
80 /*! \brief Clean up after MD algorithms.
81  *
82  * \param[out] bt            Manages the bonded threading.
83  * \param[out] top           The local topology
84  */
85 void mdAlgorithmsTearDownAtomData(bonded_threading_t *bt,
86                                   gmx_localtop_t     *top);
87
88 #endif