2 * This file is part of the GROMACS molecular simulation package.
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,2018,2019, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 #ifndef GMX_MDLIB_SIM_UTIL_H
38 #define GMX_MDLIB_SIM_UTIL_H
40 #include "gromacs/fileio/enxio.h"
41 #include "gromacs/mdlib/vcm.h"
42 #include "gromacs/timing/wallcycle.h"
43 #include "gromacs/timing/walltime_accounting.h"
44 #include "gromacs/utility/arrayref.h"
46 struct gmx_ekindata_t;
47 struct gmx_enerdata_t;
48 struct gmx_output_env_t;
50 struct nonbonded_verlet_t;
60 class IMDOutputProvider;
65 typedef struct gmx_global_stat *gmx_global_stat_t;
67 /*! \brief Parallellizes put_atoms_in_box()
69 * This wrapper function around put_atoms_in_box() with the ugly manual
70 * workload splitting is needed to avoid silently introducing multithreading
72 * \param[in] ePBC The pbc type
73 * \param[in] box The simulation box
74 * \param[inout] x The coordinates of the atoms
76 void put_atoms_in_box_omp(int ePBC, const matrix box, gmx::ArrayRef<gmx::RVec> x);
80 /* ROUTINES from stat.c */
81 gmx_global_stat_t global_stat_init(const t_inputrec *ir);
83 void global_stat_destroy(gmx_global_stat_t gs);
85 void global_stat(const gmx_global_stat *gs,
86 const t_commrec *cr, gmx_enerdata_t *enerd,
87 tensor fvir, tensor svir, rvec mu_tot,
88 const t_inputrec *inputrec,
89 gmx_ekindata_t *ekind,
90 const gmx::Constraints *constr, t_vcm *vcm,
92 int *totalNumberOfBondedInteractions,
93 gmx_bool bSumEkinhOld, int flags);
94 /* All-reduce energy-like quantities over cr->mpi_comm_mysim */
96 bool do_per_step(int64_t step, int64_t nstep);
97 /* Return TRUE if io should be done */
99 /* ROUTINES from sim_util.c */
101 /*! \brief Fills fep_state, lambda, and lam0 if needed
103 * If FEP or simulated tempering is in use:
105 * fills non-null lam0 with the initial lambda values, and
106 * on master rank fills fep_state and lambda.
108 * Reports the initial lambda state to the log file. */
109 void initialize_lambdas(FILE *fplog,
110 const t_inputrec &ir,
113 gmx::ArrayRef<real> lambda,
116 void do_constrain_first(FILE *log, gmx::Constraints *constr,
117 const t_inputrec *inputrec, const t_mdatoms *md,
120 /* Routine in sim_util.c */
122 gmx_bool use_GPU(const nonbonded_verlet_t *nbv);