Split lines with many copyright years
[alexxy/gromacs.git] / src / gromacs / mdlib / forcerec.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team.
6  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
7  * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
8  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
9  * and including many others, as listed in the AUTHORS file in the
10  * top-level source directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 #ifndef GMX_MDLIB_FORCEREC_H
39 #define GMX_MDLIB_FORCEREC_H
40
41 #include "gromacs/mdlib/force_flags.h"
42 #include "gromacs/mdlib/tgroup.h"
43 #include "gromacs/mdlib/vsite.h"
44 #include "gromacs/mdtypes/forcerec.h"
45 #include "gromacs/timing/wallcycle.h"
46 #include "gromacs/utility/arrayref.h"
47
48 struct gmx_device_info_t;
49 struct gmx_hw_info_t;
50 struct t_commrec;
51 struct t_fcdata;
52 struct t_filenm;
53 struct t_inputrec;
54 struct gmx_gpu_info_t;
55 struct gmx_wallcycle;
56
57 namespace gmx
58 {
59 class MDLogger;
60 class PhysicalNodeCommunicator;
61 } // namespace gmx
62
63 /*! \brief Print the contents of the forcerec to a file
64  *
65  * \param[in] fplog The log file to print to
66  * \param[in] fr    The forcerec structure
67  */
68 void pr_forcerec(FILE* fplog, t_forcerec* fr);
69
70 /*! \brief Set the number of charge groups and atoms.
71  *
72  * The force calculation needs information on which atoms it
73  * should do work.
74  * \param[inout] fr                  The forcerec
75  * \param[in]    natoms_force        Number of atoms to compute force on
76  * \param[in]    natoms_force_constr Number of atoms involved in constraints
77  * \param[in]    natoms_f_novirsum   Number of atoms for which
78  *                                   force is to be compute but no virial
79  */
80 void forcerec_set_ranges(t_forcerec* fr, int natoms_force, int natoms_force_constr, int natoms_f_novirsum);
81
82 /*! \brief Initiate table constants
83  *
84  * Initializes the tables in the interaction constant data structure.
85  * \param[in] fp   File for debugging output
86  * \param[in] ic   Structure holding the table constant
87  */
88 void init_interaction_const_tables(FILE* fp, interaction_const_t* ic);
89
90 /*! \brief Initialize forcerec structure.
91  *
92  * \param[in]  fplog              File for printing
93  * \param[in]  mdlog              File for printing
94  * \param[out] fr                 The forcerec
95  * \param[in]  fcd                Force constant data
96  * \param[in]  ir                 Inputrec structure
97  * \param[in]  mtop               Molecular topology
98  * \param[in]  cr                 Communication structures
99  * \param[in]  box                Simulation box
100  * \param[in]  tabfn              Table potential file for non-bonded interactions
101  * \param[in]  tabpfn             Table potential file for pair interactions
102  * \param[in]  tabbfnm            Table potential files for bonded interactions
103  * \param[in]  hardwareInfo       Information about hardware
104  * \param[in]  deviceInfo         Info about GPU device to use for short-ranged work
105  * \param[in]  useGpuForBonded    Whether bonded interactions will run on a GPU
106  * \param[in]  pmeOnlyRankUsesGpu Whether there is a PME task on a GPU on a PME-only rank
107  * \param[in]  print_force        Print forces for atoms with force >= print_force
108  * \param[out] wcycle             Pointer to cycle counter object
109  */
110 void init_forcerec(FILE*                            fplog,
111                    const gmx::MDLogger&             mdlog,
112                    t_forcerec*                      fr,
113                    t_fcdata*                        fcd,
114                    const t_inputrec*                ir,
115                    const gmx_mtop_t*                mtop,
116                    const t_commrec*                 cr,
117                    matrix                           box,
118                    const char*                      tabfn,
119                    const char*                      tabpfn,
120                    gmx::ArrayRef<const std::string> tabbfnm,
121                    const gmx_hw_info_t&             hardwareInfo,
122                    const gmx_device_info_t*         deviceInfo,
123                    bool                             useGpuForBonded,
124                    bool                             pmeOnlyRankUsesGpu,
125                    real                             print_force,
126                    gmx_wallcycle*                   wcycle);
127
128 /*! \brief Divide exclusions over threads
129  *
130  * Set the exclusion load for the local exclusions and possibly threads
131  * \param[out] fr  The force record
132  * \param[in]  top The topology
133  */
134 void forcerec_set_excl_load(t_forcerec* fr, const gmx_localtop_t* top);
135
136 #endif