Removed types/inputrec.h from typedefs.h and releted cleanups.
authorDavid van der Spoel <spoel@xray.bmc.uu.se>
Sun, 27 Sep 2015 20:48:09 +0000 (22:48 +0200)
committerDavid van der Spoel <spoel@xray.bmc.uu.se>
Tue, 29 Sep 2015 22:24:32 +0000 (00:24 +0200)
Since this is used in quite a lot of C code it was necessary to
insert a couple of "struct" in header files. Also moved init_inputrec
and done_inputrec to inputrec.cpp from typedefs.cpp. Removed useless
extern for functions in imd.cpp.

Change-Id: I96d01538c1eeef4b291a571d4d11f864340dd881

30 files changed:
src/gromacs/fileio/tpxio.cpp
src/gromacs/gmxana/gmx_traj.cpp
src/gromacs/gmxlib/inputrec.cpp
src/gromacs/gmxlib/typedefs.cpp
src/gromacs/gmxpreprocess/readadress.cpp
src/gromacs/gmxpreprocess/readir.h
src/gromacs/imd/imd.cpp
src/gromacs/imd/imd.h
src/gromacs/legacyheaders/force.h
src/gromacs/legacyheaders/genborn.h
src/gromacs/legacyheaders/inputrec.h
src/gromacs/legacyheaders/mdrun.h
src/gromacs/legacyheaders/tgroup.h
src/gromacs/legacyheaders/typedefs.h
src/gromacs/legacyheaders/types/inputrec.h
src/gromacs/legacyheaders/update.h
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/listed-forces/listed-forces.h
src/gromacs/listed-forces/position-restraints.h
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/calc_verletbuf.cpp
src/gromacs/mdlib/compute_io.cpp
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/wall.cpp
src/gromacs/pulling/pull.h
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/pulling/pull_rotation.h
src/gromacs/swap/swapcoords.cpp
src/gromacs/swap/swapcoords.h
src/programs/mdrun/resource-division.cpp

index 9d360d169a997c7faee99355860a4c113bbff478..5e8d2929a4e013e57ba02444131bdeae1cdf3ed9 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/fileio/gmxfio.h"
 #include "gromacs/fileio/gmxfio-xdr.h"
 #include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/inputrec.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/ifunc.h"
index 3fe6197d3545b6e090247ff2d4900f710913a52b..aa77634f211f4a93754ca3a478ed973cc9b52780 100644 (file)
@@ -50,6 +50,7 @@
 #include "gromacs/fileio/xvgr.h"
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/enums.h"
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
index 467cca9dd58852a003faa7a0517c875d7e04682c..f3d8c86245287a1dc2ae1dec373b0e7d9d0f0135 100644 (file)
 
 #include "gromacs/legacyheaders/inputrec.h"
 
+#include <cstring>
+
 #include <algorithm>
 
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/utility/fatalerror.h"
-
+#include "gromacs/utility/smalloc.h"
 
 /* The minimum number of integration steps required for reasonably accurate
  * integration of first and second order coupling algorithms.
@@ -237,3 +239,86 @@ gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec *ir)
 {
     return (ir_vdw_is_zero_at_cutoff(ir) || ir->vdwtype == evdwUSER);
 }
+
+void init_inputrec(t_inputrec *ir)
+{
+    std::memset(ir, 0, sizeof(*ir));
+    snew(ir->fepvals, 1);
+    snew(ir->expandedvals, 1);
+    snew(ir->simtempvals, 1);
+}
+
+static void done_pull_group(t_pull_group *pgrp)
+{
+    if (pgrp->nat > 0)
+    {
+        sfree(pgrp->ind);
+        sfree(pgrp->weight);
+    }
+}
+
+static void done_pull_params(pull_params_t *pull)
+{
+    int i;
+
+    for (i = 0; i < pull->ngroup+1; i++)
+    {
+        done_pull_group(pull->group);
+    }
+
+    sfree(pull->group);
+    sfree(pull->coord);
+}
+
+void done_inputrec(t_inputrec *ir)
+{
+    int m;
+
+    for (m = 0; (m < DIM); m++)
+    {
+        if (ir->ex[m].a)
+        {
+            sfree(ir->ex[m].a);
+        }
+        if (ir->ex[m].phi)
+        {
+            sfree(ir->ex[m].phi);
+        }
+        if (ir->et[m].a)
+        {
+            sfree(ir->et[m].a);
+        }
+        if (ir->et[m].phi)
+        {
+            sfree(ir->et[m].phi);
+        }
+    }
+
+    sfree(ir->opts.nrdf);
+    sfree(ir->opts.ref_t);
+    sfree(ir->opts.annealing);
+    sfree(ir->opts.anneal_npoints);
+    sfree(ir->opts.anneal_time);
+    sfree(ir->opts.anneal_temp);
+    sfree(ir->opts.tau_t);
+    sfree(ir->opts.acc);
+    sfree(ir->opts.nFreeze);
+    sfree(ir->opts.QMmethod);
+    sfree(ir->opts.QMbasis);
+    sfree(ir->opts.QMcharge);
+    sfree(ir->opts.QMmult);
+    sfree(ir->opts.bSH);
+    sfree(ir->opts.CASorbitals);
+    sfree(ir->opts.CASelectrons);
+    sfree(ir->opts.SAon);
+    sfree(ir->opts.SAoff);
+    sfree(ir->opts.SAsteps);
+    sfree(ir->opts.bOPT);
+    sfree(ir->opts.bTS);
+
+    if (ir->pull)
+    {
+        done_pull_params(ir->pull);
+        sfree(ir->pull);
+    }
+}
index 4843769db596b655b8002ccbcdc827c486417e17..674992cde8bd4e54619fb0a7d9d384adeb391462 100644 (file)
@@ -68,89 +68,6 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn)
     return i;
 }
 
-void init_inputrec(t_inputrec *ir)
-{
-    std::memset(ir, 0, sizeof(*ir));
-    snew(ir->fepvals, 1);
-    snew(ir->expandedvals, 1);
-    snew(ir->simtempvals, 1);
-}
-
-static void done_pull_group(t_pull_group *pgrp)
-{
-    if (pgrp->nat > 0)
-    {
-        sfree(pgrp->ind);
-        sfree(pgrp->weight);
-    }
-}
-
-static void done_pull_params(pull_params_t *pull)
-{
-    int i;
-
-    for (i = 0; i < pull->ngroup+1; i++)
-    {
-        done_pull_group(pull->group);
-    }
-
-    sfree(pull->group);
-    sfree(pull->coord);
-}
-
-void done_inputrec(t_inputrec *ir)
-{
-    int m;
-
-    for (m = 0; (m < DIM); m++)
-    {
-        if (ir->ex[m].a)
-        {
-            sfree(ir->ex[m].a);
-        }
-        if (ir->ex[m].phi)
-        {
-            sfree(ir->ex[m].phi);
-        }
-        if (ir->et[m].a)
-        {
-            sfree(ir->et[m].a);
-        }
-        if (ir->et[m].phi)
-        {
-            sfree(ir->et[m].phi);
-        }
-    }
-
-    sfree(ir->opts.nrdf);
-    sfree(ir->opts.ref_t);
-    sfree(ir->opts.annealing);
-    sfree(ir->opts.anneal_npoints);
-    sfree(ir->opts.anneal_time);
-    sfree(ir->opts.anneal_temp);
-    sfree(ir->opts.tau_t);
-    sfree(ir->opts.acc);
-    sfree(ir->opts.nFreeze);
-    sfree(ir->opts.QMmethod);
-    sfree(ir->opts.QMbasis);
-    sfree(ir->opts.QMcharge);
-    sfree(ir->opts.QMmult);
-    sfree(ir->opts.bSH);
-    sfree(ir->opts.CASorbitals);
-    sfree(ir->opts.CASelectrons);
-    sfree(ir->opts.SAon);
-    sfree(ir->opts.SAoff);
-    sfree(ir->opts.SAsteps);
-    sfree(ir->opts.bOPT);
-    sfree(ir->opts.bTS);
-
-    if (ir->pull)
-    {
-        done_pull_params(ir->pull);
-        sfree(ir->pull);
-    }
-}
-
 static void zero_history(history_t *hist)
 {
     hist->disre_initf  = 0;
index 16f75891ec2e18fb3695334753555e468f0be249..459dddb0728bdfcec978a281563efb049502fccf 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "gromacs/gmxpreprocess/readir.h"
 #include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
index fc491c33828bf3af89d5e151756674fb5eddffe0..6cd05214031d71aaf2d6d8edd8cec6f54b9c082e 100644 (file)
 #include "gromacs/gmxpreprocess/grompp-impl.h"
 #include "gromacs/legacyheaders/typedefs.h"
 
+struct pull_params_t;
+struct t_adress;
+struct t_grpopts;
+struct t_rot;
+
 enum {
     eshNONE, eshHBONDS, eshALLBONDS, eshHANGLES, eshALLANGLES, eshNR
 };
index 05bc8c922bd08bfffccb2233143f7089b5f977a1..59ef1d5a634ab55bbee2b837e9a2f8a4f90a3449 100644 (file)
@@ -70,6 +70,7 @@
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/sim_util.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -137,7 +138,7 @@ typedef struct
  *
  * Contains private IMD data
  */
-typedef struct gmx_IMD
+typedef struct t_gmx_IMD
 {
     FILE      *outf;                 /**< Output file for IMD data, mainly forces.    */
 
@@ -427,9 +428,8 @@ static int imd_recv_mdcomm(IMDSocket *socket, gmx_int32_t nforces, gmx_int32_t *
 #endif
 
 /* GROMACS specific functions for the IMD implementation */
-
-extern void write_IMDgroup_to_file(gmx_bool bIMD, t_inputrec *ir, t_state *state,
-                                   gmx_mtop_t *sys, int nfile, const t_filenm fnm[])
+void write_IMDgroup_to_file(gmx_bool bIMD, t_inputrec *ir, t_state *state,
+                            gmx_mtop_t *sys, int nfile, const t_filenm fnm[])
 {
     t_atoms IMDatoms;
 
@@ -443,7 +443,7 @@ extern void write_IMDgroup_to_file(gmx_bool bIMD, t_inputrec *ir, t_state *state
 }
 
 
-extern void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd)
+void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd)
 {
     gmx_ga2la_t         ga2la;
     t_gmx_IMD_setup    *IMDsetup;
@@ -1059,7 +1059,7 @@ static FILE *open_imd_out(
 #endif
 
 
-extern void IMD_finalize(gmx_bool bIMD, t_IMD *imd)
+void IMD_finalize(gmx_bool bIMD, t_IMD *imd)
 {
     if (bIMD)
     {
@@ -1314,19 +1314,17 @@ static void imd_check_integrator_parallel(t_inputrec *ir, t_commrec *cr)
     }
 }
 
-
-extern void init_IMD(
-        t_inputrec    *ir,
-        t_commrec     *cr,
-        gmx_mtop_t    *top_global,
-        FILE          *fplog,
-        int            defnstimd,
-        rvec           x[],
-        int            nfile,
-        const t_filenm fnm[],
-        output_env_t   oenv,
-        int            imdport,
-        unsigned long  Flags)
+void init_IMD(t_inputrec    *ir,
+              t_commrec     *cr,
+              gmx_mtop_t    *top_global,
+              FILE          *fplog,
+              int            defnstimd,
+              rvec           x[],
+              int            nfile,
+              const t_filenm fnm[],
+              output_env_t   oenv,
+              int            imdport,
+              unsigned long  Flags)
 {
     int              i;
     int              nat_total;
@@ -1503,16 +1501,15 @@ extern void init_IMD(
 }
 
 
-extern gmx_bool do_IMD(
-        gmx_bool        bIMD,
-        gmx_int64_t     step,
-        t_commrec      *cr,
-        gmx_bool        bNS,
-        matrix          box,
-        rvec            x[],
-        t_inputrec     *ir,
-        double          t,
-        gmx_wallcycle_t wcycle)
+gmx_bool do_IMD(gmx_bool        bIMD,
+                gmx_int64_t     step,
+                t_commrec      *cr,
+                gmx_bool        bNS,
+                matrix          box,
+                rvec            x[],
+                t_inputrec     *ir,
+                double          t,
+                gmx_wallcycle_t wcycle)
 {
     gmx_bool         imdstep = FALSE;
     t_gmx_IMD_setup *IMDsetup;
@@ -1589,11 +1586,11 @@ extern gmx_bool do_IMD(
 }
 
 
-extern void IMD_fill_energy_record(gmx_bool bIMD, t_IMD *imd, gmx_enerdata_t *enerd,
-                                   gmx_int64_t step, gmx_bool bHaveNewEnergies)
+void IMD_fill_energy_record(gmx_bool bIMD, t_IMD *imd, gmx_enerdata_t *enerd,
+                            gmx_int64_t step, gmx_bool bHaveNewEnergies)
 {
     IMDEnergyBlock *ene;
-    t_gmx_IMD       IMDsetup;
+    t_gmx_IMD      *IMDsetup;
 
 
     if (bIMD)
@@ -1630,10 +1627,10 @@ extern void IMD_fill_energy_record(gmx_bool bIMD, t_IMD *imd, gmx_enerdata_t *en
 }
 
 
-extern void IMD_send_positions(t_IMD *imd)
+void IMD_send_positions(t_IMD *imd)
 {
 #ifdef GMX_IMD
-    t_gmx_IMD IMDsetup;
+    t_gmx_IMD *IMDsetup;
 
 
     IMDsetup = imd->setup;
@@ -1657,10 +1654,10 @@ extern void IMD_send_positions(t_IMD *imd)
 }
 
 
-extern void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
-                                             t_IMD *imd, gmx_enerdata_t *enerd,
-                                             gmx_int64_t step, gmx_bool bHaveNewEnergies,
-                                             gmx_wallcycle_t wcycle)
+void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
+                                      t_IMD *imd, gmx_enerdata_t *enerd,
+                                      gmx_int64_t step, gmx_bool bHaveNewEnergies,
+                                      gmx_wallcycle_t wcycle)
 {
     if (bIMD)
     {
@@ -1683,15 +1680,13 @@ extern void IMD_prep_energies_send_positions(gmx_bool bIMD, gmx_bool bIMDstep,
     }
 }
 
-
-extern int IMD_get_step(t_gmx_IMD IMDsetup)
+int IMD_get_step(t_gmx_IMD *IMDsetup)
 {
     return IMDsetup->nstimd;
 }
 
-
-extern void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, t_commrec *cr, rvec *f,
-                             gmx_wallcycle_t wcycle)
+void IMD_apply_forces(gmx_bool bIMD, t_IMD *imd, t_commrec *cr, rvec *f,
+                      gmx_wallcycle_t wcycle)
 {
     int              i, j;
     int              locndx;
index c95f990e8cc8c334a4f2c9d3de6a3bd0ffbf6c41..3c661445007e246ccabebef7eeedd58288a71007 100644 (file)
@@ -74,6 +74,8 @@
 struct gmx_domdec_t;
 struct gmx_enerdata_t;
 struct gmx_mtop_t;
+struct t_gmx_IMD;
+struct t_IMD;
 
 static const char IMDstr[] = "IMD:";  /**< Tag output from the IMD module with this string. */
 
@@ -163,7 +165,7 @@ gmx_bool do_IMD(gmx_bool bIMD, gmx_int64_t step, t_commrec *cr,
  *
  * \returns            The current IMD update/communication frequency
  */
-int IMD_get_step(t_gmx_IMD IMDsetup);
+int IMD_get_step(t_gmx_IMD *IMDsetup);
 
 
 /*! \brief Add external forces from a running interactive molecular dynamics session.
index c1672e9437abbf55fe123057be8ce06e39d11971..2a5ca67465bd7781c0cbc2787e593ab4c7814ff5 100644 (file)
@@ -48,6 +48,8 @@
 struct t_commrec;
 struct t_fcdata;
 struct t_graph;
+struct t_grpopts;
+struct t_lambda;
 struct t_pbc;
 struct gmx_edsam;
 
@@ -79,24 +81,24 @@ void calc_rffac(FILE *fplog, int eel, real eps_r, real eps_rf,
 /* Determine the reaction-field constants */
 
 void init_generalized_rf(FILE *fplog,
-                         const gmx_mtop_t *mtop, const t_inputrec *ir,
+                         const gmx_mtop_t *mtop, const struct t_inputrec *ir,
                          t_forcerec *fr);
 /* Initialize the generalized reaction field parameters */
 
 
 /* In wall.c */
 void make_wall_tables(FILE *fplog,
-                      const t_inputrec *ir, const char *tabfn,
+                      const struct t_inputrec *ir, const char *tabfn,
                       const gmx_groups_t *groups,
                       t_forcerec *fr);
 
-real do_walls(t_inputrec *ir, t_forcerec *fr, matrix box, t_mdatoms *md,
+real do_walls(struct t_inputrec *ir, t_forcerec *fr, matrix box, t_mdatoms *md,
               rvec x[], rvec f[], real lambda, real Vlj[], t_nrnb *nrnb);
 
 #define GMX_MAKETABLES_FORCEUSER  (1<<0)
 #define GMX_MAKETABLES_14ONLY     (1<<1)
 
-gmx_bool can_use_allvsall(const t_inputrec *ir,
+gmx_bool can_use_allvsall(const struct t_inputrec *ir,
                           gmx_bool bPrintNote, struct t_commrec *cr, FILE *fp);
 /* Returns if we can use all-vs-all loops.
  * If bPrintNote==TRUE, prints a note, if necessary, to stderr
@@ -104,10 +106,10 @@ gmx_bool can_use_allvsall(const t_inputrec *ir,
  */
 
 
-gmx_bool nbnxn_acceleration_supported(FILE                    *fplog,
-                                      const struct t_commrec  *cr,
-                                      const t_inputrec        *ir,
-                                      gmx_bool                 bGPU);
+gmx_bool nbnxn_acceleration_supported(FILE                           *fplog,
+                                      const struct t_commrec         *cr,
+                                      const struct t_inputrec        *ir,
+                                      gmx_bool                        bGPU);
 /* Return if GPU/CPU-SIMD acceleration is supported with the given inputrec
  * with bGPU TRUE/FALSE.
  * If the return value is FALSE and fplog/cr != NULL, prints a fallback
@@ -138,7 +140,7 @@ void reset_enerdata(t_forcerec *fr, gmx_bool bNS,
 void sum_epot(gmx_grppairener_t *grpp, real *epot);
 /* Locally sum the non-bonded potential energy terms */
 
-void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, t_lambda *fepvals);
+void sum_dhdl(gmx_enerdata_t *enerd, real *lambda, struct t_lambda *fepvals);
 /* Sum the free energy contributions */
 
 /* Compute the average C6 and C12 params for LJ corrections */
@@ -146,7 +148,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr,
                       const gmx_mtop_t *mtop);
 
 extern void do_force(FILE *log, struct t_commrec *cr,
-                     t_inputrec *inputrec,
+                     struct t_inputrec *inputrec,
                      gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                      gmx_localtop_t *top,
                      gmx_groups_t *groups,
@@ -184,7 +186,7 @@ void ns(FILE                     *fplog,
 /* Call the neighborsearcher */
 
 extern void do_force_lowlevel(t_forcerec   *fr,
-                              t_inputrec   *ir,
+                              struct t_inputrec   *ir,
                               t_idef       *idef,
                               struct t_commrec    *cr,
                               t_nrnb       *nrnb,
@@ -200,7 +202,7 @@ extern void do_force_lowlevel(t_forcerec   *fr,
                               gmx_genborn_t *born,
                               gmx_bool         bBornRadii,
                               matrix       box,
-                              t_lambda     *fepvals,
+                              struct t_lambda     *fepvals,
                               real         *lambda,
                               struct t_graph      *graph,
                               t_blocka     *excl,
index 8a2b1fd983b3ae112d813c22388138f380b57b24..6ad0797ec46ef11ec0a11fe2c95695b61aaa9aa2 100644 (file)
@@ -46,6 +46,7 @@ struct gmx_enerdata_t;
 struct t_commrec;
 struct t_forcerec;
 struct t_graph;
+struct t_inputrec;
 struct t_pbc;
 
 #ifdef __cplusplus
@@ -65,12 +66,12 @@ extern "C" {
 
 /* Initialise GB stuff */
 int init_gb(struct gmx_genborn_t **p_born,
-            struct t_forcerec *fr, const t_inputrec *ir,
+            struct t_forcerec *fr, const struct t_inputrec *ir,
             const gmx_mtop_t *mtop, int gb_algorithm);
 
 
 /* Born radii calculations, both with and without SSE acceleration */
-int calc_gb_rad(struct t_commrec *cr, struct t_forcerec *fr, t_inputrec *ir, gmx_localtop_t *top, rvec x[], t_nblist *nl, struct gmx_genborn_t *born, t_mdatoms *md, t_nrnb     *nrnb);
+int calc_gb_rad(struct t_commrec *cr, struct t_forcerec *fr, struct t_inputrec *ir, gmx_localtop_t *top, rvec x[], t_nblist *nl, struct gmx_genborn_t *born, t_mdatoms *md, t_nrnb     *nrnb);
 
 
 
index 0b743c4643f3c6a72d721a29fa169503be5c3706..a92b9c5fe3a2de7587e00483074c6556425349d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015, 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.
@@ -83,6 +83,22 @@ gmx_bool ir_vdw_is_zero_at_cutoff(const t_inputrec *ir);
  */
 gmx_bool ir_vdw_might_be_zero_at_cutoff(const t_inputrec *ir);
 
+/*! \brief Initiate input record structure
+ *
+ * Initialiazes all the arrays and pointers to NULL.
+ *
+ * \param[in] ir Inputrec must be pre-allocated
+ */
+void init_inputrec(t_inputrec *ir);
+
+/*! \brief Free memory from input record.
+ *
+ * All arrays and pointers will be freed.
+ *
+ * \param[in] ir The data structure
+ */
+void done_inputrec(t_inputrec *ir);
+
 #ifdef __cplusplus
 }
 #endif
index f532eedd5e4b62903d1b6f2197df33106051aa03..06f5f0b71041e66b6e01cd19409d9ef811281e48 100644 (file)
@@ -48,6 +48,9 @@
 struct gmx_constr;
 struct gmx_edsam;
 struct gmx_enerdata_t;
+struct t_expanded;
+struct t_lambda;
+struct t_simtemp;
 
 #ifdef __cplusplus
 extern "C" {
index 7e2de88071677568fbbfe671db75f1a7e51e65fc..e83e2b7e8bae52fb23015b9bc7f66f4e8b0da7ed 100644 (file)
 
 struct gmx_ekindata_t;
 struct t_commrec;
+struct t_grpopts;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-void init_ekindata(FILE *log, gmx_mtop_t *mtop, t_grpopts *opts,
+void init_ekindata(FILE *log, gmx_mtop_t *mtop,
+                   struct t_grpopts *opts,
                    struct gmx_ekindata_t *ekind);
 /* Allocate memory and set the grpnr array. */
 
 void done_ekindata(struct gmx_ekindata_t *ekind);
 /* Free the memory */
 
-void accumulate_u(struct t_commrec *cr, t_grpopts *opts,
+void accumulate_u(struct t_commrec *cr, struct t_grpopts *opts,
                   struct gmx_ekindata_t *ekind);
 
-/*extern void accumulate_ekin(struct t_commrec *cr,t_grpopts *opts,t_groups *grps);*/
 /* Communicate subsystem - group velocities and subsystem ekin respectively
  * and sum them up. Return them in grps.
  */
 
-real sum_ekin(t_grpopts *opts, struct gmx_ekindata_t *ekind, real *dekindlambda,
+real sum_ekin(struct t_grpopts *opts, struct gmx_ekindata_t *ekind, real *dekindlambda,
               gmx_bool bEkinFullStep, gmx_bool bScaleEkin);
 /* Sum the group ekins into total ekin and calc temp per group,
  * return total temperature.
  */
 
 void update_ekindata(int start, int homenr, struct gmx_ekindata_t *ekind,
-                     t_grpopts *opts, rvec v[], t_mdatoms *md, real lambda);
+                     struct t_grpopts *opts, rvec v[], t_mdatoms *md, real lambda);
 /* Do the update of group velocities (if bNEMD) and
  * (partial) group ekin.
  */
index d7badfc60a43ebf2be127bf2990cde8cedb8ae25..ede429c85a09988ff444520f7fd05d7786959cb9 100644 (file)
@@ -42,7 +42,6 @@
 /* DEPRECATED! value for signaling unitialized variables */
 #define NOTSET -12345
 
-#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/legacyheaders/types/mdatom.h"
 #include "gromacs/legacyheaders/types/nblist.h"
 #include "gromacs/legacyheaders/types/nrnb.h"
@@ -52,6 +51,8 @@
 #include "gromacs/legacyheaders/types/state.h"
 #include "gromacs/topology/topology.h"
 
+struct t_inputrec;
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -67,7 +68,6 @@ int gmx_int64_to_int(gmx_int64_t step, const char *warn);
 /* Functions to initiate and delete structures *
  * These functions are defined in gmxlib/typedefs.c
  */
-void init_inputrec(t_inputrec *ir);
 void init_energyhistory(energyhistory_t * enerhist);
 void done_energyhistory(energyhistory_t * enerhist);
 void init_gtc_state(t_state *state, int ngtc, int nnhpres, int nhchainlength);
@@ -76,13 +76,12 @@ t_state *serial_init_local_state(t_state *state_global);
 void init_df_history(df_history_t *dfhist, int nlambda);
 void done_df_history(df_history_t *dfhist);
 void copy_df_history(df_history_t * df_dest, df_history_t *df_source);
-void done_inputrec(t_inputrec *ir);
 void done_state(t_state *state);
 
-void set_box_rel(t_inputrec *ir, t_state *state);
+void set_box_rel(struct t_inputrec *ir, t_state *state);
 /* Set state->box_rel used in mdrun to preserve the box shape */
 
-void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b);
+void preserve_box_shape(struct t_inputrec *ir, matrix box_rel, matrix b);
 /* Preserve the box shape, b can be box or boxv */
 
 real max_cutoff(real cutoff1, real cutoff2);
index 72d85c0119ce6ef5fdd83e12bb2a3ee07ea81bd1..1e0afe2ee846b27e31ef94ce0e85b6abbcd014e0 100644 (file)
@@ -64,7 +64,7 @@ typedef struct {
 #define EGP_EXCL  (1<<0)
 #define EGP_TABLE (1<<1)
 
-typedef struct {
+typedef struct t_grpopts {
     int       ngtc;           /* # T-Coupl groups                        */
     int       nhchainlength;  /* # of nose-hoover chains per group       */
     int       ngacc;          /* # Accelerate groups                     */
@@ -120,14 +120,14 @@ typedef struct {
     real        kB;         /* force constant for state B */
 } t_pull_coord;
 
-typedef struct {
+typedef struct t_simtemp {
     int   eSimTempScale; /* simulated temperature scaling; linear or exponential */
     real  simtemp_low;   /* the low temperature for simulated tempering  */
     real  simtemp_high;  /* the high temperature for simulated tempering */
     real *temperatures;  /* the range of temperatures used for simulated tempering */
 } t_simtemp;
 
-typedef struct {
+typedef struct t_lambda {
     int    nstdhdl;                 /* The frequency for calculating dhdl           */
     double init_lambda;             /* fractional value of lambda (usually will use
                                        init_fep_state, this will only be for slow growth,
@@ -160,7 +160,7 @@ typedef struct {
     double dh_hist_spacing;         /* The spacing for the dH histogram */
 } t_lambda;
 
-typedef struct {
+typedef struct t_expanded {
     int      nstexpanded;         /* The frequency of expanded ensemble state changes */
     int      elamstats;           /* which type of move updating do we use for lambda monte carlo (or no for none) */
     int      elmcmove;            /* what move set will be we using for state space moves */
@@ -189,7 +189,7 @@ typedef struct {
     real    *init_lambda_weights; /* user-specified initial weights to start with  */
 } t_expanded;
 
-typedef struct {
+typedef struct pull_params_t {
     int            ngroup;         /* number of pull groups */
     int            ncoord;         /* number of pull coordinates */
     real           cylinder_r;     /* radius of cylinder for dynamic COM */
@@ -237,7 +237,7 @@ typedef struct {
     gmx_enfrotgrp_t enfrotgrp;     /* Stores non-inputrec rotation data per group   */
 } t_rotgrp;
 
-typedef struct {
+typedef struct t_rot {
     int          ngrp;       /* Number of rotation groups                     */
     int          nstrout;    /* Output frequency for main rotation outfile    */
     int          nstsout;    /* Output frequency for per-slab data            */
@@ -246,18 +246,18 @@ typedef struct {
 } t_rot;
 
 /* Abstract type for IMD only defined in IMD.c */
-typedef struct gmx_IMD *t_gmx_IMD;
+struct t_gmx_IMD;
 
-typedef struct {
-    int         nat;         /* Number of interactive atoms                   */
-    atom_id    *ind;         /* The global indices of the interactive atoms   */
-    t_gmx_IMD   setup;       /* Stores non-inputrec IMD data                  */
+typedef struct t_IMD {
+    int               nat;   /* Number of interactive atoms                   */
+    atom_id          *ind;   /* The global indices of the interactive atoms   */
+    struct t_gmx_IMD *setup; /* Stores non-inputrec IMD data                  */
 } t_IMD;
 
 /* Abstract types for position swapping only defined in swapcoords.c */
 typedef struct t_swap *gmx_swapcoords_t;
 
-typedef struct {
+typedef struct t_swapcoords {
     int              nstswap;           /* Every how many steps a swap is attempted?    */
     int              nat;               /* Number of atoms in the ion group             */
     int              nat_split[2];      /* Number of atoms in the split group           */
@@ -280,7 +280,7 @@ typedef struct {
 } t_swapcoords;
 
 
-typedef struct {
+typedef struct t_adress {
     int      type;           /* type of AdResS simulation                    */
     gmx_bool bnew_wf;        /* enable new AdResS weighting function         */
     gmx_bool bchempot_dx;    /*true:interaction table format input is F=-dmu/dx   false: dmu_dwp  */
@@ -300,7 +300,7 @@ typedef struct {
     int      n_energy_grps;
 } t_adress;
 
-typedef struct {
+typedef struct t_inputrec {
     int             eI;                      /* Integration method                 */
     gmx_int64_t     nsteps;                  /* number of steps to be taken                    */
     int             simulation_part;         /* Used in checkpointing to separate chunks */
index e28aa549aa02b1bfd078ba3fcb096f39dc15302a..fc18b8a8e899cb37dd6bc95ec414f8d39e981231 100644 (file)
@@ -46,6 +46,7 @@ struct gmx_ekindata_t;
 struct gmx_enerdata_t;
 struct t_fcdata;
 struct t_graph;
+struct t_grpopts;
 
 #ifdef __cplusplus
 extern "C" {
index 6f724a32c9b97632bf07b35e03570c00cd510c75..62328e8d3762932f943650197b7fc4bcd3117887 100644 (file)
@@ -59,6 +59,7 @@
 #include "gromacs/legacyheaders/types/fcdata.h"
 #include "gromacs/legacyheaders/types/force_flags.h"
 #include "gromacs/legacyheaders/types/forcerec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/listed-forces/bonded.h"
 #include "gromacs/listed-forces/position-restraints.h"
 #include "gromacs/math/vec.h"
index 62b9c0f571d14133ed42c85c06b57e6602fe6f33..f5603db8b2aa7d3ecd17c5e616c8943b365b42c3 100644 (file)
@@ -73,6 +73,8 @@ struct gmx_grppairener_t;
 struct gmx_multisim_t;
 struct t_fcdata;
 struct t_forcerec;
+struct t_inputrec;
+struct t_lambda;
 
 #ifdef __cplusplus
 extern "C" {
index 692e29c579c5ea90190ac9f44beb2995bdb68ed2..d40e3dbb5859bd4e21908934ea1ffb3e110a65f2 100644 (file)
@@ -59,6 +59,7 @@ extern "C" {
 struct gmx_enerdata_t;
 struct gmx_wallcycle;
 struct t_forcerec;
+struct t_lambda;
 struct t_pbc;
 
 /*! \brief Helper function that wraps calls to posres */
index 371e8b7cd50b82164a04e7d7ef2a33cc38f9f094..582def639aab141f15c384673eb74be3a2c3cf95 100644 (file)
@@ -45,6 +45,8 @@
 #include "gromacs/legacyheaders/tgroup.h"
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/enums.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/topology/symtab.h"
 #include "gromacs/utility/fatalerror.h"
index f21b102c6f36bebb29e89ece5840be1b67eb1afe..fcb0713a687cc6c5dc06a876a9ae9daef75e9677 100644 (file)
@@ -44,6 +44,7 @@
 
 #include "gromacs/legacyheaders/typedefs.h"
 #include "gromacs/legacyheaders/types/ifunc.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/calculate-ewald-splitting-coefficient.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/vec.h"
index 7e205cf317be5a07f5a3ca21b6db66d8e97e817e..42e18cdfd6f465e5bc03153fc1b5c72dd17956ec 100644 (file)
@@ -41,7 +41,7 @@
 #include <signal.h>
 #include <stdlib.h>
 
-#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 
 static int div_nsteps(int nsteps, int nst)
 {
index f2056b15d59f034745bc3b55a02cd000c9be5efa..4d506522392c2e7649b382d7fc4c4e8271b7fed7 100644 (file)
@@ -76,6 +76,7 @@
 #include "gromacs/legacyheaders/update.h"
 #include "gromacs/legacyheaders/vsite.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/linearalgebra/sparsematrix.h"
 #include "gromacs/listed-forces/manage-threading.h"
 #include "gromacs/math/vec.h"
index fa1a7e729965709010ced5f4e7d2c4e85a22d8da..119510088cfc4bcdabc775c47a91b74af51dfb16 100644 (file)
@@ -44,7 +44,7 @@
 #include "gromacs/fileio/filenm.h"
 #include "gromacs/legacyheaders/force.h"
 #include "gromacs/legacyheaders/nrnb.h"
-#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/tables/forcetable.h"
index 470ac9f43cd503b94eda42eb78f85ff103834323..2e96d72c68a179bab6be59862c1acd7b3025d93a 100644 (file)
@@ -57,6 +57,7 @@
 extern "C" {
 #endif
 
+struct pull_params_t;
 struct t_pbc;
 
 
index f053ed9e0f3a116cc315538e2f58296ce7ed4214..dd5d02595c06fc83976d72f13f6513ff57db7e1b 100644 (file)
@@ -56,6 +56,7 @@
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/sim_util.h"
 #include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/linearalgebra/nrjac.h"
 #include "gromacs/math/utilities.h"
 #include "gromacs/math/vec.h"
index 61778cf11638845f3afd32cc4b0d242b95737f8b..b4a36e2d9b1fa5817942fe3222f59cc4ed52d195 100644 (file)
@@ -54,6 +54,7 @@
 
 struct gmx_domdec_t;
 struct t_commrec;
+struct t_rot;
 
 #ifdef __cplusplus
 extern "C" {
index 28687b3638c329c8dc510e55c19b9f78eda6138c..26b2f7e34f8b9f3afa6d39b08942b893d8fde5bb 100644 (file)
@@ -57,6 +57,7 @@
 #include "gromacs/legacyheaders/network.h"
 #include "gromacs/legacyheaders/sim_util.h"
 #include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/pbcutil/pbc.h"
index ce91d87cd1b6aa9ac097b1f1721650603e068909..9afea69878a50284fa256870fb98bcd4236780b4 100644 (file)
@@ -56,6 +56,8 @@
 #include "gromacs/legacyheaders/types/commrec.h"
 #include "gromacs/timing/wallcycle.h"
 
+struct t_swapcoords;
+
 /*! \brief Initialize ion / water position swapping ("Computational Electrophysiology").
  *
  * This routine does the memory allocation for various helper arrays, opens
index d82ee3b739db5d8f51610a2064e53c3cd556c36e..949e1ca6e98b0b3eb2975e97bdaf6965d87294fa 100644 (file)
@@ -49,6 +49,7 @@
 #include "gromacs/legacyheaders/gmx_omp_nthreads.h"
 #include "gromacs/legacyheaders/names.h"
 #include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/types/inputrec.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"