From f2760be74496392186a716fc274b5da2ed49596a Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Fri, 25 Sep 2015 09:13:02 +0300 Subject: [PATCH] Remove types/shellfc.h Make the type forward-declarable, and replace uses of the header with a forward declaration. Change-Id: I41a73418880e69d3cf85cf24c932b63382ef7b81 --- src/gromacs/domdec/domdec.cpp | 3 +- src/gromacs/domdec/domdec.h | 4 +-- src/gromacs/legacyheaders/shellfc.h | 21 ++++-------- src/gromacs/legacyheaders/typedefs.h | 1 - src/gromacs/legacyheaders/types/shellfc.h | 53 ------------------------------- src/gromacs/mdlib/shellfc.cpp | 18 +++++------ src/programs/mdrun/md.cpp | 3 +- 7 files changed, 19 insertions(+), 84 deletions(-) delete mode 100644 src/gromacs/legacyheaders/types/shellfc.h diff --git a/src/gromacs/domdec/domdec.cpp b/src/gromacs/domdec/domdec.cpp index d5acf447c6..f3d8f1cf3b 100644 --- a/src/gromacs/domdec/domdec.cpp +++ b/src/gromacs/domdec/domdec.cpp @@ -78,7 +78,6 @@ #include "gromacs/legacyheaders/types/nrnb.h" #include "gromacs/legacyheaders/types/ns.h" #include "gromacs/legacyheaders/types/nsgrid.h" -#include "gromacs/legacyheaders/types/shellfc.h" #include "gromacs/legacyheaders/types/simple.h" #include "gromacs/legacyheaders/types/state.h" #include "gromacs/listed-forces/manage-threading.h" @@ -9447,7 +9446,7 @@ void dd_partition_system(FILE *fplog, gmx_localtop_t *top_local, t_forcerec *fr, gmx_vsite_t *vsite, - gmx_shellfc_t shellfc, + gmx_shellfc_t *shellfc, gmx_constr_t constr, t_nrnb *nrnb, gmx_wallcycle_t wcycle, diff --git a/src/gromacs/domdec/domdec.h b/src/gromacs/domdec/domdec.h index c038eed2de..08b0697335 100644 --- a/src/gromacs/domdec/domdec.h +++ b/src/gromacs/domdec/domdec.h @@ -66,7 +66,6 @@ #include "gromacs/legacyheaders/types/inputrec.h" #include "gromacs/legacyheaders/types/mdatom.h" #include "gromacs/legacyheaders/types/nrnb.h" -#include "gromacs/legacyheaders/types/shellfc.h" #include "gromacs/legacyheaders/types/state.h" #include "gromacs/math/vectypes.h" #include "gromacs/mdlib/constr.h" @@ -81,6 +80,7 @@ struct t_commrec; struct gmx_domdec_t; struct gmx_ddbox_t; struct gmx_domdec_zones_t; +struct gmx_shellfc_t; #ifdef __cplusplus extern "C" { @@ -274,7 +274,7 @@ void dd_partition_system(FILE *fplog, gmx_localtop_t *top_local, t_forcerec *fr, gmx_vsite_t *vsite, - gmx_shellfc_t shellfc, + gmx_shellfc_t *shellfc, gmx_constr_t constr, t_nrnb *nrnb, gmx_wallcycle_t wcycle, diff --git a/src/gromacs/legacyheaders/shellfc.h b/src/gromacs/legacyheaders/shellfc.h index 062f11708d..472c37681e 100644 --- a/src/gromacs/legacyheaders/shellfc.h +++ b/src/gromacs/legacyheaders/shellfc.h @@ -40,24 +40,20 @@ #include "gromacs/timing/wallcycle.h" struct gmx_constr; - -#ifdef __cplusplus -extern "C" { -#endif - +struct gmx_shellfc_t; struct t_fcdata; struct t_graph; /* Initialization function, also predicts the initial shell postions. * If x!=NULL, the shells are predict for the global coordinates x. */ -gmx_shellfc_t init_shell_flexcon(FILE *fplog, - gmx_mtop_t *mtop, int nflexcon, - rvec *x); +gmx_shellfc_t *init_shell_flexcon(FILE *fplog, + gmx_mtop_t *mtop, int nflexcon, + rvec *x); /* Get the local shell with domain decomposition */ void make_local_shells(t_commrec *cr, t_mdatoms *md, - gmx_shellfc_t shfc); + gmx_shellfc_t *shfc); /* Optimize shell positions */ int relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose, @@ -72,15 +68,10 @@ int relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose, t_nrnb *nrnb, gmx_wallcycle_t wcycle, struct t_graph *graph, gmx_groups_t *groups, - gmx_shellfc_t shfc, + gmx_shellfc_t *shfc, t_forcerec *fr, gmx_bool bBornRadii, double t, rvec mu_tot, gmx_bool *bConverged, gmx_vsite_t *vsite, FILE *fp_field); - - -#ifdef __cplusplus -} -#endif diff --git a/src/gromacs/legacyheaders/typedefs.h b/src/gromacs/legacyheaders/typedefs.h index 5c68982690..f7c6aaba35 100644 --- a/src/gromacs/legacyheaders/typedefs.h +++ b/src/gromacs/legacyheaders/typedefs.h @@ -49,7 +49,6 @@ #include "gromacs/legacyheaders/types/nrnb.h" #include "gromacs/legacyheaders/types/nsgrid.h" #include "gromacs/legacyheaders/types/oenv.h" -#include "gromacs/legacyheaders/types/shellfc.h" #include "gromacs/legacyheaders/types/simple.h" #include "gromacs/legacyheaders/types/state.h" #include "gromacs/topology/topology.h" diff --git a/src/gromacs/legacyheaders/types/shellfc.h b/src/gromacs/legacyheaders/types/shellfc.h deleted file mode 100644 index e1423c2496..0000000000 --- a/src/gromacs/legacyheaders/types/shellfc.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2010, 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. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ - - -#ifndef _shellfc_h -#define _shellfc_h - -#ifdef __cplusplus -extern "C" { -#endif - -/* Abstract type for shells */ -typedef struct gmx_shellfc *gmx_shellfc_t; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/gromacs/mdlib/shellfc.cpp b/src/gromacs/mdlib/shellfc.cpp index d4fce47b35..02fe92db8c 100644 --- a/src/gromacs/mdlib/shellfc.cpp +++ b/src/gromacs/mdlib/shellfc.cpp @@ -77,7 +77,7 @@ typedef struct { rvec step; } t_shell; -typedef struct gmx_shellfc { +struct gmx_shellfc_t { int nshell_gl; /* The number of shells in the system */ t_shell *shell_gl; /* All the shells (for DD only) */ int *shell_index_gl; /* Global shell index (for DD only) */ @@ -97,7 +97,7 @@ typedef struct gmx_shellfc { rvec *adir_xnold; /* Work space for init_adir */ rvec *adir_xnew; /* Work space for init_adir */ int adir_nalloc; /* Work space for init_adir */ -} t_gmx_shellfc; +}; static void pr_shell(FILE *fplog, int ns, t_shell s[]) @@ -236,11 +236,11 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt, } } -gmx_shellfc_t init_shell_flexcon(FILE *fplog, - gmx_mtop_t *mtop, int nflexcon, - rvec *x) +gmx_shellfc_t *init_shell_flexcon(FILE *fplog, + gmx_mtop_t *mtop, int nflexcon, + rvec *x) { - struct gmx_shellfc *shfc; + gmx_shellfc_t *shfc; t_shell *shell; int *shell_index = NULL, *at2cg; t_atom *atom; @@ -547,7 +547,7 @@ gmx_shellfc_t init_shell_flexcon(FILE *fplog, } void make_local_shells(t_commrec *cr, t_mdatoms *md, - struct gmx_shellfc *shfc) + gmx_shellfc_t *shfc) { t_shell *shell; int a0, a1, *ind, nshell, i; @@ -841,7 +841,7 @@ static void dump_shells(FILE *fp, rvec x[], rvec f[], real ftol, int ns, t_shell } } -static void init_adir(FILE *log, gmx_shellfc_t shfc, +static void init_adir(FILE *log, gmx_shellfc_t *shfc, gmx_constr_t constr, t_idef *idef, t_inputrec *ir, t_commrec *cr, int dd_ac1, gmx_int64_t step, t_mdatoms *md, int start, int end, @@ -934,7 +934,7 @@ int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose, t_nrnb *nrnb, gmx_wallcycle_t wcycle, t_graph *graph, gmx_groups_t *groups, - struct gmx_shellfc *shfc, + gmx_shellfc_t *shfc, t_forcerec *fr, gmx_bool bBornRadii, double t, rvec mu_tot, diff --git a/src/programs/mdrun/md.cpp b/src/programs/mdrun/md.cpp index c59bdfebd1..b860b70997 100644 --- a/src/programs/mdrun/md.cpp +++ b/src/programs/mdrun/md.cpp @@ -86,7 +86,6 @@ #include "gromacs/legacyheaders/types/membedt.h" #include "gromacs/legacyheaders/types/nrnb.h" #include "gromacs/legacyheaders/types/oenv.h" -#include "gromacs/legacyheaders/types/shellfc.h" #include "gromacs/legacyheaders/types/state.h" #include "gromacs/listed-forces/manage-threading.h" #include "gromacs/math/utilities.h" @@ -227,7 +226,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, int nfile, const t_filenm fnm[], gmx_signalling_t gs; gmx_groups_t *groups; gmx_ekindata_t *ekind; - gmx_shellfc_t shellfc; + gmx_shellfc_t *shellfc; int count, nconverged = 0; double tcount = 0; gmx_bool bConverged = TRUE, bSumEkinhOld, bDoReplEx, bExchanged, bNeedRepartition; -- 2.11.4.GIT