- Remove types/graph.h, and merge its contents into mshift.h.
This is a natural place for the structure, as the header already
contains most functions that operate on the graph.
- Make t_graph forward-declarable, and use that in headers that
previously got t_graph from typedefs.h.
- Add some missing mshift.h includes to source files that now need it.
Some additional cleanup of mshift.h dependencies will be done in
subsequent commits, when the header itself is moved.
Change-Id: Ia8c5817c11474c857a6845810e5e7f5a75f1c47c
#include "typedefs.h"
#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
#include "macros.h"
-#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "gromacs/utility/fatalerror.h"
#include "bondf.h"
#include "copyrite.h"
#include "disre.h"
#include "main.h"
#include "mtop_util.h"
+#include "gromacs/math/vec.h"
+#include "mshift.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
t_inputrec *ir, const t_commrec *cr,
t_fcdata *fcd, t_state *state, gmx_bool bIsREMD)
#include "typedefs.h"
#include "txtdump.h"
-#include "gromacs/utility/smalloc.h"
#include "ns.h"
#include "gromacs/math/vec.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/cstringutil.h"
#include "force.h"
#include "names.h"
-#include "gromacs/utility/fatalerror.h"
#include "force.h"
#include "bondf.h"
#include "nrnb.h"
#include "nonbonded.h"
#include "gromacs/simd/simd.h"
+#include "mshift.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
#include "nb_kernel.h"
#include "nb_free_energy.h"
#include "nb_generic.h"
#endif
#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/math/vec.h"
#include "types/commrec.h"
#include "network.h"
#include "orires.h"
#include "gromacs/linearalgebra/nrjac.h"
#include "gromacs/math/do_fit.h"
+#include "gromacs/math/vec.h"
+#include "mshift.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
void init_orires(FILE *fplog, const gmx_mtop_t *mtop,
rvec xref[],
#include "names.h"
#include "macros.h"
#include "gmx_omp_nthreads.h"
+#include "mshift.h"
/* Skip 0 so we have more chance of detecting if we forgot to call set_pbc. */
enum {
extern "C" {
#endif
+struct t_graph;
+
int glatnr(int *global_atom_index, int i);
/* Returns the global topology atom number belonging to local atom index i.
* This function is intended for writing ascii output
const t_idef *idef,
rvec x[], history_t *hist,
rvec f[], t_forcerec *fr,
- const t_pbc *pbc, const t_graph *g,
+ const t_pbc *pbc, const struct t_graph *g,
gmx_enerdata_t *enerd, t_nrnb *nrnb, real *lambda,
const t_mdatoms *md,
t_fcdata *fcd, int *ddgatindex,
const t_idef *idef,
rvec x[],
t_forcerec *fr,
- const t_pbc *pbc, const t_graph *g,
+ const t_pbc *pbc, const struct t_graph *g,
gmx_grppairener_t *grpp, real *epot, t_nrnb *nrnb,
real *lambda,
const t_mdatoms *md,
void do_dih_fup(int i, int j, int k, int l, real ddphi,
rvec r_ij, rvec r_kj, rvec r_kl,
rvec m, rvec n, rvec f[], rvec fshift[],
- const t_pbc *pbc, const t_graph *g,
+ const t_pbc *pbc, const struct t_graph *g,
const rvec *x, int t1, int t2, int t3);
/* Do an update of the forces for dihedral potentials */
extern "C" {
#endif
+struct t_graph;
+
void gmx_print_sepdvdl(FILE *fplog, const char *s, real v, real dvdlambda);
void calc_vir(int nxf, rvec x[], rvec f[], tensor vir,
/* Calculate virial for nxf atoms, and add it to vir */
void f_calc_vir(int i0, int i1, rvec x[], rvec f[], tensor vir,
- t_graph *g, rvec shift_vec[]);
+ struct t_graph *g, rvec shift_vec[]);
/* Calculate virial taking periodicity into account */
-real RF_excl_correction(const t_forcerec *fr, t_graph *g,
+real RF_excl_correction(const t_forcerec *fr, struct t_graph *g,
const t_mdatoms *mdatoms, const t_blocka *excl,
rvec x[], rvec f[], rvec *fshift, const t_pbc *pbc,
real lambda, real *dvdlambda);
tensor vir_force,
t_mdatoms *mdatoms,
gmx_enerdata_t *enerd, t_fcdata *fcd,
- real *lambda, t_graph *graph,
+ real *lambda, struct t_graph *graph,
t_forcerec *fr,
gmx_vsite_t *vsite, rvec mu_tot,
double t, FILE *field, gmx_edsam_t ed,
matrix box,
t_lambda *fepvals,
real *lambda,
- t_graph *graph,
+ struct t_graph *graph,
t_blocka *excl,
rvec mu_tot[2],
int flags,
#define STILL_P5INV (1.0/STILL_P5)
#define STILL_PIP5 (M_PI*STILL_P5)
+struct t_graph;
/* Initialise GB stuff */
int init_gb(gmx_genborn_t **p_born,
/* Bonded GB interactions */
real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtabscale,
real *invsqrta, real *dvda, real *GBtab, t_idef *idef, real epsilon_r,
- real gb_epsilon_solvent, real facel, const t_pbc *pbc, const t_graph *graph);
+ real gb_epsilon_solvent, real facel, const t_pbc *pbc,
+ const struct t_graph *graph);
void
calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top,
rvec x[], rvec f[], t_forcerec *fr, t_idef *idef, int gb_algorithm, int sa_algorithm, t_nrnb *nrnb,
- const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd);
+ const t_pbc *pbc, const struct t_graph *graph, gmx_enerdata_t *enerd);
int
make_gb_nblist(t_commrec *cr, int gb_algorithm,
rvec x[], matrix box,
- t_forcerec *fr, t_idef *idef, t_graph *graph, gmx_genborn_t *born);
+ t_forcerec *fr, t_idef *idef, struct t_graph *graph, gmx_genborn_t *born);
void
make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014, 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.
extern "C" {
#endif
+typedef enum {
+ egcolWhite, egcolGrey, egcolBlack, egcolNR
+} egCol;
+
+typedef struct t_graph {
+ int at0; /* The first atom the graph was constructed for */
+ int at1; /* The last atom the graph was constructed for */
+ int nnodes; /* The number of nodes, nnodes=at_end-at_start */
+ int nbound; /* The number of nodes with edges */
+ int at_start; /* The first connected atom in this graph */
+ int at_end; /* The last+1 connected atom in this graph */
+ int *nedge; /* For each node the number of edges */
+ atom_id **edge; /* For each node, the actual edges (bidirect.) */
+ gmx_bool bScrewPBC; /* Screw boundary conditions */
+ ivec *ishift; /* Shift for each particle */
+ int negc;
+ egCol *egc; /* color of each node */
+} t_graph;
+
+#define SHIFT_IVEC(g, i) ((g)->ishift[i])
+
+
t_graph *mk_graph(FILE *fplog,
t_idef *idef, int at_start, int at_end,
gmx_bool bShakeOnly, gmx_bool bSettle);
} /* fixes auto-indentation problems */
#endif
+struct t_graph;
void
*/
real
do_nonbonded_listed(int ftype, int nbonds, const t_iatom iatoms[], const t_iparams iparams[],
- const rvec x[], rvec f[], rvec fshift[], const t_pbc *pbc, const t_graph *g,
+ const rvec x[], rvec f[], rvec fshift[], const t_pbc *pbc, const struct t_graph *g,
real *lambda, real *dvdl, const t_mdatoms *md, const t_forcerec *fr,
gmx_grppairener_t *grppener, int *global_atom_index);
ecenterDEF = ecenterTRIC
};
+struct t_graph;
+
int ePBC2npbcdim(int ePBC);
/* Returns the number of dimensions that use pbc, starting at X */
int guess_ePBC(matrix box);
/* Guesses the type of periodic boundary conditions using the box */
-gmx_bool correct_box(FILE *fplog, int step, tensor box, t_graph *graph);
+gmx_bool correct_box(FILE *fplog, int step, tensor box, struct t_graph *graph);
/* Checks for un-allowed box angles and corrects the box
* and the integer shift vectors in the graph (if graph!=NULL) if necessary.
* Returns TRUE when the box was corrected.
#include "types/energy.h"
#include "types/inputrec.h"
#include "types/ishift.h"
-#include "types/graph.h"
#include "types/nrnb.h"
#include "types/nblist.h"
#include "types/nbnxn_pairlist.h"
+++ /dev/null
-/*
- * 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) 2013, 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 _types_graph_h
-#define _types_graph_h
-
-#include "idef.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-typedef enum {
- egcolWhite, egcolGrey, egcolBlack, egcolNR
-} egCol;
-
-typedef struct {
- int at0; /* The first atom the graph was constructed for */
- int at1; /* The last atom the graph was constructed for */
- int nnodes; /* The number of nodes, nnodes=at_end-at_start */
- int nbound; /* The number of nodes with edges */
- int at_start; /* The first connected atom in this graph */
- int at_end; /* The last+1 connected atom in this graph */
- int *nedge; /* For each node the number of edges */
- atom_id **edge; /* For each node, the actual edges (bidirect.) */
- gmx_bool bScrewPBC; /* Screw boundary conditions */
- ivec *ishift; /* Shift for each particle */
- int negc;
- egCol *egc; /* color of each node */
-} t_graph;
-
-
-#define SHIFT_IVEC(g, i) ((g)->ishift[i])
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _types_graph_h */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, 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.
#include "idef.h"
#include "mdatom.h"
#include "fcdata.h"
-#include "graph.h"
#include "pbc.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct t_graph;
typedef real t_ifunc (int nbonds, const t_iatom iatoms[],
const t_iparams iparams[],
const rvec x[], rvec f[], rvec fshift[],
- const t_pbc *pbc, const t_graph *g,
+ const t_pbc *pbc, const struct t_graph *g,
real lambda, real *dvdlambda,
const t_mdatoms *md, t_fcdata *fcd,
int *ddgatindex);
int th_ind_nalloc; /* Size of th_ind */
} gmx_vsite_t;
+struct t_graph;
+
void construct_vsites(gmx_vsite_t *vsite,
rvec x[],
real dt, rvec v[],
rvec x[], rvec f[], rvec *fshift,
gmx_bool VirCorr, matrix vir,
t_nrnb *nrnb, t_idef *idef,
- int ePBC, gmx_bool bMolPBC, t_graph *g, matrix box,
+ int ePBC, gmx_bool bMolPBC, struct t_graph *g, matrix box,
t_commrec *cr);
/* Spread the force operating on the vsite atoms on the surrounding atoms.
* If fshift!=NULL also update the shift forces.
#include "typedefs.h"
#include "types/commrec.h"
-#include "gromacs/utility/smalloc.h"
#include "genborn.h"
-#include "gromacs/math/vec.h"
#include "gromacs/fileio/pdbio.h"
#include "names.h"
#include "gromacs/math/units.h"
#include "domdec.h"
#include "network.h"
-#include "gromacs/utility/fatalerror.h"
#include "mtop_util.h"
#include "pbc.h"
#include "nrnb.h"
#include "bondf.h"
+#include "gromacs/math/vec.h"
+#include "mshift.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxmpi.h"
+#include "gromacs/utility/smalloc.h"
#ifdef GMX_SIMD_X86_SSE2_OR_HIGHER
# ifdef GMX_DOUBLE
#include "typedefs.h"
#include "force.h"
#include "names.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/math/units.h"
#include "copyrite.h"
#include "pbc.h"
+#include "mshift.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+
real RF_excl_correction(const t_forcerec *fr, t_graph *g,
const t_mdatoms *mdatoms, const t_blocka *excl,
rvec x[], rvec f[], rvec *fshift, const t_pbc *pbc,