GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
# Problematic with CUDA
# GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS)
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-declarations" GMXC_CXXFLAGS)
# CUDA versions prior to 7.5 come with a header (math_functions.h) which uses the _MSC_VER macro
# unconditionally, so we don't use -Wundef for earlier CUDA versions.
if(NOT(GMX_GPU AND CUDA_VERSION VERSION_LESS "7.5"))
endif()
if (GMX_COMPILER_WARNINGS)
GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-Wall" GMXC_CXXFLAGS)
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith -Wmissing-prototypes" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_DEPRECATED "-Wdeprecated" GMXC_CXXFLAGS)
endif()
endif()
void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
- ::testing::internal::ParamGenerator<test_case_name::ParamType> \
+ static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
int gtest_##prefix##test_case_name##_dummy_ = \
::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
}
/*! \brief Routine to normalize ACF, dividing by corr[0]. */
-void normalize_acf(int nout, real corr[])
+static void normalize_acf(int nout, real corr[])
{
int j;
double c0;
}
/*! \brief Routine that averages ACFs. */
-void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1)
+static void average_acf(gmx_bool bVerbose, int n, int nitem, real **c1)
{
real c0;
int i, j;
}
/*! \brief Normalize ACFs. */
-void norm_and_scale_vectors(int nframes, real c1[], real scale)
+static void norm_and_scale_vectors(int nframes, real c1[], real scale)
{
int j, m;
real *rij;
#include "gromacs/utility/smalloc.h"
#include "domdec_specatomcomm.h"
+#include "domdec_vsite.h"
#include "hash.h"
/*! \brief Struct used during constraint setup with domain decomposition */
#include "gmxpre.h"
+#include "pme-gather.h"
+
#include "gromacs/math/vec.h"
#include "gromacs/simd/simd.h"
#include "gromacs/utility/basedefinitions.h"
sfree(index);
}
-int line2type(char *line)
+static int line2type(char *line)
{
int k;
char type[8];
/*! \brief
* Google Test formatter for GromacsFileType values.
*/
-void PrintTo(const GromacsFileType &ftp, std::ostream *os)
+static void PrintTo(const GromacsFileType &ftp, std::ostream *os)
{
*os << "'" << ftp2ext(ftp) << "'";
}
gmx_fio_do_real(fio, iparams->harmonic.krB);
}
-void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
- gmx_bool bRead, int file_version)
+static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
+ gmx_bool bRead, int file_version)
{
int idum;
real rdum;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014,2015,2016,2017, 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.
}
}
-void pswap(int *v1, int *v2)
+static void pswap(int *v1, int *v2)
{
int temp;
temp = *v1;
}
-void Swap (real *v1, real *v2)
+static void Swap (real *v1, real *v2)
{
real temp;
temp = *v1;
+++ /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,2014,2015,2016, 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.
- */
-#include "gmxpre.h"
-
-#include "gromacs/topology/ifunc.h"
-#include "gromacs/topology/symtab.h"
-#include "gromacs/topology/topology.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/smalloc.h"
-
-void replace_atom(t_topology *top, int inr, char *anm, char *resnm,
- real q, real m, int type)
-{
- t_atoms *atoms;
-
- atoms = &(top->atoms);
-
- /* Replace important properties of an atom by other properties */
- if ((inr < 0) || (inr > atoms->nr))
- {
- gmx_fatal(FARGS, "Replace_atom: inr (%d) not in %d .. %d", inr, 0, atoms->nr);
- }
- if (debug)
- {
- fprintf(debug, "Replacing atom %d ... ", inr);
- }
- /* Charge, mass and type */
- atoms->atom[inr].q = atoms->atom[inr].qB = q;
- atoms->atom[inr].m = atoms->atom[inr].mB = m;
- atoms->atom[inr].type = atoms->atom[inr].typeB = type;
-
- /* Residue name */
- atoms->resinfo[atoms->atom[inr].resind].name = put_symtab(&top->symtab, resnm);
- /* Atom name */
- atoms->atomname[inr] = put_symtab(&top->symtab, anm);
- if (debug)
- {
- fprintf(debug, " done\n");
- }
-}
-
-static void delete_from_interactions(t_idef *idef, int inr)
-{
- int i, j, k, nra, nnr;
- t_iatom *niatoms;
- gmx_bool bDel;
-
- /* Delete interactions including atom inr from lists */
- for (i = 0; (i < F_NRE); i++)
- {
- nra = interaction_function[i].nratoms;
- nnr = 0;
- snew(niatoms, idef->il[i].nr);
- for (j = 0; (j < idef->il[i].nr); j += nra+1)
- {
- bDel = FALSE;
- for (k = 0; (k < nra); k++)
- {
- if (idef->il[i].iatoms[j+k+1] == inr)
- {
- bDel = TRUE;
- }
- }
- if (!bDel)
- {
- /* If this does not need to be deleted, then copy it to temp array */
- for (k = 0; (k < nra+1); k++)
- {
- niatoms[nnr+k] = idef->il[i].iatoms[j+k];
- }
- nnr += nra+1;
- }
- }
- /* Copy temp array back */
- for (j = 0; (j < nnr); j++)
- {
- idef->il[i].iatoms[j] = niatoms[j];
- }
- idef->il[i].nr = nnr;
- sfree(niatoms);
- }
-}
-
-static void delete_from_block(t_block *block, int inr)
-{
- /* Update block data structure */
- int i, i1, j;
-
- for (i = 0; (i < block->nr); i++)
- {
- for (j = block->index[i]; (j < block->index[i+1]); j++)
- {
- if (j == inr)
- {
- /* This atom has to go */
- /* Change indices too */
- for (i1 = i+1; (i1 <= block->nr); i1++)
- {
- block->index[i1]--;
- }
- }
- }
- }
-}
-
-static void delete_from_blocka(t_blocka *block, int inr)
-{
- /* Update block data structure */
- int i, i1, j1, j, k;
-
- for (i = 0; (i < block->nr); i++)
- {
- for (j = block->index[i]; (j < block->index[i+1]); j++)
- {
- k = block->a[j];
- if (k == inr)
- {
- /* This atom has to go */
- for (j1 = j; (j1 < block->nra-1); j1++)
- {
- block->a[j1] = block->a[j1+1];
- }
- block->nra--;
- /* Change indices too */
- for (i1 = i+1; (i1 <= block->nr); i1++)
- {
- block->index[i1]--;
- }
- }
- }
- }
-}
-
-static void delete_from_atoms(t_atoms *atoms, int inr)
-{
- int i;
-
- /* Shift the atomnames down */
- for (i = inr; (i < atoms->nr-1); i++)
- {
- atoms->atomname[i] = atoms->atomname[i+1];
- }
-
- /* Shift the atom struct down */
- for (i = inr; (i < atoms->nr-1); i++)
- {
- atoms->atom[i] = atoms->atom[i+1];
- }
-
- if (atoms->havePdbInfo)
- {
- /* Shift the pdbatom struct down */
- for (i = inr; (i < atoms->nr-1); i++)
- {
- atoms->pdbinfo[i] = atoms->pdbinfo[i+1];
- }
- }
- atoms->nr--;
-}
-
-void delete_atom(t_topology *top, int inr)
-{
- if ((inr < 0) || (inr >= top->atoms.nr))
- {
- gmx_fatal(FARGS, "Delete_atom: inr (%d) not in %d .. %d", inr, 0,
- top->atoms.nr);
- }
- if (debug)
- {
- fprintf(debug, "Deleting atom %d ...", inr);
- }
-
- /* First remove bonds etc. */
- delete_from_interactions(&top->idef, inr);
- /* Now charge groups etc. */
- delete_from_block(&(top->cgs), inr);
- delete_from_block(&(top->mols), inr);
- delete_from_blocka(&(top->excls), inr);
- /* Now from the atoms struct */
- delete_from_atoms(&top->atoms, inr);
- if (debug)
- {
- fprintf(debug, " done\n");
- }
-}
}
}
-void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
- const gmx_output_env_t *oenv)
+static void histogram(const char *distfile, real binwidth, int n, int nset, real **val,
+ const gmx_output_env_t *oenv)
{
FILE *fp;
int i, s;
}
/* write a collection of histograms to a file */
-void sim_data_histogram(sim_data_t *sd, const char *filename,
- int nbin_default, const gmx_output_env_t *oenv)
+static void sim_data_histogram(sim_data_t *sd, const char *filename,
+ int nbin_default, const gmx_output_env_t *oenv)
{
char label_x[STRLEN];
const char *dhdl = "dH/d\\lambda", *deltag = "\\DeltaH", *lambda = "\\lambda";
return (map[x][y] == '1') ? TRUE : FALSE;
}
-int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
+static int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
{
int *id;
int i, Xi, n;
return id;
}
-int bin(real chi, int mult)
-{
- mult = 3;
-
- return static_cast<int>(chi*mult/360.0);
-}
-
-
static void do_dihcorr(const char *fn, int nf, int ndih, real **dih, real dt,
int nlist, t_dlist dlist[], real time[], int maxchi,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bOmega,
int *nb;
} t_nnb;
-void cp_index(int nn, int from[], int to[])
-{
- int i;
-
- for (i = 0; (i < nn); i++)
- {
- to[i] = from[i];
- }
-}
-
-void mc_optimize(FILE *log, t_mat *m, real *time,
- int maxiter, int nrandom,
- int seed, real kT,
- const char *conv, gmx_output_env_t *oenv)
+static void mc_optimize(FILE *log, t_mat *m, real *time,
+ int maxiter, int nrandom,
+ int seed, real kT,
+ const char *conv, gmx_output_env_t *oenv)
{
FILE *fp = nullptr;
real ecur, enext, emin, prob, enorm;
return b.nr < a.nr;
}
-void gather(t_mat *m, real cutoff, t_clusters *clust)
+static void gather(t_mat *m, real cutoff, t_clusters *clust)
{
t_clustid *c;
t_dist *d;
sfree(d);
}
-gmx_bool jp_same(int **nnb, int i, int j, int P)
+static gmx_bool jp_same(int **nnb, int i, int j, int P)
{
gmx_bool bIn;
int k, ii, jj, pp;
clust->ncl = k-1;
}
-rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
- int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc)
+static rvec **read_whole_trj(const char *fn, int isize, int index[], int skip,
+ int *nframe, real **time, const gmx_output_env_t *oenv, gmx_bool bPBC, gmx_rmpbc_t gpbc)
{
rvec **xx, *x;
matrix box;
};
FILE *fp, *log;
- int nf, i, i1, i2, j;
+ int nf = 0, i, i1, i2, j;
gmx_int64_t nrms = 0;
matrix box;
static const int NOTSET = -9368163;
-void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
+static void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
{
int i, d;
real tm, m;
}
}
-int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
+static int build_res_index(int isize, int index[], t_atom atom[], int rindex[])
{
int i, r;
return r;
}
-int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
+static int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
{
int rnr;
return i;
}
-int debug_strcmp(char s1[], char s2[])
+static int debug_strcmp(char s1[], char s2[])
{
if (debug)
{
return std::strcmp(s1, s2);
}
-int find_next_match_atoms_in_res(int *i1, int index1[],
- int m1, char **atnms1[],
- int *i2, int index2[],
- int m2, char **atnms2[])
+static int find_next_match_atoms_in_res(int *i1, int index1[],
+ int m1, char **atnms1[],
+ int *i2, int index2[],
+ int m2, char **atnms2[])
{
int dx, dy, dmax, cmp;
gmx_bool bFW = FALSE;
return cmp;
}
-int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
+static int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
{
int i;
}
}
-void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1,
- int *isize2, int index2[], const t_atoms *atoms2)
+static void find_matching_names(int *isize1, int index1[], const t_atoms *atoms1,
+ int *isize2, int index2[], const t_atoms *atoms2)
{
int i1, i2, ii1, ii2, m1, m2;
int atcmp, rescmp;
/****************************************************************************/
/* used for sorting the list */
-int compare(void *a, void *b)
+static int compare(void *a, void *b)
{
t_electron *tmp1, *tmp2;
tmp1 = (t_electron *)a; tmp2 = (t_electron *)b;
return std::strcmp(tmp1->atomname, tmp2->atomname);
}
-int get_electrons(t_electron **eltab, const char *fn)
+static int get_electrons(t_electron **eltab, const char *fn)
{
char buffer[256]; /* to read in a line */
char tempname[80]; /* buffer to hold name */
return nr;
}
-void center_coords(t_atoms *atoms, int *index_center, int ncenter,
- matrix box, rvec x0[])
+static void center_coords(t_atoms *atoms, int *index_center, int ncenter,
+ matrix box, rvec x0[])
{
int i, k, m;
real tmass, mm;
}
}
-void calc_electron_density(const char *fn, int **index, int gnx[],
- double ***slDensity, int *nslices, t_topology *top,
- int ePBC,
- int axis, int nr_grps, real *slWidth,
- t_electron eltab[], int nr, gmx_bool bCenter,
- int *index_center, int ncenter,
- gmx_bool bRelative, const gmx_output_env_t *oenv)
+static void calc_electron_density(const char *fn, int **index, int gnx[],
+ double ***slDensity, int *nslices, t_topology *top,
+ int ePBC,
+ int axis, int nr_grps, real *slWidth,
+ t_electron eltab[], int nr, gmx_bool bCenter,
+ int *index_center, int ncenter,
+ gmx_bool bRelative, const gmx_output_env_t *oenv)
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
sfree(x0); /* free memory used by coordinate array */
}
-void calc_density(const char *fn, int **index, int gnx[],
- double ***slDensity, int *nslices, t_topology *top, int ePBC,
- int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
- int *index_center, int ncenter,
- gmx_bool bRelative, const gmx_output_env_t *oenv)
+static void calc_density(const char *fn, int **index, int gnx[],
+ double ***slDensity, int *nslices, t_topology *top, int ePBC,
+ int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
+ int *index_center, int ncenter,
+ gmx_bool bRelative, const gmx_output_env_t *oenv)
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
sfree(x0); /* free memory used by coordinate array */
}
-void plot_density(double *slDensity[], const char *afile, int nslices,
- int nr_grps, char *grpname[], real slWidth,
- const char **dens_opt,
- gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize,
- const gmx_output_env_t *oenv)
+static void plot_density(double *slDensity[], const char *afile, int nslices,
+ int nr_grps, char *grpname[], real slWidth,
+ const char **dens_opt,
+ gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize,
+ const gmx_output_env_t *oenv)
{
FILE *den;
const char *title = nullptr;
#include "gromacs/utility/smalloc.h"
/* Determines at which point in the array the fit should start */
-int calc_nbegin(int nx, real x[], real tbegin)
+static int calc_nbegin(int nx, real x[], real tbegin)
{
int nbegin;
return nbegin;
}
-real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[],
- real tendInt, int nsmooth)
+static real numerical_deriv(int nx, real x[], real y[], real fity[], real combined[], real dy[],
+ real tendInt, int nsmooth)
{
FILE *tmpfp;
int i, nbegin, i0, i1;
return integralSmth;
}
-void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
- real eps0, real epsRF, const gmx_output_env_t *oenv)
+static void do_four(const char *fn, const char *cn, int nx, real x[], real dy[],
+ real eps0, real epsRF, const gmx_output_env_t *oenv)
{
FILE *fp, *cp;
t_complex *tmp, gw, hw, kw;
xvgrclose(fp);
}
-gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
- real *t, int nre, t_enxframe *fr)
+static gmx_bool read_mu_from_enx(ener_file_t fmu, int Vol, ivec iMu, rvec mu, real *vol,
+ real *t, int nre, t_enxframe *fr)
{
int i;
gmx_bool bCont;
/*
* Calculates epsilon according to M. Neumann, Mol. Phys. 50, 841 (1983)
*/
-real calc_eps(double M_diff, double volume, double epsRF, double temp)
+static real calc_eps(double M_diff, double volume, double epsRF, double temp)
{
double eps, A, teller, noemer;
double eps_0 = 8.854187817e-12; /* epsilon_0 in C^2 J^-1 m^-1 */
}
}
-void dipole_atom2molindex(int *n, int *index, const t_block *mols)
+static void dipole_atom2molindex(int *n, int *index, const t_block *mols)
{
int nmol, i, j, m;
}
}
-int tpcomp(const void *a, const void *b)
+static int tpcomp(const void *a, const void *b)
{
t_toppop *tpa;
t_toppop *tpb;
}
}
-void prune_ss_legend(t_matrix *mat)
+static void prune_ss_legend(t_matrix *mat)
{
gmx_bool *present;
int *newnum;
}
}
-void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat)
+static void write_sas_mat(const char *fn, real **accr, int nframe, int nres, t_matrix *mat)
{
real lo, hi;
int i, j, nlev;
}
}
-void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
- const gmx_output_env_t *oenv)
+static void analyse_ss(const char *outfile, t_matrix *mat, const char *ss_string,
+ const gmx_output_env_t *oenv)
{
FILE *fp;
t_mapping *map;
#include "gromacs/utility/strdb.h"
-real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps)
+static real calc_mass(t_atoms *atoms, gmx_bool bGetMass, gmx_atomprop_t aps)
{
real tmass;
int i;
return tmass;
}
-real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
- rvec maxval, gmx_bool bDiam)
+static real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
+ rvec maxval, gmx_bool bDiam)
{
real diam2, d;
int ii, i, j;
return std::sqrt(diam2);
}
-void center_conf(int natom, rvec *x, rvec center, rvec geom_cent)
+static void center_conf(int natom, rvec *x, rvec center, rvec geom_cent)
{
int i;
rvec shift;
}
}
-void scale_conf(int natom, rvec x[], matrix box, rvec scale)
+static void scale_conf(int natom, rvec x[], matrix box, rvec scale)
{
int i, j;
}
}
-void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr)
+static void read_bfac(const char *fn, int *n_bfac, double **bfac_val, int **bfac_nr)
{
int i;
char **bfac_lines;
}
-void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac,
- double *bfac, int *bfac_nr, gmx_bool peratom)
+static void set_pdb_conf_bfac(int natoms, int nres, t_atoms *atoms, int n_bfac,
+ double *bfac, int *bfac_nr, gmx_bool peratom)
{
real bfac_min, bfac_max;
int i, n;
}
}
-void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
+static void pdb_legend(FILE *out, int natoms, int nres, t_atoms *atoms, rvec x[])
{
real bfac_min, bfac_max, xmin, ymin, zmin;
int i;
}
}
-void visualize_images(const char *fn, int ePBC, matrix box)
+static void visualize_images(const char *fn, int ePBC, matrix box)
{
t_atoms atoms;
rvec *img;
sfree(img);
}
-void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
+static void visualize_box(FILE *out, int a0, int r0, matrix box, rvec gridsize)
{
int *edge;
rvec *vert, shift;
}
}
-void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix)
+static void calc_rotmatrix(rvec principal_axis, rvec targetvec, matrix rotmatrix)
{
rvec rotvec;
real ux, uy, uz, costheta, sintheta;
return str;
}
-void sort_ions(int nsa, int nw, int repl[], int index[],
- t_atoms *atoms, rvec x[],
- const char *p_name, const char *n_name)
+static void sort_ions(int nsa, int nw, int repl[], int index[],
+ t_atoms *atoms, rvec x[],
+ const char *p_name, const char *n_name)
{
int i, j, k, r, np, nn, starta, startr, npi, nni;
rvec *xt;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm,
- rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
+static real calc_gyro(rvec x[], int gnx, int index[], t_atom atom[], real tm,
+ rvec gvec, rvec d, gmx_bool bQ, gmx_bool bRot, gmx_bool bMOI, matrix trans)
{
int i, ii, m;
real gyro, dx2, m0, Itot;
return std::sqrt(gyro/tm);
}
-void calc_gyro_z(rvec x[], matrix box,
- int gnx, int index[], t_atom atom[],
- int nz, real time, FILE *out)
+static void calc_gyro_z(rvec x[], matrix box,
+ int gnx, int index[], t_atom atom[],
+ int nz, real time, FILE *out)
{
static dvec *inertia = nullptr;
static double *tm = nullptr;
/* directions. */
/****************************************************************************/
-void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
- real **slOrder, real *slWidth, int *nslices,
- const t_topology *top, int ePBC,
- int axis, gmx_bool bMicel, int micel[], int nmic,
- const gmx_output_env_t *oenv)
+static void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
+ real **slOrder, real *slWidth, int *nslices,
+ const t_topology *top, int ePBC,
+ int axis, gmx_bool bMicel, int micel[], int nmic,
+ const gmx_output_env_t *oenv)
{
rvec *x0, /* coordinates with pbc */
dipole, /* dipole moment due to one molecules */
sfree(x0); /* free memory used by coordinate arrays */
}
-void h2order_plot(rvec dipole[], real order[], const char *afile,
- int nslices, real slWidth, const gmx_output_env_t *oenv)
+static void h2order_plot(rvec dipole[], real order[], const char *afile,
+ int nslices, real slWidth, const gmx_output_env_t *oenv)
{
FILE *ord; /* xvgr files with order parameters */
int slice; /* loop index */
return ld;
}
-real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq,
- real fac_lj, real fac_qq)
+static real calc_lie(t_liedata *ld, t_energy ee[], real lie_lj, real lie_qq,
+ real fac_lj, real fac_qq)
{
int i;
real lj_tot, qq_tot;
-void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[])
+static void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[])
{
edx->nr = natoms;
edx->anrs = index;
edx->x = pos;
}
-void write_t_edx(FILE *fp, struct edix edx, const char *comment)
+static void write_t_edx(FILE *fp, struct edix edx, const char *comment)
{
/*here we copy only the pointers into the t_edx struct
no data is copied and edx.box is ignored */
}
}
-int sscan_list(int *list[], const char *str, const char *listname)
+static int sscan_list(int *list[], const char *str, const char *listname)
{
/*this routine scans a string of the form 1,3-6,9 and returns the
selected numbers (in this case 1 3 4 5 6 9) in NULL-terminated array of integers.
return nvecs;
} /*sscan_list*/
-void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[])
+static void write_eigvec(FILE* fp, int natoms, int eig_list[], rvec** eigvecs, int nvec, const char *grouptitle, real steps[])
{
/* eig_list is a zero-terminated list of indices into the eigvecs array.
eigvecs are coordinates of eigenvectors
#define MAGIC 670
-void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
- int nvec, int *eig_listen[], real* evStepList[])
+static void write_the_whole_thing(FILE* fp, t_edipar *edpars, rvec** eigvecs,
+ int nvec, int *eig_listen[], real* evStepList[])
{
/* write edi-file */
write_t_edx(fp, edpars->sori, "NORIGIN, XORIGIN");
}
-int read_conffile(const char *confin, rvec **x)
+static int read_conffile(const char *confin, rvec **x)
{
t_topology top;
matrix box;
}
-void read_eigenvalues(int vecs[], const char *eigfile, real values[],
- gmx_bool bHesse, real kT, int natoms_average_struct)
+static void read_eigenvalues(int vecs[], const char *eigfile, real values[],
+ gmx_bool bHesse, real kT, int natoms_average_struct)
{
int neig, nrow, i;
double **eigval;
}
-void init_edx(struct edix *edx)
+static void init_edx(struct edix *edx)
{
edx->nr = 0;
snew(edx->x, 1);
snew(edx->anrs, 1);
}
-void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
- int igro[], const rvec *x, const char* structure)
+static void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
+ int igro[], const rvec *x, const char* structure)
{
/* filter2edx copies coordinates from x to edx which are given in index
*/
}
}
-void get_structure(const t_atoms *atoms, const char *IndexFile,
- const char *StructureFile, struct edix *edx, int nfit,
- int ifit[], int nav, int index[])
+static void get_structure(const t_atoms *atoms, const char *IndexFile,
+ const char *StructureFile, struct edix *edx, int nfit,
+ int ifit[], int nav, int index[])
{
int *igro; /*index corresponding to target or origin structure*/
int ngro;
return natoms;
}
-void merge_blocks(t_blocka *dest, t_blocka *source)
+static void merge_blocks(t_blocka *dest, t_blocka *source)
{
int i, nra0, i0;
#define FARAWAY 10000
-int *res_ndx(t_atoms *atoms)
+static int *res_ndx(t_atoms *atoms)
{
int *rndx;
int i, r0;
return rndx;
}
-int *res_natm(t_atoms *atoms)
+static int *res_natm(t_atoms *atoms)
{
int *natm;
int i, j, r0;
*rmax = std::sqrt(rmax2);
}
-void dist_plot(const char *fn, const char *afile, const char *dfile,
- const char *nfile, const char *rfile, const char *xfile,
- real rcut, gmx_bool bMat, const t_atoms *atoms,
- int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit,
- gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC,
- gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName,
- const gmx_output_env_t *oenv)
+static void dist_plot(const char *fn, const char *afile, const char *dfile,
+ const char *nfile, const char *rfile, const char *xfile,
+ real rcut, gmx_bool bMat, const t_atoms *atoms,
+ int ng, int *index[], int gnx[], char *grpn[], gmx_bool bSplit,
+ gmx_bool bMin, int nres, int *residue, gmx_bool bPBC, int ePBC,
+ gmx_bool bGroup, gmx_bool bEachResEachTime, gmx_bool bPrintResName,
+ const gmx_output_env_t *oenv)
{
FILE *atm, *dist, *num;
t_trxstatus *trxout;
sfree(x0);
}
-int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
+static int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
{
int i;
int nres = 0, resnr, presnr = 0;
return nres;
}
-void dump_res(FILE *out, int nres, int *resindex, int index[])
+static void dump_res(FILE *out, int nres, int *resindex, int index[])
{
int i, j;
return curr->nframes-curr->n_offs[nx00];
}
-t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
- int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
- real beginfit, real endfit)
+static t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
+ int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
+ real beginfit, real endfit)
{
t_corr *curr;
int i;
* fx and nx are file pointers to things like read_first_x and
* read_next_x
*/
-int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
- gmx_bool bMol, int gnx[], int *index[],
- t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[],
- real dt, real t_pdb, rvec **x_pdb, matrix box_pdb,
- const gmx_output_env_t *oenv)
+static int corr_loop(t_corr *curr, const char *fn, const t_topology *top, int ePBC,
+ gmx_bool bMol, int gnx[], int *index[],
+ t_calc_func *calc1, gmx_bool bTen, int *gnx_com, int *index_com[],
+ real dt, real t_pdb, rvec **x_pdb, matrix box_pdb,
+ const gmx_output_env_t *oenv)
{
rvec *x[2]; /* the coordinates to read */
rvec *xa[2]; /* the coordinates to calculate displacements for */
*n = nmol;
}
-void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
- const char *mol_file, const char *pdb_file, real t_pdb,
- int nrgrp, t_topology *top, int ePBC,
- gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM,
- int type, real dim_factor, int axis,
- real dt, real beginfit, real endfit, const gmx_output_env_t *oenv)
+static void do_corr(const char *trx_file, const char *ndx_file, const char *msd_file,
+ const char *mol_file, const char *pdb_file, real t_pdb,
+ int nrgrp, t_topology *top, int ePBC,
+ gmx_bool bTen, gmx_bool bMW, gmx_bool bRmCOMM,
+ int type, real dim_factor, int axis,
+ real dt, real beginfit, real endfit, const gmx_output_env_t *oenv)
{
t_corr *msd;
int *gnx; /* the selected groups' sizes */
}
}
-void calc_order(const char *fn, int *index, int *a, rvec **order,
- real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
- gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis,
- gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
- real ***distvals,
- const gmx_output_env_t *oenv)
+static void calc_order(const char *fn, int *index, int *a, rvec **order,
+ real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
+ gmx_bool bUnsat, const t_topology *top, int ePBC, int ngrps, int axis,
+ gmx_bool permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
+ real ***distvals,
+ const gmx_output_env_t *oenv)
{
/* if permolecule = TRUE, order parameters will be calculed per molecule
* and stored in slOrder with #slices = # molecules */
}
-void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile,
- const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly,
- gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv)
+static void order_plot(rvec order[], real *slOrder[], const char *afile, const char *bfile,
+ const char *cfile, int ngrps, int nslices, real slWidth, gmx_bool bSzonly,
+ gmx_bool permolecule, real **distvals, const gmx_output_env_t *oenv)
{
FILE *ord, *slOrd; /* xvgr files with order parameters */
int atom, slice; /* atom corresponding to order para.*/
xvgrclose(slOrd);
}
-void write_bfactors(t_filenm *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv)
+static void write_bfactors(t_filenm *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, const t_topology *top, real **distvals, gmx_output_env_t *oenv)
{
/*function to write order parameters as B factors in PDB file using
first frame of trajectory*/
/* this routine integrates the array data and returns the resulting array */
/* routine uses simple trapezoid rule */
-void p_integrate(double *result, double data[], int ndata, double slWidth)
+static void p_integrate(double *result, double data[], int ndata, double slWidth)
{
int i, slice;
double sum;
return;
}
-void calc_potential(const char *fn, int **index, int gnx[],
- double ***slPotential, double ***slCharge,
- double ***slField, int *nslices,
- const t_topology *top, int ePBC,
- int axis, int nr_grps, double *slWidth,
- double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect,
- const gmx_output_env_t *oenv)
+static void calc_potential(const char *fn, int **index, int gnx[],
+ double ***slPotential, double ***slCharge,
+ double ***slField, int *nslices,
+ const t_topology *top, int ePBC,
+ int axis, int nr_grps, double *slWidth,
+ double fudge_z, gmx_bool bSpherical, gmx_bool bCorrect,
+ const gmx_output_env_t *oenv)
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
sfree(x0); /* free memory used by coordinate array */
}
-void plot_potential(double *potential[], double *charge[], double *field[],
- const char *afile, const char *bfile, const char *cfile,
- int nslices, int nr_grps, const char *grpname[], double slWidth,
- const gmx_output_env_t *oenv)
+static void plot_potential(double *potential[], double *charge[], double *field[],
+ const char *afile, const char *bfile, const char *cfile,
+ int nslices, int nr_grps, const char *grpname[], double slWidth,
+ const gmx_output_env_t *oenv)
{
FILE *pot, /* xvgr file with potential */
*cha, /* xvgr file with charges */
#include "gromacs/utility/smalloc.h"
-void
+static void
calc_principal_axes(const t_topology *top,
rvec *x,
int *index,
}
}
-real rms_diff(int natom, real **d, real **d_r)
+static real rms_diff(int natom, real **d, real **d_r)
{
int i, j;
real r, r2;
return atoms->pdbinfo[i].bfac;
}
-void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
- const gmx_output_env_t *oenv)
+static void correlate_aniso(const char *fn, t_atoms *ref, t_atoms *calc,
+ const gmx_output_env_t *oenv)
{
FILE *fp;
int i, j;
}
}
-void print_dir(FILE *fp, real *Uaver)
+static void print_dir(FILE *fp, real *Uaver)
{
real eigvec[DIM*DIM];
real tmp[DIM*DIM];
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/smalloc.h"
-real pot(real x, real qq, real c6, real cn, int npow)
+static real pot(real x, real qq, real c6, real cn, int npow)
{
return cn*pow(x, -npow)-c6/gmx::power6(x)+qq*ONE_4PI_EPS0/x;
}
-real bhpot(real x, real A, real B, real C)
+static real bhpot(real x, real A, real B, real C)
{
return A*std::exp(-B*x) - C/gmx::power6(x);
}
-real dpot(real x, real qq, real c6, real cn, int npow)
+static real dpot(real x, real qq, real c6, real cn, int npow)
{
return -(npow*cn*std::pow(x, -npow-1)-6*c6/(x*gmx::power6(x))+qq*ONE_4PI_EPS0/gmx::square(x));
}
}
}
-void spol_atom2molindex(int *n, int *index, const t_block *mols)
+static void spol_atom2molindex(int *n, int *index, const t_block *mols)
{
int nmol, i, j, m;
std::strcat(out_file, ext);
}
-void check_trr(const char *fn)
+static void check_trr(const char *fn)
{
if (fn2ftp(fn) != efTRR)
{
}
}
-void do_trunc(const char *fn, real t0)
+static void do_trunc(const char *fn, real t0)
{
t_fileio *in;
FILE *fp;
} t_UmbrellaOptions;
//! Make an umbrella window (may contain several histograms)
-t_UmbrellaWindow * initUmbrellaWindows(int nwin)
+static t_UmbrellaWindow * initUmbrellaWindows(int nwin)
{
t_UmbrellaWindow *win;
int i;
}
//! Delete an umbrella window (may contain several histograms)
-void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin)
+static void freeUmbrellaWindows(t_UmbrellaWindow *win, int nwin)
{
int i, j;
for (i = 0; i < nwin; i++)
/*! \brief
* Read and setup tabulated umbrella potential
*/
-void setup_tab(const char *fn, t_UmbrellaOptions *opt)
+static void setup_tab(const char *fn, t_UmbrellaOptions *opt)
{
int i, ny, nl;
double **y;
}
//! Read the header of an PDO file (position, force const, nr of groups)
-void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt)
+static void read_pdo_header(FILE * file, t_UmbrellaHeader * header, t_UmbrellaOptions *opt)
{
char line[2048];
char Buffer0[256], Buffer1[256], Buffer2[256], Buffer3[256], Buffer4[256];
* At the moment, this warning is avoided by hiding the format string
* the variable fmtlf.
*/
-void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
- int fileno, t_UmbrellaWindow * win,
- t_UmbrellaOptions *opt,
- gmx_bool bGetMinMax, real *mintmp, real *maxtmp)
+static void read_pdo_data(FILE * file, t_UmbrellaHeader * header,
+ int fileno, t_UmbrellaWindow * win,
+ t_UmbrellaOptions *opt,
+ gmx_bool bGetMinMax, real *mintmp, real *maxtmp)
{
int i, inttemp, bins, count, ntot;
real minval, maxval, minfound = 1e20, maxfound = -1e20;
* by this routine (not recommended). Since we now support autocorrelations, it is better to set
* an appropriate autocorrelation times instead of using this function.
*/
-void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows)
+static void enforceEqualWeights(t_UmbrellaWindow * window, int nWindows)
{
int i, k, j, NEnforced;
double ratio;
/*! \brief Simple linear interpolation between two given tabulated points
*/
-double tabulated_pot(double dist, t_UmbrellaOptions *opt)
+static double tabulated_pot(double dist, t_UmbrellaOptions *opt)
{
int jl, ju;
double pl, pu, dz, dp;
* After rapid convergence (using only substiantal contributions), we always switch to
* full precision.
*/
-void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
- t_UmbrellaOptions *opt)
+static void setup_acc_wham(double *profile, t_UmbrellaWindow * window, int nWindows,
+ t_UmbrellaOptions *opt)
{
int i, j, k, nGrptot = 0, nContrib = 0, nTot = 0;
double U, min = opt->min, dz = opt->dz, temp, ztot_half, distance, ztot, contrib1, contrib2;
}
//! Compute the PMF (one of the two main WHAM routines)
-void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows,
- t_UmbrellaOptions *opt, gmx_bool bExact)
+static void calc_profile(double *profile, t_UmbrellaWindow * window, int nWindows,
+ t_UmbrellaOptions *opt, gmx_bool bExact)
{
double ztot_half, ztot, min = opt->min, dz = opt->dz;
}
//! Compute the free energy offsets z (one of the two main WHAM routines)
-double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
- t_UmbrellaOptions *opt, gmx_bool bExact)
+static double calc_z(double * profile, t_UmbrellaWindow * window, int nWindows,
+ t_UmbrellaOptions *opt, gmx_bool bExact)
{
double min = opt->min, dz = opt->dz, ztot_half, ztot;
double maxglob = -1e20;
}
//! Make PMF symmetric around 0 (useful e.g. for membranes)
-void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt)
+static void symmetrizeProfile(double* profile, t_UmbrellaOptions *opt)
{
int i, j, bins = opt->bins;
double *prof2, min = opt->min, max = opt->max, dz = opt->dz, zsym, deltaz, profsym;
}
//! Set energy unit (kJ/mol,kT,kCal/mol) and set it to zero at opt->zProf0
-void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt)
+static void prof_normalization_and_unit(double * profile, t_UmbrellaOptions *opt)
{
int i, bins, imin;
double unit_factor = 1., diff;
}
//! Make an array of random integers (used for bootstrapping)
-void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng)
+static void getRandomIntArray(int nPull, int blockLength, int* randomArray, gmx::DefaultRandomEngine * rng)
{
gmx::UniformIntDistribution<int> dist(0, blockLength-1);
* This is used when bootstapping new trajectories and thereby create new histogtrams,
* but it is not required if we bootstrap complete histograms.
*/
-void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow,
- t_UmbrellaWindow *thisWindow, int pullid)
+static void copy_pullgrp_to_synthwindow(t_UmbrellaWindow *synthWindow,
+ t_UmbrellaWindow *thisWindow, int pullid)
{
synthWindow->N [0] = thisWindow->N [pullid];
synthWindow->Histo [0] = thisWindow->Histo [pullid];
* which are distributed according to the histograms. Required to generate
* the "synthetic" histograms for the Bootstrap method
*/
-void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
- t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel)
+static void calc_cumulatives(t_UmbrellaWindow *window, int nWindows,
+ t_UmbrellaOptions *opt, const char *fnhist, const char *xlabel)
{
int i, j, k, nbin;
double last;
*
* This is used to generate a random sequence distributed according to a histogram
*/
-void searchCumulative(double xx[], int n, double x, int *j)
+static void searchCumulative(double xx[], int n, double x, int *j)
{
int ju, jm, jl;
}
//! Bootstrap new trajectories and thereby generate new (bootstrapped) histograms
-void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow,
- int pullid, t_UmbrellaOptions *opt)
+static void create_synthetic_histo(t_UmbrellaWindow *synthWindow, t_UmbrellaWindow *thisWindow,
+ int pullid, t_UmbrellaOptions *opt)
{
int N, i, nbins, r_index, ibin;
double r, tausteps = 0.0, a, ap, dt, x, invsqrt2, g, y, sig = 0., z, mu = 0.;
* If bs_index>=0, a number is added to the output file name to allow the ouput of all
* sets of bootstrapped histograms.
*/
-void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows,
- int bs_index, t_UmbrellaOptions *opt, const char *xlabel)
+static void print_histograms(const char *fnhist, t_UmbrellaWindow * window, int nWindows,
+ int bs_index, t_UmbrellaOptions *opt, const char *xlabel)
{
char *fn = nullptr, *buf = nullptr, title[256];
FILE *fp;
}
//! Used for qsort to sort random numbers
-int func_wham_is_larger(const void *a, const void *b)
+static int func_wham_is_larger(const void *a, const void *b)
{
double *aa, *bb;
aa = (double*)a;
}
//! Make random weights for histograms for the Bayesian bootstrap of complete histograms)
-void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt)
+static void setRandomBsWeights(t_UmbrellaWindow *synthwin, int nAllPull, t_UmbrellaOptions *opt)
{
int i;
double *r;
}
//! The main bootstrapping routine
-void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
- const char *xlabel, char* ylabel, double *profile,
- t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt)
+static void do_bootstrapping(const char *fnres, const char* fnprof, const char *fnhist,
+ const char *xlabel, char* ylabel, double *profile,
+ t_UmbrellaWindow * window, int nWindows, t_UmbrellaOptions *opt)
{
t_UmbrellaWindow * synthWindow;
double *bsProfile, *bsProfiles_av, *bsProfiles_av2, maxchange = 1e20, tmp, stddev;
}
//! Return type of input file based on file extension (xvg, pdo, or tpr)
-int whaminFileType(char *fn)
+static int whaminFileType(char *fn)
{
int len;
len = std::strlen(fn);
}
//! Read the files names in pdo-files.dat, pullf/x-files.dat, tpr-files.dat
-void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
- t_UmbrellaOptions *opt)
+static void read_wham_in(const char *fn, char ***filenamesRet, int *nfilesRet,
+ t_UmbrellaOptions *opt)
{
char **filename = nullptr, tmp[WHAM_MAXFILELEN+2];
int nread, sizenow, i, block = 1;
}
//! Open a file or a pipe to a gzipped file
-FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
+static FILE *open_pdo_pipe(const char *fn, t_UmbrellaOptions *opt, gmx_bool *bPipeOpen)
{
char Buffer[1024], gunzip[1024], *Path = nullptr;
FILE *pipe = nullptr;
}
//! Close file or pipe
-void pdo_close_file(FILE *fp)
+static void pdo_close_file(FILE *fp)
{
#if HAVE_PIPES
pclose(fp);
}
//! Reading all pdo files
-void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
- t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
+static void read_pdo_files(char **fn, int nfiles, t_UmbrellaHeader* header,
+ t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
{
FILE *file;
real mintmp, maxtmp, done = 0.;
#define int2YN(a) (((a) == 0) ? ("N") : ("Y"))
//! Read pull groups from a tpr file (including position, force const, geometry, number of groups)
-void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel)
+static void read_tpr_header(const char *fn, t_UmbrellaHeader* header, t_UmbrellaOptions *opt, t_coordselection *coordsel)
{
t_inputrec irInstance;
t_inputrec *ir = &irInstance;
first = 0;
}
-//! 2-norm in a ndim-dimensional space
-double dist_ndim(double **dx, int ndim, int line)
-{
- int i;
- double r2 = 0.;
- for (i = 0; i < ndim; i++)
- {
- r2 += gmx::square(dx[i][line]);
- }
- return std::sqrt(r2);
-}
-
//! Read pullx.xvg or pullf.xvg
-void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
- t_UmbrellaWindow * window,
- t_UmbrellaOptions *opt,
- gmx_bool bGetMinMax, real *mintmp, real *maxtmp,
- t_coordselection *coordsel)
+static void read_pull_xf(const char *fn, t_UmbrellaHeader * header,
+ t_UmbrellaWindow * window,
+ t_UmbrellaOptions *opt,
+ gmx_bool bGetMinMax, real *mintmp, real *maxtmp,
+ t_coordselection *coordsel)
{
double **y = nullptr, pos = 0., t, force, time0 = 0., dt;
int ny, nt, bins, ibin, i, g, gUsed, dstep = 1;
}
//! read pullf-files.dat or pullx-files.dat and tpr-files.dat
-void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
- t_UmbrellaHeader* header,
- t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
+static void read_tpr_pullxf_files(char **fnTprs, char **fnPull, int nfiles,
+ t_UmbrellaHeader* header,
+ t_UmbrellaWindow *window, t_UmbrellaOptions *opt)
{
int i;
real mintmp, maxtmp;
* Note: Here we consider tau[int] := int_0^inf ACF(t) as the integrated autocorrelation times.
* The factor `g := 1 + 2*tau[int]` subsequently enters the uncertainty.
*/
-void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn)
+static void readIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins, const char* fn)
{
int nlines, ny, i, ig;
double **iact;
* If opt->bAllowReduceIact==FALSE, the ACTs are never reduced, only increased
* by the smoothing
*/
-void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt)
+static void smoothIact(t_UmbrellaWindow *window, int nwins, t_UmbrellaOptions *opt)
{
int i, ig, j, jg;
double pos, dpos2, siglim, siglim2, gaufact, invtwosig2, w, weight, tausm;
/*! \brief Try to compute the autocorrelation time for each umbrealla window
*/
-void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
- t_UmbrellaOptions *opt, const char *fn, const char *xlabel)
+static void calcIntegratedAutocorrelationTimes(t_UmbrellaWindow *window, int nwins,
+ t_UmbrellaOptions *opt, const char *fn, const char *xlabel)
{
int i, ig, ncorr, ntot, j, k, *count, restart;
real *corr, c0, dt, tmp;
/*! \brief
* compute average and sigma of each umbrella histogram
*/
-void averageSigma(t_UmbrellaWindow *window, int nwins)
+static void averageSigma(t_UmbrellaWindow *window, int nwins)
{
int i, ig, ntot, k;
real av, sum2, sig, diff, *ztime, nSamplesIndep;
/*! \brief
* Use histograms to compute average force on pull group.
*/
-void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt)
+static void computeAverageForce(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt)
{
int i, j, bins = opt->bins, k;
double dz, min = opt->min, max = opt->max, displAv, temp, distance, ztot, ztot_half, w, weight;
/*! \brief
* Check if the complete reaction coordinate is covered by the histograms
*/
-void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins,
- t_UmbrellaOptions *opt)
+static void checkReactionCoordinateCovered(t_UmbrellaWindow *window, int nwins,
+ t_UmbrellaOptions *opt)
{
int i, ig, j, bins = opt->bins, bBoundary;
real avcount = 0, z, relcount, *count;
*
* This speeds up the convergence by roughly a factor of 2
*/
-void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel)
+static void guessPotByIntegration(t_UmbrellaWindow *window, int nWindows, t_UmbrellaOptions *opt, const char *xlabel)
{
int i, j, ig, bins = opt->bins, nHist, winmin, groupmin;
double dz, min = opt->min, *pot, pos, hispos, dist, diff, fAv, distmin, *f;
*
* TO DO: ptr=fgets(...) is never freed (small memory leak)
*/
-void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
+static void readPullCoordSelection(t_UmbrellaOptions *opt, char **fnTpr, int nTpr)
{
FILE *fp;
int i, iline, n, len = STRLEN, temp;
return bb;
}
-void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title)
+static void wheel(const char *fn, int nres, char *resnm[], int r0, real rot0, char *title)
{
const real fontsize = 16;
const real gray = 0.9;
ps_close(out);
}
-void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title)
+static void wheel2(const char *fn, int nres, char *resnm[], real rot0, char *title)
{
const real fontsize = 14;
const real gray = 0.9;
ecSel, ecHalves, ecAdd, ecSub, ecMult, ecDiv, ecNR
};
-void get_params(const char *mpin, const char *mpout, t_psrec *psr)
+static void get_params(const char *mpin, const char *mpout, t_psrec *psr)
{
static const char *gmx_bools[BOOL_NR+1] = { "no", "yes", nullptr };
/* this must correspond to t_rgb *linecolors[] below */
/* this must correspond to *colors[] in get_params */
t_rgb *linecolors[] = { nullptr, &black, &white, nullptr };
-gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
+static gmx_bool diff_maps(int nmap1, t_mapping *map1, int nmap2, t_mapping *map2)
{
int i;
gmx_bool bDiff, bColDiff = FALSE;
return bDiff;
}
-void leg_discrete(t_psdata ps, real x0, real y0, char *label,
- real fontsize, char *font, int nmap, t_mapping map[])
+static void leg_discrete(t_psdata ps, real x0, real y0, char *label,
+ real fontsize, char *font, int nmap, t_mapping map[])
{
int i;
real yhh;
}
}
-void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
- real fontsize, char *font,
- int nmap, t_mapping map[],
- int mapoffset)
+static void leg_continuous(t_psdata ps, real x0, real x, real y0, char *label,
+ real fontsize, char *font,
+ int nmap, t_mapping map[],
+ int mapoffset)
{
int i;
real xx0;
- boxxh/2, yhh, map[nmap-1].desc, eXCenter);
}
-void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1,
- char *label2, real fontsize, char *font,
- int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
+static void leg_bicontinuous(t_psdata ps, real x0, real x, real y0, char *label1,
+ char *label2, real fontsize, char *font,
+ int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
{
real xx1, xx2, x1, x2;
*dh = dhh;
}
-int add_maps(t_mapping **newmap,
- int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
+static int add_maps(t_mapping **newmap,
+ int nmap1, t_mapping map1[], int nmap2, t_mapping map2[])
{
static char mapper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+{}|;:',<.>/?";
int nsymbols;
return nmap;
}
-void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
- gmx_bool bDiag, gmx_bool bFirstDiag)
+static void xpm_mat(const char *outf, int nmat, t_matrix *mat, t_matrix *mat2,
+ gmx_bool bDiag, gmx_bool bFirstDiag)
{
FILE *out;
int i, x, y, col;
axisnm, *major, *minor);
}
-void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
- gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag,
- gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
- real size, real boxx, real boxy, const char *m2p, const char *m2pout,
- int mapoffset)
+static void ps_mat(const char *outf, int nmat, t_matrix mat[], t_matrix mat2[],
+ gmx_bool bFrame, gmx_bool bDiag, gmx_bool bFirstDiag,
+ gmx_bool bTitle, gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
+ real size, real boxx, real boxy, const char *m2p, const char *m2pout,
+ int mapoffset)
{
const char *libm2p;
char *legend;
ps_close(out);
}
-void make_axis_labels(int nmat, t_matrix *mat)
+static void make_axis_labels(int nmat, t_matrix *mat)
{
int i, j;
}
}
-void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip)
+static void prune_mat(int nmat, t_matrix *mat, t_matrix *mat2, int skip)
{
int i, x, y, xs, ys;
}
}
-void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2)
+static void zero_lines(int nmat, t_matrix *mat, t_matrix *mat2)
{
int i, x, y, m;
t_matrix *mats;
}
}
-void write_combined_matrix(int ecombine, const char *fn,
- int nmat, t_matrix *mat1, t_matrix *mat2,
- real *cmin, real *cmax)
+static void write_combined_matrix(int ecombine, const char *fn,
+ int nmat, t_matrix *mat1, t_matrix *mat2,
+ real *cmin, real *cmax)
{
int i, j, k, nlevels;
FILE *out;
gmx_ffclose(out);
}
-void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
- gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle,
- gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
- real size, real boxx, real boxy,
- const char *epsfile, const char *xpmfile, const char *m2p,
- const char *m2pout, int skip, int mapoffset)
+static void do_mat(int nmat, t_matrix *mat, t_matrix *mat2,
+ gmx_bool bFrame, gmx_bool bZeroLine, gmx_bool bDiag, gmx_bool bFirstDiag, gmx_bool bTitle,
+ gmx_bool bTitleOnce, gmx_bool bYonce, int elegend,
+ real size, real boxx, real boxy,
+ const char *epsfile, const char *xpmfile, const char *m2p,
+ const char *m2pout, int skip, int mapoffset)
{
int i, j, k;
}
}
-void gradient_map(rvec grad, int nmap, t_mapping map[])
+static void gradient_map(rvec grad, int nmap, t_mapping map[])
{
int i;
real c;
}
}
-void gradient_mat(rvec grad, int nmat, t_matrix mat[])
+static void gradient_mat(rvec grad, int nmat, t_matrix mat[])
{
int m;
}
}
-void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[])
+static void rainbow_map(gmx_bool bBlue, int nmap, t_mapping map[])
{
int i;
real c, r, g, b;
}
}
-void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[])
+static void rainbow_mat(gmx_bool bBlue, int nmat, t_matrix mat[])
{
int m;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014,2015,2017, 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 "gromacs/utility/real.h"
#include "gromacs/utility/smalloc.h"
-void addtoavgenergy(t_complex *list, real *result, int size, int tsteps)
+static void addtoavgenergy(t_complex *list, real *result, int size, int tsteps)
{
int i;
for (i = 0; i < size; i++)
return 0;
}
-void
-nb_kernel_list_hash_destroy()
-{
- sfree(kernel_list_hash);
- kernel_list_hash = nullptr;
- kernel_list_hash_size = 0;
-}
-
-
nb_kernel_t *
nb_kernel_list_findkernel(FILE gmx_unused * log,
const char * arch,
/* This file is completely threadsafe - keep it that way! */
#include "gmxpre.h"
+#include "add_par.h"
+
#include <string.h>
#include <algorithm>
return NRE;
}
-gmx_bool is_hydro(t_atoms *atoms, int ai)
+static gmx_bool is_hydro(t_atoms *atoms, int ai)
{
return ((*(atoms->atomname[ai]))[0] == 'H');
}
return;
}
-void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
+static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
{
int i, j;
return nrdf;
}
-void
+static void
spline1d( double dx,
double * y,
int n,
}
-void
+static void
interpolate1d( double xmin,
double dx,
double * ya,
}
-void
+static void
setup_cmap (int grid_spacing,
int nc,
real * grid,
}
}
-void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing)
+static void init_cmap_grid(gmx_cmap_t *cmap_grid, int ngrid, int grid_spacing)
{
int i, nelem;
return bRet;
}
-int
+static int
rbonded_find_atoms_in_list(t_rbonded *b, t_rbonded blist[], int nlist, int natoms)
{
int i, k;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, 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.
/* This file is completely threadsafe - keep it that way! */
#include "gmxpre.h"
+#include "hizzie.h"
+
#include <stdio.h>
#include <string.h>
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, 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.
#ifndef GMX_GMXPREPROCESS_HIZZIE_H
#define GMX_GMXPREPROCESS_HIZZIE_H
+#include "gromacs/math/vectypes.h"
+#include "gromacs/topology/atoms.h"
+
void set_histp(t_atoms *pdba, rvec *x, real angle, real distance);
/* calculate HIStidine protonation state */
}
}
-void write_posres(char *fn, t_atoms *pdba, real fc)
+static void write_posres(char *fn, t_atoms *pdba, real fc)
{
FILE *fp;
int i;
return natom;
}
-void process_chain(t_atoms *pdba, rvec *x,
- gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU,
- gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan,
- gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan,
- real angle, real distance, t_symtab *symtab,
- int nrr, const rtprename_t *rr)
+static void process_chain(t_atoms *pdba, rvec *x,
+ gmx_bool bTrpU, gmx_bool bPheU, gmx_bool bTyrU,
+ gmx_bool bLysMan, gmx_bool bAspMan, gmx_bool bGluMan,
+ gmx_bool bHisMan, gmx_bool bArgMan, gmx_bool bGlnMan,
+ real angle, real distance, t_symtab *symtab,
+ int nrr, const rtprename_t *rr)
{
/* Rename aromatics, lys, asp and histidine */
if (bTyrU)
char altloc; /* alternate location indicator */
} t_pdbindex;
-int pdbicomp(const void *a, const void *b)
+static int pdbicomp(const void *a, const void *b)
{
t_pdbindex *pa, *pb;
int d;
return pdba->nr;
}
-void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end,
- gmx_residuetype_t *rt)
+static void find_nc_ter(t_atoms *pdba, int r0, int r1, int *r_start, int *r_end,
+ gmx_residuetype_t *rt)
{
int i;
const char *p_startrestype;
}
}
-void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack)
+static void add_atom_to_restp(t_restp *restp, int at_start, const t_hack *hack)
{
char buf[STRLEN];
int k;
}
}
-void read_expandedparams(int *ninp_p, t_inpfile **inp_p,
- t_expanded *expand, warninp_t wi)
+static void read_expandedparams(int *ninp_p, t_inpfile **inp_p,
+ t_expanded *expand, warninp_t wi)
{
int ninp;
t_inpfile *inp;
}
-void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
+static void make_IMD_group(t_IMD *IMDgroup, char *IMDgname, t_blocka *grps, char **gnames)
{
int ig, i;
return TRUE;
}
-gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
+static gmx_bool read_bondeds(int bt, FILE *in, char *line, t_restp *rtp)
{
char str[STRLEN];
int j, n, ni, maxrb;
}
}
-int get_bt(char* header)
+static int get_bt(char* header)
{
int i;
return NOTSET;
}
-void clear_t_restp(t_restp *rrtp)
+static void clear_t_restp(t_restp *rrtp)
{
memset((void *)rrtp, 0, sizeof(t_restp));
}
/* print all the ebtsNR type numbers */
-void print_resall_header(FILE *out, t_restp rtp[])
+static void print_resall_header(FILE *out, t_restp rtp[])
{
fprintf(out, "[ bondedtypes ]\n");
fprintf(out, "; bonds angles dihedrals impropers all_dihedrals nr_exclusions HH14 remove_dih\n");
"replace", "add", "delete"
};
-int find_kw(char *keyw)
+static int find_kw(char *keyw)
{
int i;
}
-int
+static int
find_gb_bondlength(t_params *plist, int ai, int aj, real *length)
{
int i, j, a1, a2;
}
-int
+static int
find_gb_anglelength(t_params *plist, int ai, int ak, real *length)
{
int i, j, a1, a2, a3;
return status;
}
-int
+static int
generate_gb_exclusion_interactions(t_molinfo *mi, gpp_atomtype_t atype, t_nextnb *nnb)
{
int j, n, ai, aj, ti, tj;
at->nr++;
}
-void push_cg(t_block *block, int *lastindex, int index, int a)
+static void push_cg(t_block *block, int *lastindex, int index, int a)
{
if (debug)
{
/* FREEING MEMORY */
-void done_bt (t_params *pl)
+static void done_bt (t_params *pl)
{
sfree(pl->param);
}
/* PRINTING STRUCTURES */
-void print_bt(FILE *out, directive d, gpp_atomtype_t at,
- int ftype, int fsubtype, t_params plist[],
- gmx_bool bFullDih)
+static void print_bt(FILE *out, directive d, gpp_atomtype_t at,
+ int ftype, int fsubtype, t_params plist[],
+ gmx_bool bFullDih)
{
/* This dihp is a DIRTY patch because the dih-types do not use
* all four atoms to determine the type.
return FALSE;
}
-void mk_bonds(int nnm, t_nm2type nmt[],
- t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
- gmx_bool bPBC, matrix box)
+static void mk_bonds(int nnm, t_nm2type nmt[],
+ t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
+ gmx_bool bPBC, matrix box)
{
t_param b;
int i, j;
fflush(stderr);
}
-int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot)
+static int *set_cgnr(t_atoms *atoms, gmx_bool bUsePDBcharge, real *qtot, real *mtot)
{
int i, n = 1;
int *cgnr;
return cgnr;
}
-gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
- int *nbonds, int nnm, t_nm2type nm2t[])
+static gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
+ int *nbonds, int nnm, t_nm2type nm2t[])
{
gpp_atomtype_t atype;
int nresolved;
return atype;
}
-void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
- gmx_bool bDih, gmx_bool bParam)
+static void lo_set_force_const(t_params *plist, real c[], int nrfp, gmx_bool bRound,
+ gmx_bool bDih, gmx_bool bParam)
{
int i, j;
double cc;
}
}
-void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound,
- gmx_bool bParam)
+static void set_force_const(t_params plist[], real kb, real kt, real kp, gmx_bool bRound,
+ gmx_bool bParam)
{
real c[MAXFORCEPARAM];
lo_set_force_const(&plist[F_PDIHS], c, 3, bRound, TRUE, bParam);
}
-void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC,
- matrix box)
+static void calc_angles_dihs(t_params *ang, t_params *dih, const rvec x[], gmx_bool bPBC,
+ matrix box)
{
int i, ai, aj, ak, al, t1, t2, t3;
rvec r_ij, r_kj, r_kl, m, n;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017, 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.
/*! \brief Builds a string with build options for the OpenCL kernels
*
* \throws std::bad_alloc if out of memory. */
-std::string
+static std::string
makePreprocessorOptions(const std::string &kernelRootPath,
size_t warpSize,
ocl_vendor_id_t deviceVendorId,
* identifying this particular device to host operation. The event can further
* be used to queue a wait for this operation or to query profiling information.
*/
-int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src,
- size_t offset, size_t bytes,
- bool bAsync,
- cl_command_queue command_queue,
- cl_event *copy_event)
+static int ocl_copy_D2H_generic(void * h_dest, cl_mem d_src,
+ size_t offset, size_t bytes,
+ bool bAsync,
+ cl_command_queue command_queue,
+ cl_event *copy_event)
{
cl_int gmx_unused cl_error;
return vtot;
}
-real harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
- real *V, real *F)
+static real harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
+ real *V, real *F)
{
const real half = 0.5;
real L1, kk, x0, dx, dx2;
}
#endif // GMX_SIMD_HAVE_REAL
-real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult,
- real phi, real lambda, real *V, real *F)
+static real dopdihs(real cpA, real cpB, real phiA, real phiB, int mult,
+ real phi, real lambda, real *V, real *F)
{
real v, dvdlambda, mdphi, v1, sdphi, ddphi;
real L1 = 1.0 - lambda;
* G R O M O S 9 6 F U N C T I O N S
*
***********************************************************/
-real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
- real *V, real *F)
+static real g96harmonic(real kA, real kB, real xA, real xB, real x, real lambda,
+ real *V, real *F)
{
const real half = 0.5;
real L1, kk, x0, dx, dx2;
return vtot;
}
-real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc,
- rvec r_ij, rvec r_kj,
- int *t1, int *t2)
+static real g96bond_angle(const rvec xi, const rvec xj, const rvec xk, const t_pbc *pbc,
+ rvec r_ij, rvec r_kj,
+ int *t1, int *t2)
/* Return value is the angle between the bonds i-j and j-k */
{
real costh;
}
/*! \brief Compute the energy and force for a single pair interaction */
-real
+static real
evaluate_single(real r2, real tabscale, real *vftab, real tableStride,
real qq, real c6, real c12, real *velec, real *vvdw)
{
}
/*! \brief Compute the energy and force for a single pair interaction under FEP */
-real
+static real
free_energy_evaluate_single(real r2, real sc_r_power, real alpha_coul,
real alpha_vdw, real tabscale, real *vftab, real tableStride,
real qqA, real c6A, real c12A, real qqB,
}
/* Sets the elements in the LINCS matrix */
-void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda)
+static void set_lincs_matrix(struct gmx_lincsdata *li, real *invmass, real lambda)
{
int i;
const real invsqrt2 = 0.7071067811865475244;
sfree(nene);
}
-real do_logsum(int N, real *a_n)
-{
-
- /* RETURN VALUE */
- /* log(\sum_{i=0}^(N-1) exp[a_n]) */
- real maxarg;
- real sum;
- int i;
- real logsum;
- /* compute maximum argument to exp(.) */
-
- maxarg = a_n[0];
- for (i = 1; i < N; i++)
- {
- maxarg = std::max(maxarg, a_n[i]);
- }
-
- /* compute sum of exp(a_n - maxarg) */
- sum = 0.0;
- for (i = 0; i < N; i++)
- {
- sum = sum + std::exp(a_n[i] - maxarg);
- }
-
- /* compute log sum */
- logsum = std::log(sum) + maxarg;
- return logsum;
-}
-
-int FindMinimum(real *min_metric, int N)
+static int FindMinimum(real *min_metric, int N)
{
real min_val;
return vctot;
}
-real calc_gb_selfcorrections(t_commrec *cr, int natoms,
- real *charge, gmx_genborn_t *born, real *dvda, double facel)
+static real calc_gb_selfcorrections(t_commrec *cr, int natoms,
+ real *charge, gmx_genborn_t *born, real *dvda, double facel)
{
int i, ai, at0, at1;
real rai, e, derb, q, q2, fi, rai_inv, vtot;
}
-real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *born, gmx_localtop_t *top,
- real *dvda, t_mdatoms *md)
+static real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *born, gmx_localtop_t *top,
+ real *dvda, t_mdatoms *md)
{
int ai, i, at0, at1;
real e, es, rai, term, probe, tmp, factor;
-real calc_gb_chainrule(int natoms, t_nblist *nl, real *dadx, real *dvda, rvec x[], rvec t[], rvec fshift[],
- rvec shift_vec[], int gb_algorithm, gmx_genborn_t *born)
+static real calc_gb_chainrule(int natoms, t_nblist *nl, real *dadx, real *dvda, rvec x[], rvec t[], rvec fshift[],
+ rvec shift_vec[], int gb_algorithm, gmx_genborn_t *born)
{
int i, k, n, ai, aj, nj0, nj1, n0, n1;
int shift;
}
-void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
+static void mde_delta_h_handle_block(t_mde_delta_h *dh, t_enxblock *blk)
{
/* first check which type we should use: histogram or raw data */
if (dh->nhist == 0)
#endif
+#include "nbnxn_cuda.h"
+
#include "gromacs/gpu_utils/cudautils.cuh"
#include "gromacs/mdlib/force_flags.h"
#include "gromacs/mdlib/nb_verlet.h"
plist->haveFreshList = false;
}
-/*! Return the reference to the nbfp texture. */
const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref()
{
assert(!c_disableCudaTextures);
return nbfp_texref;
}
-/*! Return the reference to the nbfp_comb texture. */
const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref()
{
assert(!c_disableCudaTextures);
return nbfp_comb_texref;
}
-/*! Return the reference to the coulomb_tab. */
const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref()
{
assert(!c_disableCudaTextures);
return coulomb_tab_texref;
}
-/*! Set up the cache configuration for the non-bonded kernels,
- */
void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo)
{
cudaError_t stat;
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2017, 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.
+ */
+/*! \internal \file
+ * \brief
+ * Declares nbnxn cuda cache and texture helper functions
+ */
+#ifndef GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H
+#define GMX_MDLIB_NBNXN_CUDA_NBNXN_CUDA_H
+
+#include "nbnxn_cuda_types.h"
+
+//! Set up the cache configuration for the non-bonded kernels.
+void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo);
+//! Return the reference to the nbfp texture.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref();
+//! Return the reference to the nbfp_comb texture.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref();
+//! Return the reference to the coulomb_tab.
+const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref();
+
+#endif
#include "gromacs/utility/real.h"
#include "gromacs/utility/smalloc.h"
+#include "nbnxn_cuda.h"
#include "nbnxn_cuda_types.h"
static bool bUseCudaEventBlockingSync = false; /* makes the CPU thread block */
*/
static unsigned int gpu_min_ci_balanced_factor = 44;
-/* Functions from nbnxn_cuda.cu */
-extern void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo);
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref();
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref();
-extern const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref();
-
-
/* Fw. decl. */
static void nbnxn_cuda_clear_e_fshift(gmx_nbnxn_cuda_t *nb);
nbparams_params->vdw_switch = nbp->vdw_switch;
}
-/*! \brief Waits for the commands associated with the input event to finish.
- * Then it releases the event and sets it to 0.
- * Don't use this function when more than one wait will be issued for the event.
- */
-void wait_ocl_event(cl_event *ocl_event)
-{
- cl_int gmx_unused cl_error;
-
- /* Blocking wait for the event */
- cl_error = clWaitForEvents(1, ocl_event);
- assert(CL_SUCCESS == cl_error);
-
- /* Release event and reset it to 0 */
- cl_error = clReleaseEvent(*ocl_event);
- assert(CL_SUCCESS == cl_error);
- *ocl_event = 0;
-}
-
/*! \brief Enqueues a wait for event completion.
*
* Then it releases the event and sets it to 0.
* Don't use this function when more than one wait will be issued for the event.
* Equivalent to Cuda Stream Sync. */
-void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
+static void sync_ocl_event(cl_command_queue stream, cl_event *ocl_event)
{
cl_int gmx_unused cl_error;
* The function returns 0.0 if the input event, *ocl_event, is 0.
* Don't use this function when more than one wait will be issued for the event.
*/
-double ocl_event_elapsed_ms(cl_event *ocl_event)
+static double ocl_event_elapsed_ms(cl_event *ocl_event)
{
cl_int gmx_unused cl_error;
cl_ulong start_ns, end_ns;
*
* If the pointers to the size variables are NULL no resetting happens.
*/
-void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc)
+static void ocl_free_buffered(cl_mem d_ptr, int *n, int *nalloc)
{
cl_int gmx_unused cl_error;
* for this operation or to query profiling information.
* OpenCL equivalent of cu_realloc_buffered.
*/
-void ocl_realloc_buffered(cl_mem *d_dest, void *h_src,
- size_t type_size,
- int *curr_size, int *curr_alloc_size,
- int req_size,
- cl_context context,
- cl_command_queue s,
- bool bAsync = true,
- cl_event *copy_event = NULL)
+static void ocl_realloc_buffered(cl_mem *d_dest, void *h_src,
+ size_t type_size,
+ int *curr_size, int *curr_alloc_size,
+ int req_size,
+ cl_context context,
+ cl_command_queue s,
+ bool bAsync = true,
+ cl_event *copy_event = NULL)
{
if (d_dest == NULL || req_size < 0)
{
}
/*! \brief Releases an OpenCL kernel pointer */
-void free_kernel(cl_kernel *kernel_ptr)
+static void free_kernel(cl_kernel *kernel_ptr)
{
cl_int gmx_unused cl_error;
}
/*! \brief Releases a list of OpenCL kernel pointers */
-void free_kernels(cl_kernel *kernels, int count)
+static void free_kernels(cl_kernel *kernels, int count)
{
int i;
return nns;
}
-void ns_realloc_natoms(gmx_ns_t *ns, int natoms)
+static void ns_realloc_natoms(gmx_ns_t *ns, int natoms)
{
int i;
}
}
-void get_nsgrid_boundaries_vac(real av, real stddev,
- real *bound0, real *bound1,
- real *bdens0, real *bdens1)
+static void get_nsgrid_boundaries_vac(real av, real stddev,
+ real *bound0, real *bound1,
+ real *bdens0, real *bdens1)
{
/* Set the grid to 2 times the standard deviation of
* the charge group centers in both directions.
*/
#include "gmxpre.h"
+#include "qm_orca.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
}
-void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
+static void write_orca_input(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
{
int i;
t_QMMMrec *QMMMrec;
fclose(out);
} /* write_orca_input */
-real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
- t_QMrec *qm, t_MMrec *mm)
+static real read_orca_output(rvec QMgrad[], rvec MMgrad[], t_forcerec *fr,
+ t_QMrec *qm, t_MMrec *mm)
{
int
i, j, atnum;
return(QMener);
}
-void do_orca(char *orca_dir, char *basename)
+static void do_orca(char *orca_dir, char *basename)
{
/* make the call to the orca binary through system()
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2017, 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.
+ */
+#include "gromacs/mdlib/qmmm.h"
+
+#ifndef GMX_MDLIB_QM_ORCA_H
+#define GMX_MDLIB_QM_ORCA_H
+
+void
+init_orca(t_QMrec *qm);
+
+real
+call_orca(t_forcerec *fr, t_QMrec *qm,
+ t_MMrec *mm, rvec f[], rvec fshift[]);
+
+#endif
call_gaussian(t_forcerec *fr, t_QMrec *qm, t_MMrec *mm, rvec f[], rvec fshift[]);
#elif GMX_QMMM_ORCA
-/* ORCA interface */
-
-void
-init_orca(t_QMrec *qm);
-
-real
-call_orca(t_forcerec *fr, t_QMrec *qm,
- t_MMrec *mm, rvec f[], rvec fshift[]);
-
+#include "gromacs/mdlib/qm_orca.h"
#endif
} /* struct_comp */
-real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
- t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[])
+static real call_QMroutine(t_commrec gmx_unused *cr, t_forcerec gmx_unused *fr, t_QMrec gmx_unused *qm,
+ t_MMrec gmx_unused *mm, rvec gmx_unused f[], rvec gmx_unused fshift[])
{
/* makes a call to the requested QM routine (qm->QMmethod)
* Note that f is actually the gradient, i.e. -f
return (QMener);
}
-void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
+static void init_QMroutine(t_commrec gmx_unused *cr, t_QMrec gmx_unused *qm, t_MMrec gmx_unused *mm)
{
/* makes a call to the requested QM routine (qm->QMmethod)
*/
}
} /* init_QMroutine */
-void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
+static void update_QMMM_coord(rvec x[], t_forcerec *fr, t_QMrec *qm, t_MMrec *mm)
{
/* shifts the QM and MM particles into the central box and stores
* these shifted coordinates in the coordinate arrays of the
/* QMMM core routines */
-t_QMrec *mk_QMrec(void)
+static t_QMrec *mk_QMrec(void)
{
t_QMrec *qm;
snew(qm, 1);
return qm;
} /* mk_QMrec */
-t_MMrec *mk_MMrec(void)
+static t_MMrec *mk_MMrec(void)
{
t_MMrec *mm;
snew(mm, 1);
} /* init_QMrec */
-t_QMrec *copy_QMrec(t_QMrec *qm)
+static t_QMrec *copy_QMrec(t_QMrec *qm)
{
/* copies the contents of qm into a new t_QMrec struct */
t_QMrec
*nerror = error;
}
-int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
- real invmass[], int ncon,
- t_iparams ip[], t_iatom *iatom,
- real tol, rvec x[], rvec prime[], real omega,
- gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[],
- real invdt, rvec *v,
- gmx_bool bCalcVir, tensor vir_r_m_dr, int econq)
+static int vec_shakef(FILE *fplog, gmx_shakedata_t shaked,
+ real invmass[], int ncon,
+ t_iparams ip[], t_iatom *iatom,
+ real tol, rvec x[], rvec prime[], real omega,
+ gmx_bool bFEP, real lambda, real scaled_lagrange_multiplier[],
+ real invdt, rvec *v,
+ gmx_bool bCalcVir, tensor vir_r_m_dr, int econq)
{
rvec *rij;
real *half_of_reduced_mass, *distance_squared_tolerance, *constraint_distance_squared;
}
}
-void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
- t_inputrec *inputrec,
- gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
- gmx_localtop_t *top,
- gmx_groups_t gmx_unused *groups,
- matrix box, rvec x[], history_t *hist,
- PaddedRVecVector *force,
- tensor vir_force,
- t_mdatoms *mdatoms,
- gmx_enerdata_t *enerd, t_fcdata *fcd,
- real *lambda, t_graph *graph,
- t_forcerec *fr, interaction_const_t *ic,
- gmx_vsite_t *vsite, rvec mu_tot,
- double t, gmx_edsam_t ed,
- gmx_bool bBornRadii,
- int flags,
- DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
- DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
+static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
+ t_inputrec *inputrec,
+ gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+ gmx_localtop_t *top,
+ gmx_groups_t gmx_unused *groups,
+ matrix box, rvec x[], history_t *hist,
+ PaddedRVecVector *force,
+ tensor vir_force,
+ t_mdatoms *mdatoms,
+ gmx_enerdata_t *enerd, t_fcdata *fcd,
+ real *lambda, t_graph *graph,
+ t_forcerec *fr, interaction_const_t *ic,
+ gmx_vsite_t *vsite, rvec mu_tot,
+ double t, gmx_edsam_t ed,
+ gmx_bool bBornRadii,
+ int flags,
+ DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+ DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
{
int cg1, i, j;
double mu[2*DIM];
}
}
-void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
- t_inputrec *inputrec,
- gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
- gmx_localtop_t *top,
- gmx_groups_t *groups,
- matrix box, rvec x[], history_t *hist,
- PaddedRVecVector *force,
- tensor vir_force,
- t_mdatoms *mdatoms,
- gmx_enerdata_t *enerd, t_fcdata *fcd,
- real *lambda, t_graph *graph,
- t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot,
- double t, gmx_edsam_t ed,
- gmx_bool bBornRadii,
- int flags,
- DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
- DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
+static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
+ t_inputrec *inputrec,
+ gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
+ gmx_localtop_t *top,
+ gmx_groups_t *groups,
+ matrix box, rvec x[], history_t *hist,
+ PaddedRVecVector *force,
+ tensor vir_force,
+ t_mdatoms *mdatoms,
+ gmx_enerdata_t *enerd, t_fcdata *fcd,
+ real *lambda, t_graph *graph,
+ t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot,
+ double t, gmx_edsam_t ed,
+ gmx_bool bBornRadii,
+ int flags,
+ DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
+ DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
{
int cg0, cg1, i, j;
double mu[2*DIM];
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/smalloc.h"
+#include "keywords.h"
#include "selmethod.h"
/** Defines the comparison operator for comparison expressions. */
* This routine should be called for the 'anions' and 'cations' group,
* of which the indices were lumped together in the older version of the code.
*/
-void copyIndicesToGroup(
+static void copyIndicesToGroup(
int *indIons,
int nIons,
t_swapGroup *g,
* #4 cations - empty before conversion
*
*/
-void convertOldToNewGroupFormat(
+static void convertOldToNewGroupFormat(
t_swapcoords *sc,
gmx_mtop_t *mtop,
gmx_bool bVerbose,
/*! \brief Returns TRUE if we started from an old .tpr
*
* Then we need to re-sort anions and cations into separate groups */
-gmx_bool bConvertFromOldTpr(t_swapcoords *sc)
+static gmx_bool bConvertFromOldTpr(t_swapcoords *sc)
{
// If the last group has no atoms it means we need to convert!
if ( (sc->ngrp >= 5) && (0 == sc->grp[4].nat) )
return wc;
}
-void wallcycle_destroy(gmx_wallcycle_t wc)
-{
+/* TODO: Should be called from finish_run() or runner()
+ void wallcycle_destroy(gmx_wallcycle_t wc)
+ {
if (wc == nullptr)
{
return;
sfree(wc->wcsc);
}
sfree(wc);
-}
+ }
+ */
static void wallcycle_all_start(gmx_wallcycle_t wc, int ewc, gmx_cycles_t cycle)
{
*/
#include "gmxpre.h"
+#include "check.h"
+
#include <cmath>
#include <cstdio>
#include <cstring>
}
}
-void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol)
+static void chk_trj(const gmx_output_env_t *oenv, const char *fn, const char *tpr, real tol)
{
t_trxframe fr;
t_count count;
PRINTITEM ( "Box", bBox );
}
-void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
+static void chk_tps(const char *fn, real vdw_fac, real bon_lo, real bon_hi)
{
int natom, i, j, k;
t_topology top;
}
}
-void chk_ndx(const char *fn)
+static void chk_ndx(const char *fn)
{
t_blocka *grps;
char **grpname;
done_blocka(grps);
}
-void chk_enx(const char *fn)
+static void chk_enx(const char *fn)
{
int nre, fnr;
ener_file_t in;
*/
#include "gmxpre.h"
+#include "convert_tpr.h"
+
#include <cmath>
#include "gromacs/commandline/pargs.h"
*/
#include "gmxpre.h"
+#include "dump.h"
+
#include "config.h"
#include <cassert>
gmx_trr_close(fpread);
}
-void list_xtc(const char *fn)
+static void list_xtc(const char *fn)
{
t_fileio *xd;
int indent;
#endif
}
-void list_trx(const char *fn)
+static void list_trx(const char *fn)
{
switch (fn2ftp(fn))
{
}
}
-void list_ene(const char *fn)
+static void list_ene(const char *fn)
{
ener_file_t in;
gmx_bool bCont;
s_maxBackupCount = count;
}
-void push_ps(FILE *fp)
+static void push_ps(FILE *fp)
{
t_pstack *ps;
}
/* remove al bonded interactions from mtop for the molecule to be embedded */
-int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop)
+static int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop)
{
int i, j, m;
int type, natom, nmol, at, atom1 = 0, rm_at = 0;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, 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.
}
//! Helper function to obtain resources
-t_enxframe *make_enxframe()
+static t_enxframe *make_enxframe()
{
t_enxframe *frame;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, 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.
{
//! Build a simple .mdp file
-void organizeMdpFile(SimulationRunner *runner)
+static void organizeMdpFile(SimulationRunner *runner)
{
// Make sure -maxh has a chance to propagate
runner->useStringAsMdpFile("nsteps = 100\n"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017, 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.
{
//! Helper function to obtain resources
-t_trxframe *make_trxframe()
+static t_trxframe *make_trxframe()
{
t_trxframe *frame;
"pixmap", "statictext", "edittext", "defbutton"
};
-void ReadDlgError(const char *infile, eDLGERR err, const char *s,
- const char *file, int line)
+static void ReadDlgError(const char *infile, eDLGERR err, const char *s,
+ const char *file, int line)
{
std::fprintf(stderr, "Error: ");
switch (err)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017, 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 "gmxpre.h"
+#include "molps.h"
+
#include <cstdlib>
#include "gromacs/fileio/writeps.h"
};
#define NAC asize(ac)
-int search_ac(const char *type)
+static int search_ac(const char *type)
{
unsigned int i, nb, mij, best, besti;
return &(ac[i].rgb);
}
-void DrawLegend(t_x11 *x11, t_windata *Win)
+static void DrawLegend(t_x11 *x11, t_windata *Win)
{
#define NLAB 6
#define COLS 3
return false;
}
-void set_def (t_molwin *mw, int ePBC, matrix box)
+static void set_def (t_molwin *mw, int ePBC, matrix box)
{
mw->bShowHydrogen = true;
mw->bond_type = eBFat;
return nvis;
}
-void draw_objects(Display *disp, Window w, GC gc, int nobj,
- t_object objs[], iv2 vec2[], rvec x[],
- unsigned long col[], int size[], bool bShowHydro, int bond_type,
- bool bPlus)
+static void draw_objects(Display *disp, Window w, GC gc, int nobj,
+ t_object objs[], iv2 vec2[], rvec x[],
+ unsigned long col[], int size[], bool bShowHydro, int bond_type,
+ bool bPlus)
{
bool bBalls;
int i;
#include "x11.h"
#include "xutil.h"
-bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
+static bool ChildCallBack(t_x11 *x11, XEvent *event, Window w, void *data)
{
t_child *child;
t_mentry *m;
return false;
}
-bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
+static bool MenuCallBack(t_x11 *x11, XEvent *event, Window /*w*/, void *data)
{
t_menu *m;
*/
#include "gmxpre.h"
+#include "view.h"
+
#include "config.h"
#include <cstdio>
* the item itself may not be freed until the dlg is done with
*
****************************/
-void DoCreateDlg(t_dlg *dlg)
+static void DoCreateDlg(t_dlg *dlg)
{
XSizeHints hints;
XSetWindowAttributes attr;
static unsigned long icon_fg = 0;
static unsigned long icon_bg = 0;
-void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg)
+static void SetIcon(unsigned char *bits, int w, int h, unsigned long fg, unsigned long bg)
{
icon_bits = (bmchar *)bits;
icon_width = w;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017, 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.
//! Helper function to parse a floating-point reference data value.
-double convertDoubleReferenceValue(const std::string &value)
+static inline double convertDoubleReferenceValue(const std::string &value)
{
try
{