From: ejjordan Date: Tue, 23 Mar 2021 10:29:00 +0000 (+0100) Subject: Forward declare ArrayRef more and inlcude basedefinitions where needed X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=e726ffa7b85c5cda92d28772a6642e712ae204d7;p=alexxy%2Fgromacs.git Forward declare ArrayRef more and inlcude basedefinitions where needed Remove many includes of ArrayRef that can be forward declared. Also remove includes of basedefinitions in many headers. In some cases removing basedefinitinos meant also changing gmx_bool to bool. Note that no change to source files is needed, apart from possibly adding the basedefintions include, because gmx_bool uses true and false under the hood. --- diff --git a/api/legacy/include/gromacs/utility/gmxassert.h b/api/legacy/include/gromacs/utility/gmxassert.h index 14c0c8cdf3..dea2e5eb0d 100644 --- a/api/legacy/include/gromacs/utility/gmxassert.h +++ b/api/legacy/include/gromacs/utility/gmxassert.h @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2011-2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,8 +44,6 @@ #ifndef GMX_UTILITY_GMXASSERT_H #define GMX_UTILITY_GMXASSERT_H -#include "gromacs/utility/basedefinitions.h" - #include "current_function.h" //! \addtogroup module_utility diff --git a/api/nblib/simulationstate.cpp b/api/nblib/simulationstate.cpp index e474d01508..bd5d2d8595 100644 --- a/api/nblib/simulationstate.cpp +++ b/api/nblib/simulationstate.cpp @@ -46,6 +46,7 @@ #include #include "gromacs/pbcutil/pbc.h" +#include "gromacs/utility/arrayref.h" #include "nblib/exception.h" #include "nblib/simulationstate.h" #include "nblib/simulationstateimpl.h" diff --git a/api/nblib/tests/integrator.cpp b/api/nblib/tests/integrator.cpp index 75e5584548..fb484557d3 100644 --- a/api/nblib/tests/integrator.cpp +++ b/api/nblib/tests/integrator.cpp @@ -44,6 +44,7 @@ */ #include "nblib/integrator.h" #include "gromacs/pbcutil/pbc.h" +#include "gromacs/utility/arrayref.h" #include "nblib/molecules.h" #include "nblib/particletype.h" #include "nblib/simulationstate.h" diff --git a/src/gromacs/analysisdata/dataframe.h b/src/gromacs/analysisdata/dataframe.h index c034fd8ed2..07d66ea356 100644 --- a/src/gromacs/analysisdata/dataframe.h +++ b/src/gromacs/analysisdata/dataframe.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2012,2013,2014,2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2012,2013,2014,2017,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,6 +46,7 @@ #include #include "gromacs/utility/arrayref.h" +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/flags.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/real.h" diff --git a/src/gromacs/analysisdata/modules/frameaverager.h b/src/gromacs/analysisdata/modules/frameaverager.h index 379750facf..45e4defdcc 100644 --- a/src/gromacs/analysisdata/modules/frameaverager.h +++ b/src/gromacs/analysisdata/modules/frameaverager.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2013,2014,2015,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2019,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -44,6 +44,7 @@ #include +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/real.h" diff --git a/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp b/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp index a3bcbc1fb2..75d1d26a07 100644 --- a/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp +++ b/src/gromacs/applied_forces/densityfitting/densityfittingamplitudelookup.cpp @@ -46,6 +46,7 @@ #include #include +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/arrayref.h" namespace gmx diff --git a/src/gromacs/commandline/filenm.h b/src/gromacs/commandline/filenm.h index 5cc0e620a1..1a3c8a80bb 100644 --- a/src/gromacs/commandline/filenm.h +++ b/src/gromacs/commandline/filenm.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include #include "gromacs/fileio/filetypes.h" -#include "gromacs/utility/basedefinitions.h" //! \addtogroup module_commandline @@ -149,10 +148,10 @@ gmx::ArrayRef ftp2fns(int ftp, int nfile, const t_filenm fnm[ #define ftp2FILE(ftp, nfile, fnm, mode) gmx_ffopen(ftp2fn(ftp, nfile, fnm), mode) //! Returns TRUE when this file type has been found on the cmd-line. -gmx_bool ftp2bSet(int ftp, int nfile, const t_filenm fnm[]); +bool ftp2bSet(int ftp, int nfile, const t_filenm fnm[]); //! Returns TRUE when this option has been found on the cmd-line. -gmx_bool opt2bSet(const char* opt, int nfile, const t_filenm fnm[]); +bool opt2bSet(const char* opt, int nfile, const t_filenm fnm[]); /*! \brief * Returns the file name belonging top cmd-line option opt, or NULL when @@ -170,13 +169,13 @@ const char* opt2fn_null(const char* opt, int nfile, const t_filenm fnm[]); const char* ftp2fn_null(int ftp, int nfile, const t_filenm fnm[]); //! Returns whether or not this filenm is optional. -gmx_bool is_optional(const t_filenm* fnm); +bool is_optional(const t_filenm* fnm); //! Returns whether or not this filenm is output. -gmx_bool is_output(const t_filenm* fnm); +bool is_output(const t_filenm* fnm); //! Returns whether or not this filenm is set. -gmx_bool is_set(const t_filenm* fnm); +bool is_set(const t_filenm* fnm); /*! \brief Return whether \c filename might have been produced by mdrun -noappend. * diff --git a/src/gromacs/commandline/pargs.h b/src/gromacs/commandline/pargs.h index 77b1603d2a..3ceb0acc81 100644 --- a/src/gromacs/commandline/pargs.h +++ b/src/gromacs/commandline/pargs.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -48,7 +48,6 @@ #include "gromacs/commandline/filenm.h" #include "gromacs/fileio/oenv.h" #include "gromacs/math/vectypes.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_output_env_t; @@ -120,7 +119,7 @@ typedef struct */ const char** c; /** Boolean value for etBOOL. */ - gmx_bool* b; + bool* b; /** Vector value for etRVEC. */ rvec* rv; } u; @@ -168,7 +167,7 @@ int opt2parg_int(const char* option, int nparg, t_pargs pa[]); * * \p option must specify a valid argument in \p pa of the correct type. */ -gmx_bool opt2parg_bool(const char* option, int nparg, t_pargs pa[]); +bool opt2parg_bool(const char* option, int nparg, t_pargs pa[]); /*! \brief * Returns value of an etREAL/etTIME option. @@ -216,7 +215,7 @@ const char* opt2parg_enum(const char* option, int nparg, t_pargs pa[]); * * \p option must specify a valid argument in \p pa. */ -gmx_bool opt2parg_bSet(const char* option, int nparg, const t_pargs* pa); +bool opt2parg_bSet(const char* option, int nparg, const t_pargs* pa); /** Add option -w to view output files (must be implemented in program). */ @@ -258,18 +257,18 @@ gmx_bool opt2parg_bSet(const char* option, int nparg, const t_pargs* pa); * * \see gmx_run_cmain(). */ -gmx_bool parse_common_args(int* argc, - char* argv[], - unsigned long Flags, - int nfile, - t_filenm fnm[], - int npargs, - t_pargs* pa, - int ndesc, - const char** desc, - int nbugs, - const char** bugs, - gmx_output_env_t** oenv); +bool parse_common_args(int* argc, + char* argv[], + unsigned long Flags, + int nfile, + t_filenm fnm[], + int npargs, + t_pargs* pa, + int ndesc, + const char** desc, + int nbugs, + const char** bugs, + gmx_output_env_t** oenv); /*! \} */ diff --git a/src/gromacs/domdec/domdec.h b/src/gromacs/domdec/domdec.h index 38f5e25444..ef4288a534 100644 --- a/src/gromacs/domdec/domdec.h +++ b/src/gromacs/domdec/domdec.h @@ -64,8 +64,6 @@ #include "gromacs/gpu_utils/devicebuffer_datatype.h" #include "gromacs/math/vectypes.h" -#include "gromacs/utility/arrayref.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct cginfo_mb_t; @@ -94,6 +92,8 @@ class ForceWithShiftForces; class MDLogger; class RangePartitioning; class VirtualSitesHandler; +template +class ArrayRef; } // namespace gmx /*! \brief Returns the global topology atom number belonging to local atom index i. diff --git a/src/gromacs/domdec/domdec_struct.h b/src/gromacs/domdec/domdec_struct.h index f0db2626ea..8612abf5d7 100644 --- a/src/gromacs/domdec/domdec_struct.h +++ b/src/gromacs/domdec/domdec_struct.h @@ -53,7 +53,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/block.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxmpi.h" #include "gromacs/utility/range.h" #include "gromacs/utility/real.h" diff --git a/src/gromacs/ewald/pme.h b/src/gromacs/ewald/pme.h index d897c0fb0c..9ff1b108f2 100644 --- a/src/gromacs/ewald/pme.h +++ b/src/gromacs/ewald/pme.h @@ -55,7 +55,6 @@ #include "gromacs/gpu_utils/devicebuffer_datatype.h" #include "gromacs/gpu_utils/gpu_macros.h" #include "gromacs/math/vectypes.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_hw_info_t; diff --git a/src/gromacs/listed_forces/listed_forces.h b/src/gromacs/listed_forces/listed_forces.h index 0cf099b5ab..34e297b36d 100644 --- a/src/gromacs/listed_forces/listed_forces.h +++ b/src/gromacs/listed_forces/listed_forces.h @@ -77,7 +77,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/idef.h" #include "gromacs/topology/ifunc.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/classhelpers.h" struct bonded_threading_t; diff --git a/src/gromacs/listed_forces/pairs.h b/src/gromacs/listed_forces/pairs.h index 982c3f03b6..34593c2933 100644 --- a/src/gromacs/listed_forces/pairs.h +++ b/src/gromacs/listed_forces/pairs.h @@ -47,7 +47,6 @@ #include "gromacs/math/vec.h" #include "gromacs/topology/ifunc.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_grppairener_t; diff --git a/src/gromacs/math/gausstransform.cpp b/src/gromacs/math/gausstransform.cpp index 74ccf9aeb4..a539062ac7 100644 --- a/src/gromacs/math/gausstransform.cpp +++ b/src/gromacs/math/gausstransform.cpp @@ -53,6 +53,7 @@ #include "gromacs/math/multidimarray.h" #include "gromacs/math/units.h" #include "gromacs/math/utilities.h" +#include "gromacs/utility/basedefinitions.h" namespace gmx { diff --git a/src/gromacs/mdlib/constr.h b/src/gromacs/mdlib/constr.h index 3ab516f944..eb51ffb602 100644 --- a/src/gromacs/mdlib/constr.h +++ b/src/gromacs/mdlib/constr.h @@ -54,7 +54,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/idef.h" #include "gromacs/utility/arrayref.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/real.h" @@ -328,7 +327,7 @@ void constrain_velocities(gmx::Constraints* constr, int64_t step, t_state* state, real* dvdlambda, - gmx_bool computeVirial, + bool computeVirial, tensor constraintsVirial); /*! \brief Constraint coordinates. @@ -342,7 +341,7 @@ void constrain_coordinates(gmx::Constraints* constr, t_state* state, ArrayRefWithPadding xp, real* dvdlambda, - gmx_bool computeVirial, + bool computeVirial, tensor constraintsVirial); } // namespace gmx diff --git a/src/gromacs/mdlib/mdatoms.h b/src/gromacs/mdlib/mdatoms.h index 113d2d9f08..31af77ad16 100644 --- a/src/gromacs/mdlib/mdatoms.h +++ b/src/gromacs/mdlib/mdatoms.h @@ -44,7 +44,6 @@ #include #include "gromacs/gpu_utils/hostallocator.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" #include "gromacs/utility/unique_cptr.h" diff --git a/src/gromacs/mdlib/mdebin_bar.h b/src/gromacs/mdlib/mdebin_bar.h index 8cc98920a5..ba56c53922 100644 --- a/src/gromacs/mdlib/mdebin_bar.h +++ b/src/gromacs/mdlib/mdebin_bar.h @@ -71,12 +71,12 @@ typedef struct of the histogram */ unsigned int maxbin[2]; /* highest bin number with data */ - int type; /* the block type according to dhbtDH, etc. */ - int derivative; /* The derivative direction (as an index in the lambda - vector) if this delta_h contains derivatives */ - double* lambda; /* lambda vector (or NULL if not applicable) */ - int nlambda; /* length of the lambda vector */ - gmx_bool written; /* whether this data has already been written out */ + int type; /* the block type according to dhbtDH, etc. */ + int derivative; /* The derivative direction (as an index in the lambda + vector) if this delta_h contains derivatives */ + double* lambda; /* lambda vector (or NULL if not applicable) */ + int nlambda; /* length of the lambda vector */ + bool written; /* whether this data has already been written out */ int64_t subblock_meta_l[5]; /* metadata for an mdebin subblock for I/O: for histogram counts, etc.*/ @@ -105,12 +105,12 @@ struct t_mde_delta_h_coll t_mde_delta_h* dh_expanded; /* expanded ensemble output block (pointer into dh) */ - double start_time; /* start time of the current dh collection */ - double delta_time; /* time difference between samples */ - gmx_bool start_time_set; /* whether the start time has been set */ - double start_lambda; /* starting lambda for continuous motion of state*/ - double delta_lambda; /* delta lambda, for continuous motion of state */ - double temperature; /* the temperature of the samples*/ + double start_time; /* start time of the current dh collection */ + double delta_time; /* time difference between samples */ + bool start_time_set; /* whether the start time has been set */ + double start_lambda; /* starting lambda for continuous motion of state*/ + double delta_lambda; /* delta lambda, for continuous motion of state */ + double temperature; /* the temperature of the samples*/ double* native_lambda_vec; /* The lambda vector describing the current lambda state if it is set (NULL otherwise) */ diff --git a/src/gromacs/mdlib/vsite.h b/src/gromacs/mdlib/vsite.h index b8f694711d..32e851c8cc 100644 --- a/src/gromacs/mdlib/vsite.h +++ b/src/gromacs/mdlib/vsite.h @@ -50,8 +50,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/idef.h" -#include "gromacs/utility/arrayref.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_domdec_t; @@ -66,6 +64,8 @@ enum class PbcType : int; namespace gmx { class RangePartitioning; +template +class ArrayRef; /*! \brief The start value of the vsite indices in the ftype enum * diff --git a/src/gromacs/mdtypes/awh_history.h b/src/gromacs/mdtypes/awh_history.h index 3b55749313..b3ce1dd905 100644 --- a/src/gromacs/mdtypes/awh_history.h +++ b/src/gromacs/mdtypes/awh_history.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2017,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2017,2018,2019,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -50,7 +50,6 @@ #include #include "gromacs/mdtypes/awh_correlation_history.h" -#include "gromacs/utility/basedefinitions.h" namespace gmx { diff --git a/src/gromacs/mdtypes/commrec.h b/src/gromacs/mdtypes/commrec.h index 1a983e2c04..9213187567 100644 --- a/src/gromacs/mdtypes/commrec.h +++ b/src/gromacs/mdtypes/commrec.h @@ -40,7 +40,6 @@ #include -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/gmxmpi.h" diff --git a/src/gromacs/mdtypes/energyhistory.h b/src/gromacs/mdtypes/energyhistory.h index 638ba98ed0..d86ddd98b1 100644 --- a/src/gromacs/mdtypes/energyhistory.h +++ b/src/gromacs/mdtypes/energyhistory.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2015,2016,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2015,2016,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,7 +51,6 @@ #include #include -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" //! \cond INTERNAL @@ -74,7 +73,7 @@ public: //! Lambda at start time double start_lambda; //! Whether the lambda value is set. Here for backward-compatibility. - gmx_bool start_lambda_set; + bool start_lambda_set; //! Read / write data from / to checkpoint object template diff --git a/src/gromacs/mdtypes/fcdata.h b/src/gromacs/mdtypes/fcdata.h index e8de62a0b6..2f36599bee 100644 --- a/src/gromacs/mdtypes/fcdata.h +++ b/src/gromacs/mdtypes/fcdata.h @@ -42,7 +42,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/idef.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" enum class DistanceRestraintWeighting : int; @@ -53,7 +52,7 @@ typedef real rvec5[5]; typedef struct t_disresdata { DistanceRestraintWeighting dr_weighting; /* Weighting of pairs in one restraint */ - gmx_bool dr_bMixed; /* Use sqrt of the instantaneous times * + bool dr_bMixed; /* Use sqrt of the instantaneous times * * the time averaged violation */ real dr_fc; /* Force constant for disres, * * which is multiplied by a (possibly) * diff --git a/src/gromacs/mdtypes/forcebuffers.h b/src/gromacs/mdtypes/forcebuffers.h index c23f02be81..9c49e2f00a 100644 --- a/src/gromacs/mdtypes/forcebuffers.h +++ b/src/gromacs/mdtypes/forcebuffers.h @@ -50,12 +50,14 @@ #include #include "gromacs/gpu_utils/hostallocator.h" -#include "gromacs/math/arrayrefwithpadding.h" #include "gromacs/math/vectypes.h" -#include "gromacs/utility/arrayref.h" namespace gmx { +template +class ArrayRef; +template +class ArrayRefWithPadding; enum class PinningPolicy : int; diff --git a/src/gromacs/mdtypes/forcerec.h b/src/gromacs/mdtypes/forcerec.h index 72d5e855df..f6404b4848 100644 --- a/src/gromacs/mdtypes/forcerec.h +++ b/src/gromacs/mdtypes/forcerec.h @@ -46,7 +46,6 @@ #include "gromacs/mdtypes/md_enums.h" #include "gromacs/pbcutil/pbc.h" #include "gromacs/utility/arrayref.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" #include "locality.h" diff --git a/src/gromacs/mdtypes/group.h b/src/gromacs/mdtypes/group.h index dcdb25414e..49ece65476 100644 --- a/src/gromacs/mdtypes/group.h +++ b/src/gromacs/mdtypes/group.h @@ -40,7 +40,6 @@ #include #include "gromacs/math/vectypes.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" #include "gromacs/utility/smalloc.h" diff --git a/src/gromacs/mdtypes/inputrec.h b/src/gromacs/mdtypes/inputrec.h index c61e7c3e8a..edc6b79769 100644 --- a/src/gromacs/mdtypes/inputrec.h +++ b/src/gromacs/mdtypes/inputrec.h @@ -45,7 +45,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/mdtypes/md_enums.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/enumerationhelpers.h" #include "gromacs/utility/real.h" @@ -145,7 +144,7 @@ struct t_lambda //! Free energy soft-core sigma for ????? real sc_sigma_min; //! Use softcore for the coulomb portion as well (default FALSE) - gmx_bool bScCoul; + bool bScCoul; //! Whether to print the dvdl term associated with this term; if it is not specified as separate, it is lumped with the FEP term gmx::EnumerationArray separate_dvdl; //! Whether to write a separate dhdl.xvg file note: NOT a gmx_bool, but an enum @@ -181,7 +180,7 @@ struct t_expanded //! Random number seed for lambda mc switches int lmc_seed; //! Whether to use minumum variance weighting - gmx_bool minvar; + bool minvar; //! The number of samples needed before kicking into minvar routine int minvarmin; //! The offset for the variance in MinVar @@ -189,7 +188,7 @@ struct t_expanded //! Range of cvalues used for BAR int c_range; //! Whether to print symmetrized matrices - gmx_bool bSymmetrizedTMatrix; + bool bSymmetrizedTMatrix; //! How frequently to print the transition matrices int nstTij; //! Number of repetitions in the MC lambda jumps MRS -- VERIFY THIS @@ -205,9 +204,9 @@ struct t_expanded //! Starting delta for Wang-Landau real init_wl_delta; //! Use one over t convergence for Wang-Landau when the delta get sufficiently small - gmx_bool bWLoneovert; + bool bWLoneovert; //! Did we initialize the weights? TODO: REMOVE FOR 5.0, no longer needed with new logic - gmx_bool bInit_weights; + bool bInit_weights; //! To override the main temperature, or define it if it's not defined real mc_temp; //! User-specified initial weights to start with @@ -285,7 +284,7 @@ struct t_swapcoords //! Period between when a swap is attempted int nstswap; //! Use mass-weighted positions in split group - gmx_bool massw_split[2]; + bool massw_split[2]; /*! \brief Split cylinders defined by radius, upper and lower * extension. The split cylinders define the channels and are * each anchored in the center of the split group */ @@ -378,13 +377,13 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) //! Periodic molecules bool bPeriodicMols; //! Continuation run: starting state is correct (ie. constrained) - gmx_bool bContinuation; + bool bContinuation; //! Temperature coupling TemperatureCoupling etc; //! Interval in steps for temperature coupling int nsttcouple; //! Whether to print nose-hoover chains - gmx_bool bPrintNHChains; + bool bPrintNHChains; //! Pressure coupling PressureCoupling epc; //! Pressure coupling type @@ -444,11 +443,11 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) //! Data for the FEP state std::unique_ptr fepvals; //! Whether to do simulated tempering - gmx_bool bSimTemp; + bool bSimTemp; //! Variables for simulated tempering std::unique_ptr simtempvals; //! Whether expanded ensembles are used - gmx_bool bExpanded; + bool bExpanded; //! Expanded ensemble parameters std::unique_ptr expandedvals; //! Type of distance restraining @@ -458,7 +457,7 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) //! Type of weighting of pairs in one restraints DistanceRestraintWeighting eDisreWeighting; //! Use combination of time averaged and instantaneous violations - gmx_bool bDisreMixed; + bool bDisreMixed; //! Frequency of writing pair distances to enx int nstdisreout; //! Time constant for memory function in disres @@ -490,7 +489,7 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) //! Number of iterations in the final LINCS step int nLincsIter; //! Use successive overrelaxation for shake - gmx_bool bShakeSOR; + bool bShakeSOR; //! Friction coefficient for BD (amu/ps) real bd_fric; //! Random seed for SD and BD @@ -510,19 +509,19 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) /* COM pulling data */ //! Do we do COM pulling? - gmx_bool bPull; + bool bPull; //! The data for center of mass pulling std::unique_ptr pull; /* AWH bias data */ //! Whether to use AWH biasing for PMF calculations - gmx_bool bDoAwh; + bool bDoAwh; //! AWH biasing parameters std::unique_ptr awhParams; /* Enforced rotation data */ //! Whether to calculate enforced rotation potential(s) - gmx_bool bRot; + bool bRot; //! The data for enforced rotation potentials t_rot* rot; @@ -532,7 +531,7 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) t_swapcoords* swap; //! Whether the tpr makes an interactive MD session possible. - gmx_bool bIMD; + bool bIMD; //! Interactive molecular dynamics t_IMD* imd; @@ -554,13 +553,13 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) //! Group options t_grpopts opts; //! QM/MM calculation - gmx_bool bQMMM; + bool bQMMM; /* Fields for removed features go here (better caching) */ //! Whether AdResS is enabled - always false if a valid .tpr was read - gmx_bool bAdress; + bool bAdress; //! Whether twin-range scheme is active - always false if a valid .tpr was read - gmx_bool useTwinRange; + bool useTwinRange; //! Whether we have constant acceleration - removed in GROMACS 2022 bool useConstantAcceleration; @@ -582,30 +581,30 @@ int pcouple_min_integration_steps(PressureCoupling epc); int ir_optimal_nstpcouple(const t_inputrec* ir); /* Returns if the Coulomb force or potential is switched to zero */ -gmx_bool ir_coulomb_switched(const t_inputrec* ir); +bool ir_coulomb_switched(const t_inputrec* ir); /* Returns if the Coulomb interactions are zero beyond the rcoulomb. * Note: always returns TRUE for the Verlet cut-off scheme. */ -gmx_bool ir_coulomb_is_zero_at_cutoff(const t_inputrec* ir); +bool ir_coulomb_is_zero_at_cutoff(const t_inputrec* ir); /* As ir_coulomb_is_zero_at_cutoff, but also returns TRUE for user tabulated * interactions, since these might be zero beyond rcoulomb. */ -gmx_bool ir_coulomb_might_be_zero_at_cutoff(const t_inputrec* ir); +bool ir_coulomb_might_be_zero_at_cutoff(const t_inputrec* ir); /* Returns if the Van der Waals force or potential is switched to zero */ -gmx_bool ir_vdw_switched(const t_inputrec* ir); +bool ir_vdw_switched(const t_inputrec* ir); /* Returns if the Van der Waals interactions are zero beyond the rvdw. * Note: always returns TRUE for the Verlet cut-off scheme. */ -gmx_bool ir_vdw_is_zero_at_cutoff(const t_inputrec* ir); +bool ir_vdw_is_zero_at_cutoff(const t_inputrec* ir); /* As ir_vdw_is_zero_at_cutoff, but also returns TRUE for user tabulated * interactions, since these might be zero beyond rvdw. */ -gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec* ir); +bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec* ir); /*! \brief Free memory from input record. * @@ -615,30 +614,30 @@ gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec* ir); */ void done_inputrec(t_inputrec* ir); -void pr_inputrec(FILE* fp, int indent, const char* title, const t_inputrec* ir, gmx_bool bMDPformat); +void pr_inputrec(FILE* fp, int indent, const char* title, const t_inputrec* ir, bool bMDPformat); void cmp_inputrec(FILE* fp, const t_inputrec* ir1, const t_inputrec* ir2, real ftol, real abstol); void comp_pull_AB(FILE* fp, const pull_params_t& pull, real ftol, real abstol); -gmx_bool inputrecDeform(const t_inputrec* ir); +bool inputrecDeform(const t_inputrec* ir); -gmx_bool inputrecDynamicBox(const t_inputrec* ir); +bool inputrecDynamicBox(const t_inputrec* ir); -gmx_bool inputrecPreserveShape(const t_inputrec* ir); +bool inputrecPreserveShape(const t_inputrec* ir); -gmx_bool inputrecNeedMutot(const t_inputrec* ir); +bool inputrecNeedMutot(const t_inputrec* ir); -gmx_bool inputrecTwinRange(const t_inputrec* ir); +bool inputrecTwinRange(const t_inputrec* ir); -gmx_bool inputrecExclForces(const t_inputrec* ir); +bool inputrecExclForces(const t_inputrec* ir); -gmx_bool inputrecNptTrotter(const t_inputrec* ir); +bool inputrecNptTrotter(const t_inputrec* ir); -gmx_bool inputrecNvtTrotter(const t_inputrec* ir); +bool inputrecNvtTrotter(const t_inputrec* ir); -gmx_bool inputrecNphTrotter(const t_inputrec* ir); +bool inputrecNphTrotter(const t_inputrec* ir); /*! \brief Return true if the simulation is 2D periodic with two walls. */ bool inputrecPbcXY2Walls(const t_inputrec* ir); diff --git a/src/gromacs/mdtypes/interaction_const.h b/src/gromacs/mdtypes/interaction_const.h index e112758411..ce70634b8e 100644 --- a/src/gromacs/mdtypes/interaction_const.h +++ b/src/gromacs/mdtypes/interaction_const.h @@ -41,7 +41,6 @@ #include "gromacs/mdtypes/md_enums.h" #include "gromacs/utility/alignedallocator.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct t_lambda; diff --git a/src/gromacs/mdtypes/md_enums.h b/src/gromacs/mdtypes/md_enums.h index 58a99ab465..8e69ed9f1f 100644 --- a/src/gromacs/mdtypes/md_enums.h +++ b/src/gromacs/mdtypes/md_enums.h @@ -46,8 +46,6 @@ #ifndef GMX_MDTYPES_MD_ENUMS_H #define GMX_MDTYPES_MD_ENUMS_H -#include "gromacs/utility/basedefinitions.h" - /*! \brief Return a string from a list of strings * * If index if within 0 .. max_index-1 returns the corresponding string diff --git a/src/gromacs/mdtypes/mdatom.h b/src/gromacs/mdtypes/mdatom.h index 50787aee9f..91ee9f00d7 100644 --- a/src/gromacs/mdtypes/mdatom.h +++ b/src/gromacs/mdtypes/mdatom.h @@ -45,7 +45,6 @@ #define GMX_MDTYPES_MDATOM_H #include "gromacs/math/vectypes.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" enum class ParticleType : int; @@ -65,11 +64,11 @@ typedef struct t_mdatoms //! Number of energy groups int nenergrp; //! Do we have multiple center of mass motion removal groups - gmx_bool bVCMgrps; + bool bVCMgrps; //! Do we have any virtual sites? - gmx_bool haveVsites; + bool haveVsites; //! Do we have atoms that are frozen along 1 or 2 (not 3) dimensions? - gmx_bool havePartiallyFrozenAtoms; + bool havePartiallyFrozenAtoms; //! Number of perturbed atoms int nPerturbed; //! Number of atoms for which the mass is perturbed @@ -79,7 +78,7 @@ typedef struct t_mdatoms //! Number of atoms for which the type is perturbed int nTypePerturbed; //! Do we have orientation restraints - gmx_bool bOrires; + bool bOrires; //! Atomic mass in A state real* massA; //! Atomic mass in B state @@ -107,7 +106,7 @@ typedef struct t_mdatoms //! Van der Waals radius sigma^3 in the B state real* sigma3B; //! Is this atom perturbed - gmx_bool* bPerturbed; + bool* bPerturbed; //! Type of atom in the A state int* typeA; //! Type of atom in the B state diff --git a/src/gromacs/mdtypes/state.h b/src/gromacs/mdtypes/state.h index bef760925a..8998b75abc 100644 --- a/src/gromacs/mdtypes/state.h +++ b/src/gromacs/mdtypes/state.h @@ -63,8 +63,6 @@ #include "gromacs/math/paddedvector.h" #include "gromacs/math/vectypes.h" #include "gromacs/mdtypes/md_enums.h" -#include "gromacs/utility/arrayref.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/enumerationhelpers.h" #include "gromacs/utility/real.h" @@ -173,7 +171,7 @@ class ekinstate_t public: ekinstate_t(); - gmx_bool bUpToDate; //!< Test if all data is up to date + bool bUpToDate; //!< Test if all data is up to date int ekin_n; //!< The number of tensors tensor* ekinh; //!< Half step Ekin, size \p ekin_n tensor* ekinf; //!< Full step Ekin, size \p ekin_n @@ -208,10 +206,10 @@ typedef struct df_history_t { int nlambda; //!< total number of lambda states - for history - gmx_bool bEquil; //!< Have we reached equilibration - int* n_at_lam; //!< number of points observed at each lambda - real* wl_histo; //!< histogram for WL flatness determination - real wl_delta; //!< current wang-landau delta + bool bEquil; //!< Have we reached equilibration + int* n_at_lam; //!< number of points observed at each lambda + real* wl_histo; //!< histogram for WL flatness determination + real wl_delta; //!< current wang-landau delta real* sum_weights; //!< weights of the states real* sum_dg; //!< free energies of the states -- not actually used for weighting, but informational @@ -318,7 +316,7 @@ void state_change_natoms(t_state* state, int natoms); void init_dfhist_state(t_state* state, int dfhistNumLambda); /*! \brief Compares two states, write the differences to stdout */ -void comp_state(const t_state* st1, const t_state* st2, gmx_bool bRMSD, real ftol, real abstol); +void comp_state(const t_state* st1, const t_state* st2, bool bRMSD, real ftol, real abstol); /*! \brief Allocates an rvec pointer and copy the contents of v to it */ rvec* makeRvecArray(gmx::ArrayRef v, gmx::index n); diff --git a/src/gromacs/onlinehelp/helpformat.cpp b/src/gromacs/onlinehelp/helpformat.cpp index 5606252734..079d4cec8c 100644 --- a/src/gromacs/onlinehelp/helpformat.cpp +++ b/src/gromacs/onlinehelp/helpformat.cpp @@ -2,7 +2,7 @@ * This file is part of the GROMACS molecular simulation package. * * Copyright (c) 2012,2013,2014,2016,2017 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -51,6 +51,7 @@ #include "gromacs/onlinehelp/helpwritercontext.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/stringutil.h" +#include "gromacs/utility/basedefinitions.h" namespace gmx { diff --git a/src/gromacs/pbcutil/pbc.h b/src/gromacs/pbcutil/pbc.h index 1a67c9b98f..17ccfbcf5a 100644 --- a/src/gromacs/pbcutil/pbc.h +++ b/src/gromacs/pbcutil/pbc.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2012,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -43,7 +43,6 @@ #include #include "gromacs/math/vectypes.h" -#include "gromacs/utility/arrayref.h" #include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/enumerationhelpers.h" #include "gromacs/utility/real.h" @@ -51,6 +50,12 @@ struct gmx_domdec_t; struct gmx_mtop_t; +namespace gmx +{ +template +class ArrayRef; +} // namespace gmx + //! Enumeration that contains all supported periodic boundary setups. enum class PbcType : int { @@ -195,7 +200,7 @@ PbcType guessPbcType(const matrix box); * \param[in] box The simulation cell * \return TRUE when the box was corrected. */ -gmx_bool correct_box(FILE* fplog, int step, tensor box); +bool correct_box(FILE* fplog, int step, tensor box); /*! \brief Initiate the periodic boundary condition algorithms. * @@ -228,7 +233,7 @@ void set_pbc(t_pbc* pbc, PbcType pbcType, const matrix box); * \param[in] box The box tensor * \return the pbc structure when pbc operations are required, NULL otherwise. */ -t_pbc* set_pbc_dd(t_pbc* pbc, PbcType pbcType, const ivec domdecCells, gmx_bool bSingleDir, const matrix box); +t_pbc* set_pbc_dd(t_pbc* pbc, PbcType pbcType, const ivec domdecCells, bool bSingleDir, const matrix box); /*! \brief Compute distance with PBC * diff --git a/src/gromacs/selection/nbsearch.h b/src/gromacs/selection/nbsearch.h index 97edcc5731..5a445784b7 100644 --- a/src/gromacs/selection/nbsearch.h +++ b/src/gromacs/selection/nbsearch.h @@ -55,6 +55,7 @@ #include "gromacs/math/vec.h" #include "gromacs/math/vectypes.h" #include "gromacs/utility/arrayref.h" +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/real.h" diff --git a/src/gromacs/topology/block.h b/src/gromacs/topology/block.h index 10fee47a24..0acf7f49b3 100644 --- a/src/gromacs/topology/block.h +++ b/src/gromacs/topology/block.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2015,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2010,2014,2015,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -41,7 +41,6 @@ #include -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" #include "gromacs/utility/range.h" diff --git a/src/gromacs/topology/idef.h b/src/gromacs/topology/idef.h index 40a4913cfb..1fb0a2fc2d 100644 --- a/src/gromacs/topology/idef.h +++ b/src/gromacs/topology/idef.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2018 by the GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -45,7 +45,6 @@ #include "gromacs/math/vectypes.h" #include "gromacs/topology/ifunc.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_ffparams_t; @@ -459,10 +458,10 @@ void pr_ilist(FILE* fp, const char* title, const t_functype* functype, const InteractionList& ilist, - gmx_bool bShowNumbers, - gmx_bool bShowParameters, + bool bShowNumbers, + bool bShowParameters, const t_iparams* iparams); -void pr_idef(FILE* fp, int indent, const char* title, const t_idef* idef, gmx_bool bShowNumbers, gmx_bool bShowParameters); +void pr_idef(FILE* fp, int indent, const char* title, const t_idef* idef, bool bShowNumbers, bool bShowParameters); /*! \brief * Properly initialize idef struct. diff --git a/src/gromacs/topology/mtop_util.h b/src/gromacs/topology/mtop_util.h index 9d7330226a..e4615c46bb 100644 --- a/src/gromacs/topology/mtop_util.h +++ b/src/gromacs/topology/mtop_util.h @@ -46,7 +46,6 @@ #include #include "gromacs/topology/topology.h" -#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/enumerationhelpers.h" struct gmx_localtop_t; diff --git a/src/gromacs/topology/symtab.h b/src/gromacs/topology/symtab.h index 826fb86eb3..6ffbcdff15 100644 --- a/src/gromacs/topology/symtab.h +++ b/src/gromacs/topology/symtab.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010,2014,2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2010,2014,2017,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -54,6 +54,7 @@ #include #include +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" struct t_commrec; diff --git a/src/gromacs/utility/fixedcapacityvector.h b/src/gromacs/utility/fixedcapacityvector.h index ace651cdeb..36ea649f08 100644 --- a/src/gromacs/utility/fixedcapacityvector.h +++ b/src/gromacs/utility/fixedcapacityvector.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -46,6 +46,7 @@ #include #include +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" namespace gmx diff --git a/src/gromacs/utility/range.h b/src/gromacs/utility/range.h index 01d13705c4..d8f344a708 100644 --- a/src/gromacs/utility/range.h +++ b/src/gromacs/utility/range.h @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -45,6 +45,7 @@ #include +#include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/gmxassert.h" namespace gmx