Default initialize pull datastructures
[gromacs.git] / src / gromacs / mdtypes / pull_params.h
blobc0709ca353edb9ac738bcf1681d44e57c2fe039d
1 /*
2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2015,2016,2018,2019,2020, 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.
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.
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.
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.
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.
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.
36 /*! \libinternal \file
39 * \brief
40 * This file contains datatypes for the mdp options used by the pull code.
42 * \author Berk Hess
44 * \inlibraryapi
45 * \ingroup module_mdtypes
48 #ifndef GMX_MDTYPES_PULL_PARAMS_H
49 #define GMX_MDTYPES_PULL_PARAMS_H
51 #include <array>
52 #include <string>
53 #include <vector>
55 #include "gromacs/math/vectypes.h"
56 #include "gromacs/mdtypes/md_enums.h"
57 #include "gromacs/utility/basedefinitions.h"
58 #include "gromacs/utility/real.h"
60 /*! \cond INTERNAL */
62 /*! \brief Struct that defines a pull group */
63 struct t_pull_group
65 std::vector<int> ind; /**< The global atoms numbers */
66 std::vector<real> weight; /**< Weights (use all 1 when weight==NULL) */
67 int pbcatom; /**< The reference atom for pbc (global number) */
68 int pbcatom_input; /**< The reference atom for pbc (global number) as specified in the input parameters */
71 /*! Maximum number of pull groups that can be used in a pull coordinate */
72 static const int c_pullCoordNgroupMax = 6;
74 /*! \brief Struct that defines a pull coordinate */
75 struct t_pull_coord
77 //! The pull type: umbrella, constraint, ...
78 int eType = 0;
79 //! Name of the module providing the external potential, only used with eType==epullEXTERNAL
80 std::string externalPotentialProvider;
81 //! The pull geometry
82 int eGeom = 0;
83 //! The number of groups, depends on eGeom
84 int ngroup = 0;
85 /*! \brief The pull groups:
87 * indices into the group arrays in pull_t and pull_params_t,
88 * ngroup indices are used
90 std::array<int, c_pullCoordNgroupMax> group;
91 //! Used to select components for constraint
92 gmx::IVec dim = { 0, 0, 0 };
93 //! The origin for the absolute reference
94 gmx::RVec origin = { 0, 0, 0 };
95 //! The pull vector, direction or position
96 gmx::RVec vec = { 0, 0, 0 };
97 //! Set init based on the initial structure
98 bool bStart = false;
99 //! Initial reference displacement (nm) or (deg)
100 real init = 0.0;
101 //! Rate of motion (nm/ps) or (deg/ps)
102 real rate = 0.0;
103 /*! \brief Force constant
105 * For umbrella pull type this is (kJ/(mol nm^2) or kJ/(mol rad^2).
106 * For constant force pull type it is kJ/(mol nm) or kJ/(mol rad).
108 real k = 0.0;
109 //! Force constant for state B
110 real kB = 0.0;
113 /*! \brief Struct containing all pull parameters */
114 struct pull_params_t
116 //! Number of pull groups
117 int ngroup = 0;
118 //! Number of pull coordinates
119 int ncoord = 0;
120 //! Radius of cylinder for dynamic COM (nm)
121 real cylinder_r = 0.0;
122 //! Absolute tolerance for constraints in (nm)
123 real constr_tol = 0.0;
124 //! Print coordinates of COM for each coord
125 bool bPrintCOM = false;
126 //! Print the reference value for each coord
127 bool bPrintRefValue = false;
128 //! Print cartesian components for each coord with geometry=distance
129 bool bPrintComp = false;
130 //! Use the COM of each group from the previous step as reference
131 bool bSetPbcRefToPrevStepCOM = false;
132 //! Output interval for pull x
133 int nstxout = 0;
134 //! Output interval for pull f
135 int nstfout = 0;
136 //! Write the average coordinate during the output interval
137 bool bXOutAverage = false;
138 //! Write the average force during the output interval
139 bool bFOutAverage = false;
140 //! groups to pull/restrain/etc/
141 std::vector<t_pull_group> group;
142 //! the pull coordinates
143 std::vector<t_pull_coord> coord;
146 /*! \endcond */
148 #endif /* GMX_MDTYPES_PULL_PARAMS_H */