2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2018,2019, 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.
35 #ifndef GMX_MDTYPES_TYPES_ENERDATA_H
36 #define GMX_MDTYPES_TYPES_ENERDATA_H
41 #include "gromacs/mdtypes/md_enums.h"
42 #include "gromacs/topology/idef.h"
43 #include "gromacs/utility/real.h"
55 struct gmx_grppairener_t
57 gmx_grppairener_t(int numEnergyGroups) : nener(numEnergyGroups * numEnergyGroups)
59 for (auto& elem : ener)
65 int nener; /* The number of energy group pairs */
66 std::array<std::vector<real>, egNR> ener; /* Energy terms for each pair of groups */
71 gmx_enerdata_t(int numEnergyGroups, int numFepLambdas);
73 real term[F_NRE] = { 0 }; /* The energies for all different interaction types */
74 struct gmx_grppairener_t grpp;
75 double dvdl_lin[efptNR] = { 0 }; /* Contributions to dvdl with linear lam-dependence */
76 double dvdl_nonlin[efptNR] = { 0 }; /* Idem, but non-linear dependence */
77 /* The idea is that dvdl terms with linear lambda dependence will be added
78 * automatically to enerpart_lambda. Terms with non-linear lambda dependence
79 * should explicitly determine the energies at foreign lambda points
80 * when n_lambda > 0. */
82 int fep_state = 0; /*current fep state -- just for printing */
83 std::vector<double> enerpart_lambda; /* Partial Hamiltonian for lambda and flambda[], includes at least all perturbed terms */
84 real foreign_term[F_NRE] = { 0 }; /* alternate array for storing foreign lambda energies */
85 struct gmx_grppairener_t foreign_grpp; /* alternate array for storing foreign lambda energies */