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, 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 struct AwhParams; 63 64 /*! \brief Allocate and initialize the AWH parameters with values from the input file. 65 * 66 * \param[in,out] inp Input file entries. 67 * \param[in,out] wi Struct for bookeeping warnings. 68 * \returns AWH parameters. 69 */ 70 AwhParams* readAwhParams(std::vector<t_inpfile>* inp, warninp_t wi); 71 72 /*! \brief Check the AWH parameters. 73 * 74 * \param[in,out] awhParams The AWH parameters. 75 * \param[in] inputrec Input parameter struct. 76 * \param[in,out] wi Struct for bookeeping warnings. 77 */ 78 void checkAwhParams(const AwhParams* awhParams, const t_inputrec* inputrec, warninp_t wi); 79 80 81 /*! \brief 82 * Sets AWH parameters that need state parameters such as the box vectors. 83 * 84 * \param[in,out] awhParams AWH parameters. 85 * \param[in] pull_params Pull parameters. 86 * \param[in,out] pull_work Pull working struct to register AWH bias in. 87 * \param[in] box Box vectors. 88 * \param[in] pbcType Periodic boundary conditions enum. 89 * \param[in] compressibility Compressibility matrix for pressure coupling, pass all 0 without pressure coupling 90 * \param[in] inputrecGroupOptions Parameters for atom groups. 91 * \param[in] initLambda The starting lambda, to allow using free energy lambda as reaction coordinate 92 * provider in any dimension. 93 * \param[in] mtop The system topology. 94 * \param[in,out] wi Struct for bookeeping warnings. 95 * 96 * \note This function currently relies on the function set_pull_init to have been called. 97 */ 98 void setStateDependentAwhParams(AwhParams* awhParams, 99 const pull_params_t& pull_params, 100 pull_t* pull_work, 101 const matrix box, 102 PbcType pbcType, 103 const tensor& compressibility, 104 const t_grpopts* inputrecGroupOptions, 105 real initLambda, 106 const gmx_mtop_t& mtop, 107 warninp_t wi); 108 109 } // namespace gmx 110 111 #endif /* GMX_AWH_READPARAMS_H */ 112