Add trivial const qualifiers for inputrec
authorPascal Merz <pascal.merz@me.com>
Thu, 7 Jan 2021 10:10:27 +0000 (10:10 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 7 Jan 2021 10:10:27 +0000 (10:10 +0000)
Refs #3854

src/gromacs/mdlib/energyoutput.cpp
src/gromacs/mdlib/energyoutput.h
src/gromacs/mdlib/trajectory_writing.cpp
src/gromacs/mdlib/trajectory_writing.h
src/gromacs/mdrun/minimize.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/swap/swapcoords.h

index daa1da99f8b0bef20464491d5871e1e842942b9a..146d520b7d1643d8ab5131621c46e47320f6b482 100644 (file)
@@ -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.
@@ -1320,7 +1320,7 @@ void EnergyOutput::printStepToEnergyFile(ener_file* fp_ene,
     }
 }
 
-void EnergyOutput::printAnnealingTemperatures(FILE* log, const SimulationGroups* groups, t_grpopts* opts)
+void EnergyOutput::printAnnealingTemperatures(FILE* log, const SimulationGroups* groups, const t_grpopts* opts)
 {
     if (log)
     {
index aa3ee609fcff82103bd1817405f4b0036d9c49ba..e0e2fa85711c881d31b77e815dab30f6d709b881 100644 (file)
@@ -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.
@@ -240,7 +240,7 @@ public:
      * \param[in] opts    Atom temperature coupling groups options
      *                    (annealing is done by groups).
      */
-    static void printAnnealingTemperatures(FILE* log, const SimulationGroups* groups, t_grpopts* opts);
+    static void printAnnealingTemperatures(FILE* log, const SimulationGroups* groups, const t_grpopts* opts);
 
     /*! \brief Prints average values to log file.
      *
index 3883006ca1ae77fc19d61262af36b286dd390d6d..405174ef7fc228d57602f36bf86c8a390bc5fba4 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013,2014,2015,2016,2017, 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.
@@ -62,7 +62,7 @@ void do_md_trajectory_writing(FILE*                          fplog,
                               int64_t                        step,
                               int64_t                        step_rel,
                               double                         t,
-                              t_inputrec*                    ir,
+                              const t_inputrec*              ir,
                               t_state*                       state,
                               t_state*                       state_global,
                               ObservablesHistory*            observablesHistory,
index a74c707e778abf205d4f755850cfc15cda2eca03..bb2da643831c590d5ccfb75edf6103c18c13c600 100644 (file)
@@ -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.
@@ -67,7 +67,7 @@ void do_md_trajectory_writing(FILE*                          fplog,
                               int64_t                        step,
                               int64_t                        step_rel,
                               double                         t,
-                              t_inputrec*                    ir,
+                              const t_inputrec*              ir,
                               t_state*                       state,
                               t_state*                       state_global,
                               ObservablesHistory*            observablesHistory,
index 7415046e1a97ca86e70f89054ee4102571027d86..c71f86ba1ad0a3064e5325ca66bd731c324ca2a6 100644 (file)
@@ -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 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.
@@ -259,7 +259,7 @@ static void print_converged(FILE*             fp,
 
 //! Compute the norm and max of the force array in parallel
 static void get_f_norm_max(const t_commrec*               cr,
-                           t_grpopts*                     opts,
+                           const t_grpopts*               opts,
                            t_mdatoms*                     mdatoms,
                            gmx::ArrayRef<const gmx::RVec> f,
                            real*                          fnorm,
@@ -356,7 +356,7 @@ static void get_f_norm_max(const t_commrec*               cr,
 }
 
 //! Compute the norm of the force
-static void get_state_f_norm_max(const t_commrec* cr, t_grpopts* opts, t_mdatoms* mdatoms, em_state_t* ems)
+static void get_state_f_norm_max(const t_commrec* cr, const t_grpopts* opts, t_mdatoms* mdatoms, em_state_t* ems)
 {
     get_f_norm_max(cr, opts, mdatoms, ems->f.view().force(), &ems->fnorm, &ems->fmax, &ems->a_fmax);
 }
@@ -366,7 +366,7 @@ static void init_em(FILE*                fplog,
                     const gmx::MDLogger& mdlog,
                     const char*          title,
                     const t_commrec*     cr,
-                    t_inputrec*          ir,
+                    const t_inputrec*    ir,
                     gmx::ImdSession*     imdSession,
                     pull_t*              pull_work,
                     t_state*             state_global,
@@ -546,7 +546,7 @@ static void write_em_traj(FILE*               fplog,
                           gmx_bool            bF,
                           const char*         confout,
                           const gmx_mtop_t*   top_global,
-                          t_inputrec*         ir,
+                          const t_inputrec*   ir,
                           int64_t             step,
                           em_state_t*         state,
                           t_state*            state_global,
@@ -624,7 +624,7 @@ static void write_em_traj(FILE*               fplog,
 //
 // \returns true when the step succeeded, false when a constraint error occurred
 static bool do_em_step(const t_commrec*                          cr,
-                       t_inputrec*                               ir,
+                       const t_inputrec*                         ir,
                        t_mdatoms*                                md,
                        em_state_t*                               ems1,
                        real                                      a,
@@ -782,7 +782,7 @@ static void em_dd_partition_system(FILE*                fplog,
                                    int                  step,
                                    const t_commrec*     cr,
                                    const gmx_mtop_t*    top_global,
-                                   t_inputrec*          ir,
+                                   const t_inputrec*    ir,
                                    gmx::ImdSession*     imdSession,
                                    pull_t*              pull_work,
                                    em_state_t*          ems,
@@ -859,7 +859,7 @@ public:
     //! Holds the domain topology.
     gmx_localtop_t* top;
     //! User input options.
-    t_inputrec* inputrec;
+    const t_inputrec* inputrec;
     //! The Interactive Molecular Dynamics session.
     gmx::ImdSession* imdSession;
     //! The pull work object.
@@ -1049,7 +1049,7 @@ void EnergyEvaluator::run(em_state_t* ems, rvec mu_tot, tensor vir, tensor pres,
 
 //! Parallel utility summing energies and forces
 static double reorder_partsum(const t_commrec*  cr,
-                              t_grpopts*        opts,
+                              const t_grpopts*  opts,
                               const gmx_mtop_t* top_global,
                               const em_state_t* s_min,
                               const em_state_t* s_b)
@@ -1110,7 +1110,7 @@ static double reorder_partsum(const t_commrec*  cr,
 
 //! Print some stuff, like beta, whatever that means.
 static real pr_beta(const t_commrec*  cr,
-                    t_grpopts*        opts,
+                    const t_grpopts*  opts,
                     t_mdatoms*        mdatoms,
                     const gmx_mtop_t* top_global,
                     const em_state_t* s_min,
index 9dbac86f6d08671732795d763ec6cebb196542cc..0bf9ba8ea3f30bd4a22b1bb3a328dce60b49b55b 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * 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.
@@ -546,20 +546,20 @@ static void get_compartment_boundaries(int c, t_swap* s, const matrix box, real*
  *
  * \endcode
  */
-static void detect_flux_per_channel(t_swapgrp*     g,
-                                    int            iAtom,
-                                    int            comp,
-                                    rvec           atomPosition,
-                                    unsigned char* comp_now,
-                                    unsigned char* comp_from,
-                                    unsigned char* channel_label,
-                                    t_swapcoords*  sc,
-                                    t_swap*        s,
-                                    real           cyl0_r2,
-                                    real           cyl1_r2,
-                                    int64_t        step,
-                                    gmx_bool       bRerun,
-                                    FILE*          fpout)
+static void detect_flux_per_channel(t_swapgrp*          g,
+                                    int                 iAtom,
+                                    int                 comp,
+                                    rvec                atomPosition,
+                                    unsigned char*      comp_now,
+                                    unsigned char*      comp_from,
+                                    unsigned char*      channel_label,
+                                    const t_swapcoords* sc,
+                                    t_swap*             s,
+                                    real                cyl0_r2,
+                                    real                cyl1_r2,
+                                    int64_t             step,
+                                    gmx_bool            bRerun,
+                                    FILE*               fpout)
 {
     int      sd, chan_nr;
     gmx_bool in_cyl0, in_cyl1;
@@ -687,15 +687,15 @@ static void detect_flux_per_channel(t_swapgrp*     g,
 
 
 /*! \brief Determines which ions or solvent molecules are in compartment A and B */
-static void sortMoleculesIntoCompartments(t_swapgrp*    g,
-                                          t_commrec*    cr,
-                                          t_swapcoords* sc,
-                                          t_swap*       s,
-                                          const matrix  box,
-                                          int64_t       step,
-                                          FILE*         fpout,
-                                          gmx_bool      bRerun,
-                                          gmx_bool      bIsSolvent)
+static void sortMoleculesIntoCompartments(t_swapgrp*          g,
+                                          t_commrec*          cr,
+                                          const t_swapcoords* sc,
+                                          t_swap*             s,
+                                          const matrix        box,
+                                          int64_t             step,
+                                          FILE*               fpout,
+                                          gmx_bool            bRerun,
+                                          gmx_bool            bIsSolvent)
 {
     int  nMolNotInComp[eCompNR]; /* consistency check */
     real cyl0_r2 = sc->cyl0r * sc->cyl0r;
@@ -1897,7 +1897,7 @@ void finish_swapcoords(t_swap* s)
  * From the requested and average molecule counts we determine whether a swap is needed
  * at this time step.
  */
-static gmx_bool need_swap(t_swapcoords* sc, t_swap* s)
+static gmx_bool need_swap(const t_swapcoords* sc, t_swap* s)
 {
     int        ic, ig;
     t_swapgrp* g;
@@ -2007,30 +2007,28 @@ static void apply_modified_positions(swap_group* g, rvec x[])
 }
 
 
-gmx_bool do_swapcoords(t_commrec*     cr,
-                       int64_t        step,
-                       double         t,
-                       t_inputrec*    ir,
-                       t_swap*        s,
-                       gmx_wallcycle* wcycle,
-                       rvec           x[],
-                       matrix         box,
-                       gmx_bool       bVerbose,
-                       gmx_bool       bRerun)
+gmx_bool do_swapcoords(t_commrec*        cr,
+                       int64_t           step,
+                       double            t,
+                       const t_inputrec* ir,
+                       t_swap*           s,
+                       gmx_wallcycle*    wcycle,
+                       rvec              x[],
+                       matrix            box,
+                       gmx_bool          bVerbose,
+                       gmx_bool          bRerun)
 {
-    t_swapcoords* sc;
-    int           j, ic, ig, nswaps;
-    int           thisC, otherC; /* Index into this compartment and the other one */
-    gmx_bool      bSwap = FALSE;
-    t_swapgrp *   g, *gsol;
-    int           isol, iion;
-    rvec          com_solvent, com_particle; /* solvent and swap molecule's center of mass */
+    const t_swapcoords* sc = ir->swap;
+    int                 j, ic, ig, nswaps;
+    int                 thisC, otherC; /* Index into this compartment and the other one */
+    gmx_bool            bSwap = FALSE;
+    t_swapgrp *         g, *gsol;
+    int                 isol, iion;
+    rvec                com_solvent, com_particle; /* solvent and swap molecule's center of mass */
 
 
     wallcycle_start(wcycle, ewcSWAP);
 
-    sc = ir->swap;
-
     set_pbc(s->pbc, ir->pbcType, box);
 
     /* Assemble the positions of the split groups, i.e. the channels.
index 6cfdd53fd4dced594a64809f95e18e0abc450b40..cafddc68c2255cf9fdaa78b6c9dd1be4fade9bee 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2013, 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.
@@ -139,15 +139,15 @@ void finish_swapcoords(t_swap* s);
  *
  * \returns Whether at least one pair of molecules was swapped.
  */
-gmx_bool do_swapcoords(t_commrec*     cr,
-                       int64_t        step,
-                       double         t,
-                       t_inputrec*    ir,
-                       t_swap*        s,
-                       gmx_wallcycle* wcycle,
-                       rvec           x[],
-                       matrix         box,
-                       gmx_bool       bVerbose,
-                       gmx_bool       bRerun);
+gmx_bool do_swapcoords(t_commrec*        cr,
+                       int64_t           step,
+                       double            t,
+                       const t_inputrec* ir,
+                       t_swap*           s,
+                       gmx_wallcycle*    wcycle,
+                       rvec              x[],
+                       matrix            box,
+                       gmx_bool          bVerbose,
+                       gmx_bool          bRerun);
 
 #endif