22247ae48065f2032f2b99b6a286719026d6e606
[alexxy/gromacs.git] / src / gromacs / applied_forces / awh / read_params.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team.
5  * Copyright (c) 2018,2019,2020,2021, 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.
9  *
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.
14  *
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.
19  *
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.
24  *
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.
32  *
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.
35  */
36
37 /*! \libinternal \file
38  *
39  * \brief
40  * Declares functions needed for reading, initializing and setting the AWH parameter data types.
41  *
42  * \author Viveca Lindahl
43  * \inlibraryapi
44  * \ingroup module_awh
45  */
46
47 #ifndef GMX_AWH_READPARAMS_H
48 #define GMX_AWH_READPARAMS_H
49
50 #include "gromacs/fileio/readinp.h"
51 #include "gromacs/math/vectypes.h"
52
53 struct t_grpopts;
54 struct t_inputrec;
55 struct gmx_mtop_t;
56 struct pull_params_t;
57 struct pull_t;
58 enum class PbcType : int;
59
60 namespace gmx
61 {
62
63 class AwhParams;
64 class ISerializer;
65
66 /*! \brief Check the AWH parameters.
67  *
68  * \param[in]     awhParams    The AWH parameters.
69  * \param[in]     inputrec     Input parameter struct.
70  * \param[in,out] wi           Struct for bookeeping warnings.
71  */
72 void checkAwhParams(const AwhParams& awhParams, const t_inputrec& inputrec, warninp_t wi);
73
74
75 /*! \brief
76  * Sets AWH parameters that need state parameters such as the box vectors.
77  *
78  * \param[in,out] awhParams             AWH parameters.
79  * \param[in]     pull_params           Pull parameters.
80  * \param[in,out] pull_work             Pull working struct to register AWH bias in.
81  * \param[in]     box                   Box vectors.
82  * \param[in]     pbcType               Periodic boundary conditions enum.
83  * \param[in]     compressibility       Compressibility matrix for pressure coupling, pass all 0 without pressure coupling
84  * \param[in]     inputrecGroupOptions  Parameters for atom groups.
85  * \param[in]     initLambda            The starting lambda, to allow using free energy lambda as reaction coordinate
86  * provider in any dimension.
87  * \param[in]     mtop                  The system topology.
88  * \param[in,out] wi                    Struct for bookeeping warnings.
89  *
90  * \note This function currently relies on the function set_pull_init to have been called.
91  */
92 void setStateDependentAwhParams(AwhParams*           awhParams,
93                                 const pull_params_t& pull_params,
94                                 pull_t*              pull_work,
95                                 const matrix         box,
96                                 PbcType              pbcType,
97                                 const tensor&        compressibility,
98                                 const t_grpopts*     inputrecGroupOptions,
99                                 real                 initLambda,
100                                 const gmx_mtop_t&    mtop,
101                                 warninp_t            wi);
102
103 } // namespace gmx
104
105 #endif /* GMX_AWH_READPARAMS_H */