*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
#define g_baseNR 14
const int grid_base[g_baseNR] = { 45, 48, 50, 52, 54, 56, 60, 64, 70, 72, 75, 80, 81, 84 };
-real calc_grid(FILE *fp, matrix box, real gr_sp,
+real calc_grid(FILE *fp, const matrix box, real gr_sp,
int *nx, int *ny, int *nz)
{
int d, n[DIM];
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
#include "gromacs/utility/real.h"
real calc_grid(FILE *fp,
- matrix box, real gr_sp,
+ const matrix box, real gr_sp,
int *nx, int *ny, int *nz);
/* Sets the number of grid points for each zero n* to the first reasonable
* number which gives a spacing equal to or smaller than gr_sp.
*
* 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,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.
#include "gromacs/utility/smalloc.h"
void write_sto_conf_indexed(const char *outfile, const char *title,
- t_atoms *atoms,
- rvec x[], rvec *v, int ePBC, matrix box,
+ const t_atoms *atoms,
+ const rvec x[], const rvec *v, int ePBC, const matrix box,
int nindex, int index[])
{
FILE *out;
fr.title = title;
fr.natoms = atoms->nr;
fr.bAtoms = TRUE;
- fr.atoms = atoms;
+ fr.atoms = const_cast<t_atoms *>(atoms);
fr.bX = TRUE;
- fr.x = x;
+ fr.x = const_cast<rvec *>(x);
if (v)
{
fr.bV = TRUE;
- fr.v = v;
+ fr.v = const_cast<rvec *>(v);
}
fr.bBox = TRUE;
copy_mat(box, fr.box);
}
}
-void write_sto_conf(const char *outfile, const char *title, t_atoms *atoms,
- rvec x[], rvec *v, int ePBC, matrix box)
+void write_sto_conf(const char *outfile, const char *title, const t_atoms *atoms,
+ const rvec x[], const rvec *v, int ePBC, const matrix box)
{
FILE *out;
int ftp;
fr.title = title;
fr.natoms = atoms->nr;
fr.bAtoms = TRUE;
- fr.atoms = atoms;
+ fr.atoms = const_cast<t_atoms *>(atoms); // TODO check
fr.bX = TRUE;
- fr.x = x;
+ fr.x = const_cast<rvec *>(x);
if (v)
{
fr.bV = TRUE;
- fr.v = v;
+ fr.v = const_cast<rvec *>(v);
}
fr.bBox = TRUE;
copy_mat(box, fr.box);
void write_sto_conf_mtop(const char *outfile, const char *title,
gmx_mtop_t *mtop,
- rvec x[], rvec *v, int ePBC, matrix box)
+ const rvec x[], const rvec *v, int ePBC, const matrix box)
{
int ftp;
FILE *out;
*
* 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,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.
struct t_topology;
void write_sto_conf_indexed(const char *outfile, const char *title,
- struct t_atoms *atoms,
- rvec x[], rvec *v, int ePBC, matrix box,
+ const t_atoms *atoms,
+ const rvec x[], const rvec *v, int ePBC, const matrix box,
int nindex, int index[]);
/* like write_sto_conf, but indexed */
void write_sto_conf(const char *outfile, const char *title,
- struct t_atoms *atoms,
- rvec x[], rvec *v, int ePBC, matrix box);
+ const t_atoms *atoms,
+ const rvec x[], const rvec *v, int ePBC, const matrix box);
/* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
* to an STO (.gro or .pdb) file */
void write_sto_conf_mtop(const char *outfile, const char *title,
struct gmx_mtop_t *mtop,
- rvec x[], rvec *v, int ePBC, matrix box);
+ const rvec x[], const rvec *v, int ePBC, const matrix box);
/* As write_sto_conf, but uses a gmx_mtop_t struct */
gmx_bool read_tps_conf(const char *infile, struct t_topology *top,
}
-void get_enx_state(const char *fn, real t, gmx_groups_t *groups, t_inputrec *ir,
+void get_enx_state(const char *fn, real t, const gmx_groups_t *groups, t_inputrec *ir,
t_state *state)
{
/* Should match the names in mdebin.c */
/* Reads enx_frames, memory in fr is (re)allocated if necessary */
void get_enx_state(const char *fn, real t,
- gmx_groups_t *groups, t_inputrec *ir,
+ const gmx_groups_t *groups, t_inputrec *ir,
t_state *state);
/*
* Reads state variables from enx file fn at time t.
}
void write_espresso_conf_indexed(FILE *out, const char *title,
- t_atoms *atoms, int nx, int *index,
- rvec *x, rvec *v, matrix box)
+ const t_atoms *atoms, int nx, int *index,
+ const rvec *x, const rvec *v, const matrix box)
{
int i, j;
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2005, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * 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.
int get_espresso_coordnum(const char *infile);
void write_espresso_conf_indexed(FILE *out, const char *title,
- t_atoms *atoms, int nx, int *index,
- rvec *x, rvec *v, matrix box);
+ const t_atoms *atoms, int nx, int *index,
+ const rvec *x, const rvec *v, const matrix box);
#endif
*
* 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,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.
return natoms;
}
-void write_g96_conf(FILE *out, t_trxframe *fr,
+void write_g96_conf(FILE *out, const t_trxframe *fr,
int nindex, const int *index)
{
t_atoms *atoms;
*
* 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,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.
* title, atoms, x, v can all be NULL, in which case they won't be read *
* line holds the previous line for trajectory reading */
-void write_g96_conf(FILE *out, struct t_trxframe *fr, int nindex, const int *index);
+void write_g96_conf(FILE *out, const t_trxframe *fr, int nindex, const int *index);
/* write a Gromos96 coordinate file or trajectory frame *
* index can be NULL */
*
* 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,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.
}
-static void write_hconf_box(FILE *out, int pr, matrix box)
+static void write_hconf_box(FILE *out, int pr, const matrix box)
{
char format[100];
int l;
}
}
-void write_hconf_indexed_p(FILE *out, const char *title, t_atoms *atoms,
+void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
int nx, const int index[], int pr,
- rvec *x, rvec *v, matrix box)
+ const rvec *x, const rvec *v, const matrix box)
{
char resnm[6], nm[6], format[100];
int ai, i, resind, resnr;
}
void write_hconf_mtop(FILE *out, const char *title, gmx_mtop_t *mtop, int pr,
- rvec *x, rvec *v, matrix box)
+ const rvec *x, const rvec *v, const matrix box)
{
char format[100];
int i, resnr;
fflush(out);
}
-void write_hconf_p(FILE *out, const char *title, t_atoms *atoms, int pr,
- rvec *x, rvec *v, matrix box)
+void write_hconf_p(FILE *out, const char *title, const t_atoms *atoms, int pr,
+ const rvec *x, const rvec *v, const matrix box)
{
int *aa;
int i;
}
void write_conf_p(const char *outfile, const char *title,
- t_atoms *atoms, int pr,
- rvec *x, rvec *v, matrix box)
+ const t_atoms *atoms, int pr,
+ const rvec *x, const rvec *v, const matrix box)
{
FILE *out;
*
* 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,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.
int gro_first_x_or_v(FILE *status, struct t_trxframe *fr);
/* read first/next x and/or v frame from gro file */
-void write_hconf_indexed_p(FILE *out, const char *title, struct t_atoms *atoms,
+void write_hconf_indexed_p(FILE *out, const char *title, const t_atoms *atoms,
int nx, const int index[], int ndec,
- rvec *x, rvec *v, matrix box);
+ const rvec *x, const rvec *v, const matrix box);
void write_hconf_mtop(FILE *out, const char *title, struct gmx_mtop_t *mtop, int pr,
- rvec *x, rvec *v, matrix box);
+ const rvec *x, const rvec *v, const matrix box);
-void write_hconf_p(FILE *out, const char *title, struct t_atoms *atoms, int ndec,
- rvec *x, rvec *v, matrix box);
+void write_hconf_p(FILE *out, const char *title, const t_atoms *atoms, int ndec,
+ const rvec *x, const rvec *v, const matrix box);
/* Write a Gromos file with precision ndec: number of decimal places in x,
* v has one place more. */
void write_conf_p(const char *outfile, const char *title,
- struct t_atoms *atoms, int pr,
- rvec *x, rvec *v, matrix box);
+ const t_atoms *atoms, int pr,
+ const rvec *x, const rvec *v, const matrix box);
#ifdef __cplusplus
}
}
-void gmx_write_pdb_box(FILE *out, int ePBC, matrix box)
+void gmx_write_pdb_box(FILE *out, int ePBC, const matrix box)
{
real alpha, beta, gamma;
}
void write_pdbfile_indexed(FILE *out, const char *title,
- t_atoms *atoms, rvec x[],
- int ePBC, matrix box, char chainid,
+ const t_atoms *atoms, const rvec x[],
+ int ePBC, const matrix box, char chainid,
int model_nr, int nindex, const int index[],
gmx_conect conect, gmx_bool bTerSepChains)
{
gmx_residuetype_destroy(rt);
}
-void write_pdbfile(FILE *out, const char *title, t_atoms *atoms, rvec x[],
- int ePBC, matrix box, char chainid, int model_nr, gmx_conect conect, gmx_bool bTerSepChains)
+void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms, const rvec x[],
+ int ePBC, const matrix box, char chainid, int model_nr, gmx_conect conect, gmx_bool bTerSepChains)
{
int i, *index;
}
}
-void get_pdb_atomnumber(t_atoms *atoms, gmx_atomprop_t aps)
+void get_pdb_atomnumber(const t_atoms *atoms, gmx_atomprop_t aps)
{
int i, atomnumber, len;
size_t k;
gmx_fio_fclose(in);
}
-gmx_conect gmx_conect_generate(t_topology *top)
+gmx_conect gmx_conect_generate(const t_topology *top)
{
int f, i;
gmx_conect gc;
/* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE).
This function is fundamentally broken as far as thread-safety is concerned.*/
-void gmx_write_pdb_box(FILE *out, int ePBC, matrix box);
+void gmx_write_pdb_box(FILE *out, int ePBC, const matrix box);
/* write the box in the CRYST1 record,
* with ePBC=-1 the pbc is guessed from the box
* This function is fundamentally broken as far as thread-safety is concerned.
*/
-void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
- rvec x[], int ePBC, matrix box, char chain,
+void write_pdbfile_indexed(FILE *out, const char *title, const t_atoms *atoms,
+ const rvec x[], int ePBC, const matrix box, char chain,
int model_nr, int nindex, const int index[],
gmx_conect conect, gmx_bool bTerSepChains);
/* REALLY low level */
-void write_pdbfile(FILE *out, const char *title, struct t_atoms *atoms,
- rvec x[], int ePBC, matrix box, char chain,
+void write_pdbfile(FILE *out, const char *title, const t_atoms *atoms,
+ const rvec x[], int ePBC, const matrix box, char chain,
int model_nr, gmx_conect conect, gmx_bool bTerSepChains);
/* Low level pdb file writing routine.
*
* which may be useful for visualization purposes.
*/
-void get_pdb_atomnumber(struct t_atoms *atoms, struct gmx_atomprop *aps);
+void get_pdb_atomnumber(const t_atoms *atoms, struct gmx_atomprop *aps);
/* Routine to extract atomic numbers from the atom names */
int read_pdbfile(FILE *in, char *title, int *model_nr,
void gmx_conect_add(gmx_conect conect, int ai, int aj);
/* Add a connection between ai and aj (numbered from 0 to natom-1) */
-gmx_conect gmx_conect_generate(struct t_topology *top);
+gmx_conect gmx_conect_generate(const t_topology *top);
/* Generate a conect structure from a topology */
gmx_conect gmx_conect_init(void);
}
void gmx_write_tng_from_trxframe(tng_trajectory_t output,
- t_trxframe *frame,
+ const t_trxframe *frame,
int natoms)
{
#if GMX_USE_TNG
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * 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.
* atoms.
*/
void gmx_write_tng_from_trxframe(tng_trajectory_t output,
- struct t_trxframe *frame,
+ const t_trxframe *frame,
int natoms);
/*! \brief Creates a molecule containing only the indexed atoms and sets
}
void write_tpx_state(const char *fn,
- t_inputrec *ir, t_state *state, gmx_mtop_t *mtop)
+ const t_inputrec *ir, const t_state *state, const gmx_mtop_t *mtop)
{
t_fileio *fio;
fio = open_tpx(fn, "w");
- do_tpx(fio, FALSE, ir, state, mtop, FALSE);
+ do_tpx(fio, FALSE,
+ const_cast<t_inputrec *>(ir),
+ const_cast<t_state *>(state),
+ const_cast<gmx_mtop_t *>(mtop), FALSE);
close_tpx(fio);
}
*
* 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,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.
*/
void write_tpx_state(const char *fn,
- t_inputrec *ir, t_state *state, gmx_mtop_t *mtop);
+ const t_inputrec *ir, const t_state *state, const gmx_mtop_t *mtop);
/* Write a file, and close it again.
*/
*
* 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,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.
}
void gmx_trr_write_single_frame(const char *fn, int step, real t, real lambda,
- rvec *box, int natoms, rvec *x, rvec *v, rvec *f)
+ const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f)
{
t_fileio *fio = gmx_trr_open(fn, "w");
- do_trr_frame(fio, false, &step, &t, &lambda, box, &natoms, x, v, f);
+ do_trr_frame(fio, false, &step, &t, &lambda, const_cast<rvec *>(box), &natoms, const_cast<rvec *>(x), const_cast<rvec *>(v), const_cast<rvec *>(f));
gmx_trr_close(fio);
}
}
void gmx_trr_write_frame(t_fileio *fio, int step, real t, real lambda,
- rvec *box, int natoms, rvec *x, rvec *v, rvec *f)
+ const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f)
{
- if (!do_trr_frame(fio, false, &step, &t, &lambda, box, &natoms, x, v, f))
+ if (!do_trr_frame(fio, false, &step, &t, &lambda, const_cast<rvec *>(box), &natoms, const_cast<rvec *>(x), const_cast<rvec *>(v), const_cast<rvec *>(f)))
{
gmx_file("Cannot write trajectory frame; maybe you are out of disk space?");
}
*
* 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,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.
*/
void gmx_trr_write_frame(struct t_fileio *fio, int step, real t, real lambda,
- rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
+ const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f);
/* Write a trr frame to file fp, box, x, v, f may be NULL */
void gmx_trr_read_single_header(const char *fn, gmx_trr_header_t *header);
*/
void gmx_trr_write_single_frame(const char *fn, int step, real t, real lambda,
- rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
+ const rvec *box, int natoms, const rvec *x, const rvec *v, const rvec *f);
/* Write a single trr frame to file fn, which is closed afterwards */
#ifdef __cplusplus
fr->ePBC = ePBC;
}
-int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
+int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
const int *ind, gmx_conect gc)
{
char title[STRLEN];
return 0;
}
-int write_trx(t_trxstatus *status, int nind, const int *ind, t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atoms,
int step, real time, matrix box, rvec x[], rvec *v,
gmx_conect gc)
{
fr.bTime = TRUE;
fr.time = time;
fr.bAtoms = atoms != NULL;
- fr.atoms = atoms;
+ fr.atoms = const_cast<t_atoms *>(atoms);
fr.bX = TRUE;
fr.x = x;
fr.bV = v != NULL;
int nframes_read(t_trxstatus *status);
/* Returns the number of frames read from the trajectory */
-int write_trxframe_indexed(t_trxstatus *status, struct t_trxframe *fr, int nind,
+int write_trxframe_indexed(t_trxstatus *status, const t_trxframe *fr, int nind,
const int *ind, gmx_conect gc);
/* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */
* gc is important for pdb file writing only and may be NULL.
*/
-int write_trx(t_trxstatus *status, int nind, const int *ind, struct t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, const t_atoms *atoms,
int step, real time, matrix box, rvec x[], rvec *v,
gmx_conect gc);
/* Write an indexed frame to a TRX file.
*
* 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,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.
return result;
}
-static int xtc_coord(XDR *xd, int *natoms, matrix box, rvec *x, real *prec, gmx_bool bRead)
+static int xtc_coord(XDR *xd, int *natoms, rvec *box, rvec *x, real *prec, gmx_bool bRead)
{
int i, j, result;
#if GMX_DOUBLE
int write_xtc(t_fileio *fio,
int natoms, int step, real time,
- matrix box, rvec *x, real prec)
+ const rvec *box, const rvec *x, real prec)
{
int magic_number = XTC_MAGIC;
XDR *xd;
}
/* write data */
- bOK = xtc_coord(xd, &natoms, box, x, &prec, FALSE); /* bOK will be 1 if writing went well */
+ bOK = xtc_coord(xd, &natoms, const_cast<rvec *>(box), const_cast<rvec *>(x), &prec, FALSE); /* bOK will be 1 if writing went well */
if (bOK)
{
*
* 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,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.
int write_xtc(struct t_fileio *fio,
int natoms, int step, real time,
- matrix box, rvec *x, real prec);
+ const rvec *box, const rvec *x, real prec);
/* Write a frame to xtc file */
#ifdef __cplusplus
#include "gromacs/utility/smalloc.h"
t_dlist *mk_dlist(FILE *log,
- t_atoms *atoms, int *nlist,
+ const t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
int maxchi, int r0, gmx_residuetype_t *rt)
{
*
* 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,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.
}
-void write_eigenvectors(const char *trrname, int natoms, real mat[],
+void write_eigenvectors(const char *trrname, int natoms, const real mat[],
gmx_bool bReverse, int begin, int end,
- int WriteXref, rvec *xref, gmx_bool bDMR,
- rvec xav[], gmx_bool bDMA, real eigval[])
+ int WriteXref, const rvec *xref, gmx_bool bDMR,
+ const rvec xav[], gmx_bool bDMA, const real eigval[])
{
struct t_fileio *trrout;
int ndim, i, j, d, vec;
*
* 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,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.
/* xav is the average/minimum structure is written (t=0). */
/* bDMA indicates mass weighted analysis/eigenvectors. */
-extern void write_eigenvectors(const char *trrname, int natoms, real mat[],
+extern void write_eigenvectors(const char *trrname, int natoms, const real mat[],
gmx_bool bReverse, int begin, int end,
- int WriteXref, rvec *xref, gmx_bool bDMR,
- rvec xav[], gmx_bool bDMA, real *eigval);
+ int WriteXref, const rvec *xref, gmx_bool bDMR,
+ const rvec xav[], gmx_bool bDMA, const real *eigval);
/* Write eigenvectors in mat to a TRR file. */
/* The reference structure is written (t=-1) when WriteXref=eWXR_YES. */
/* When WriteXref==eWXR_NOFIT a zero frame is written (t=-1), */
*
* 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,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.
xvgrclose(out);
}
-static void project(const char *trajfile, t_topology *top, int ePBC, matrix topbox,
+static void project(const char *trajfile, const t_topology *top, int ePBC, matrix topbox,
const char *projfile, const char *twodplotfile,
const char *threedplotfile, const char *filterfile, int skip,
const char *extremefile, gmx_bool bExtrAll, real extreme,
- int nextr, t_atoms *atoms, int natoms, int *index,
+ int nextr, const t_atoms *atoms, int natoms, int *index,
gmx_bool bFit, rvec *xref, int nfit, int *ifit, real *w_rls,
real *sqrtm, rvec *xav,
int *eignr, rvec **eigvec,
t_topology top;
int ePBC = -1;
- t_atoms *atoms = NULL;
+ const t_atoms *atoms = NULL;
rvec *xtop, *xref1, *xref2, *xrefp = NULL;
gmx_bool bDMR1, bDMA1, bDMR2, bDMA2;
int nvec1, nvec2, *eignr1 = NULL, *eignr2 = NULL;
int index[],
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bOmega, gmx_bool bChi,
gmx_bool bNormalize, gmx_bool bSSHisto, const char *ssdump,
- real bfac_max, t_atoms *atoms,
+ real bfac_max, const t_atoms *atoms,
gmx_bool bDo_jc, const char *fn,
const gmx_output_env_t *oenv)
{
static void order_params(FILE *log,
const char *fn, int maxchi, int nlist, t_dlist dlist[],
const char *pdbfn, real bfac_init,
- t_atoms *atoms, rvec x[], int ePBC, matrix box,
+ t_atoms *atoms, const rvec x[], int ePBC, matrix box,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, const gmx_output_env_t *oenv)
{
FILE *fp;
*
* 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,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.
static const int NOTSET = -9368163;
-void calc_rm_cm(int isize, int index[], t_atoms *atoms, rvec x[], rvec xcm)
+void calc_rm_cm(int isize, int index[], const t_atoms *atoms, rvec x[], rvec xcm)
{
int i, d;
real tm, m;
return r;
}
-int find_res_end(int i, int isize, int index[], t_atoms *atoms)
+int find_res_end(int i, int isize, int index[], const t_atoms *atoms)
{
int rnr;
}
}
-void find_matching_names(int *isize1, int index1[], t_atoms *atoms1,
- int *isize2, int index2[], t_atoms *atoms2)
+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;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,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.
methSEL, methBISECT, methFUNCFIT, methNR
};
-static void center_coords(t_atoms *atoms, matrix box, rvec x0[], int axis)
+static void center_coords(const t_atoms *atoms, matrix box, rvec x0[], int axis)
{
int i, m;
real tmass, mm;
}
-static void density_in_time (const char *fn, int **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv)
+static void density_in_time (const char *fn, int **index, int gnx[], real bw, real bwz, int nsttblock, real *****Densdevel, int *xslices, int *yslices, int *zslices, int *tblock, const t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv)
{
/*
-void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
- int mindex[], rvec x[], rvec mu[],
- int ePBC, matrix box, t_atom *atom, int *nAtom)
+static void do_gkr(t_gkrbin *gb, int ncos, int *ngrp, int *molindex[],
+ int mindex[], rvec x[], rvec mu[],
+ int ePBC, const matrix box, const t_atom *atom, const int *nAtom)
{
static rvec *xcm[2] = { NULL, NULL};
int gi, gj, j0, j1, i, j, k, n, grp0, grp1;
return bCont;
}
-static void neutralize_mols(int n, int *index, t_block *mols, t_atom *atom)
+static void neutralize_mols(int n, int *index, const t_block *mols, t_atom *atom)
{
double mtot, qtot;
int ncharged, m, a0, a1, a;
}
}
-static void mol_dip(int k0, int k1, rvec x[], t_atom atom[], rvec mu)
+static void mol_dip(int k0, int k1, rvec x[], const t_atom atom[], rvec mu)
{
int k, m;
real q;
}
}
-static void mol_quad(int k0, int k1, rvec x[], t_atom atom[], rvec quad)
+static void mol_quad(int k0, int k1, rvec x[], const t_atom atom[], rvec quad)
{
int i, k, m, n, niter;
real q, r2, mass, masstot;
axis[ZZ] = ddc3/n;
}
-static void do_dip(t_topology *top, int ePBC, real volume,
+static void do_dip(const t_topology *top, int ePBC, real volume,
const char *fn,
const char *out_mtot, const char *out_eps,
const char *out_aver, const char *dipdist,
};
#define NLEGADIP asize(leg_adip)
- FILE *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
- FILE *dip3d = NULL, *adip = NULL;
- rvec *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
- t_gkrbin *gkrbin = NULL;
- gmx_enxnm_t *enm = NULL;
- t_enxframe *fr;
- int nframes = 1000, nre, timecheck = 0, ncolour = 0;
- ener_file_t fmu = NULL;
- int i, n, m, natom = 0, gnx_tot, teller, tel3;
- t_trxstatus *status;
- int *dipole_bin, ndipbin, ibin, iVol, idim = -1;
- unsigned long mode;
- real rcut = 0, t, t0, t1, dt, dd, rms_cos;
- rvec dipaxis;
- matrix box;
- gmx_bool bCorr, bTotal, bCont;
- double M_diff = 0, epsilon, invtel, vol_aver;
- double mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
- double M[3], M2[3], M4[3], Gk = 0, g_k = 0;
- gmx_stats_t *Qlsq, mulsq, muframelsq = NULL;
- ivec iMu;
- real **muall = NULL;
- rvec *slab_dipoles = NULL;
- t_atom *atom = NULL;
- t_block *mols = NULL;
- gmx_rmpbc_t gpbc = NULL;
+ FILE *outdd, *outmtot, *outaver, *outeps, *caver = NULL;
+ FILE *dip3d = NULL, *adip = NULL;
+ rvec *x, *dipole = NULL, mu_t, quad, *dipsp = NULL;
+ t_gkrbin *gkrbin = NULL;
+ gmx_enxnm_t *enm = NULL;
+ t_enxframe *fr;
+ int nframes = 1000, nre, timecheck = 0, ncolour = 0;
+ ener_file_t fmu = NULL;
+ int i, n, m, natom = 0, gnx_tot, teller, tel3;
+ t_trxstatus *status;
+ int *dipole_bin, ndipbin, ibin, iVol, idim = -1;
+ unsigned long mode;
+ real rcut = 0, t, t0, t1, dt, dd, rms_cos;
+ rvec dipaxis;
+ matrix box;
+ gmx_bool bCorr, bTotal, bCont;
+ double M_diff = 0, epsilon, invtel, vol_aver;
+ double mu_ave, mu_mol, M2_ave = 0, M_ave2 = 0, M_av[DIM], M_av2[DIM];
+ double M[3], M2[3], M4[3], Gk = 0, g_k = 0;
+ gmx_stats_t *Qlsq, mulsq, muframelsq = NULL;
+ ivec iMu;
+ real **muall = NULL;
+ rvec *slab_dipoles = NULL;
+ const t_atom *atom = NULL;
+ const t_block *mols = NULL;
+ gmx_rmpbc_t gpbc = NULL;
gnx_tot = gnx[0];
if (ncos > 1)
}
}
-void dipole_atom2molindex(int *n, int *index, t_block *mols)
+void dipole_atom2molindex(int *n, int *index, const t_block *mols)
{
int nmol, i, j, m;
}
static void dump_disre_matrix(const char *fn, t_dr_result *dr, int ndr,
- int nsteps, t_idef *idef, gmx_mtop_t *mtop,
+ int nsteps, t_idef *idef, const gmx_mtop_t *mtop,
real max_dr, int nlevels, gmx_bool bThird)
{
FILE *fp;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,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.
VACF, MVACF, DOS, DOS_SOLID, DOS_DIFF, DOS_CP, DOS_S, DOS_A, DOS_E, DOS_NR
};
-static int calcMoleculesInIndexGroup(t_block *mols, int natoms, int *index, int nindex)
+static int calcMoleculesInIndexGroup(const t_block *mols, int natoms, const int *index, int nindex)
{
int i = 0;
int mol = 0;
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle,
+static void rot_conf(t_atoms *atoms, const rvec x[], const rvec v[], real trans, real angle,
rvec head, rvec tail, int isize, int index[],
rvec xout[], rvec vout[])
{
}
-static void do_dhdl(t_enxframe *fr, t_inputrec *ir, FILE **fp_dhdl,
+static void do_dhdl(t_enxframe *fr, const t_inputrec *ir, FILE **fp_dhdl,
const char *filename, gmx_bool bDp,
int *blocks, int *hists, int *samples, int *nlambdas,
const gmx_output_env_t *oenv)
*
* 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,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.
void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
real **slOrder, real *slWidth, int *nslices,
- t_topology *top, int ePBC,
+ const t_topology *top, int ePBC,
int axis, gmx_bool bMicel, int micel[], int nmic,
const gmx_output_env_t *oenv)
{
}
}
-static char *mkatomname(t_atoms *atoms, int i)
+static char *mkatomname(const t_atoms *atoms, int i)
{
static char buf[32];
int rnr;
a->acc[a->nra++] = ia;
}
-static void search_acceptors(t_topology *top, int isize,
- int *index, t_acceptors *a, int grp,
+static void search_acceptors(const t_topology *top, int isize,
+ const int *index, t_acceptors *a, int grp,
gmx_bool bNitAcc,
gmx_bool bContact, gmx_bool bDoIt, unsigned char *datable)
{
}
}
-static void search_donors(t_topology *top, int isize, int *index,
+static void search_donors(const t_topology *top, int isize, const int *index,
t_donors *ddd, int grp, gmx_bool bContact, gmx_bool bDoIt,
unsigned char *datable)
{
int i, j;
t_functype func_type;
- t_ilist *interaction;
int nr1, nr2, nr3;
if (!ddd->dptr)
{
for (func_type = 0; (func_type < F_NRE); func_type++)
{
- interaction = &(top->idef.il[func_type]);
+ const t_ilist *interaction = &(top->idef.il[func_type]);
if (func_type == F_POSRES || func_type == F_FBPOSRES)
{
/* The ilist looks strange for posre. Bug in grompp?
static void dump_hbmap(t_hbdata *hb,
int nfile, t_filenm fnm[], gmx_bool bTwo,
gmx_bool bContact, int isize[], int *index[], char *grpnames[],
- t_atoms *atoms)
+ const t_atoms *atoms)
{
FILE *fp, *fplog;
int ddd, hhh, aaa, i, j, k, m, grp;
}
void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
- int igro[], rvec *x, const char* structure)
+ int igro[], const rvec *x, const char* structure)
{
/* filter2edx copies coordinates from x to edx which are given in index
*/
}
}
-void get_structure(t_atoms *atoms, const char *IndexFile,
+void get_structure(const t_atoms *atoms, const char *IndexFile,
const char *StructureFile, struct edix *edx, int nfit,
int ifit[], int nav, int index[])
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
return (*nr) != NOTSET;
}
-static int select_atomnumbers(char **string, t_atoms *atoms, int n1,
+static int select_atomnumbers(char **string, const t_atoms *atoms, int n1,
int *nr, int *index, char *gname)
{
char buf[STRLEN];
return *nr;
}
-static int select_residuenumbers(char **string, t_atoms *atoms,
+static int select_residuenumbers(char **string, const t_atoms *atoms,
int n1, char c,
int *nr, int *index, char *gname)
{
return *nr;
}
-static int select_residueindices(char **string, t_atoms *atoms,
+static int select_residueindices(char **string, const t_atoms *atoms,
int n1, char c,
int *nr, int *index, char *gname)
{
}
-static gmx_bool atoms_from_residuenumbers(t_atoms *atoms, int group, t_blocka *block,
+static gmx_bool atoms_from_residuenumbers(const t_atoms *atoms, int group, t_blocka *block,
int *nr, int *index, char *gname)
{
int i, j, j0, j1, resnr, nres;
return matches;
}
-static int select_chainnames(t_atoms *atoms, int n_names, char **names,
+static int select_chainnames(const t_atoms *atoms, int n_names, char **names,
int *nr, int *index)
{
char name[2];
return *nr;
}
-static int select_atomnames(t_atoms *atoms, int n_names, char **names,
+static int select_atomnames(const t_atoms *atoms, int n_names, char **names,
int *nr, int *index, gmx_bool bType)
{
char *name;
return *nr;
}
-static int select_residuenames(t_atoms *atoms, int n_names, char **names,
+static int select_residuenames(const t_atoms *atoms, int n_names, char **names,
int *nr, int *index)
{
char *name;
}
}
-static void split_group(t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
+static void split_group(const t_atoms *atoms, int sel_nr, t_blocka *block, char ***gn,
gmx_bool bAtom)
{
char buf[STRLEN], *name;
block->index[block->nr] = block->nra;
}
-static int split_chain(t_atoms *atoms, rvec *x,
+static int split_chain(const t_atoms *atoms, const rvec *x,
int sel_nr, t_blocka *block, char ***gn)
{
char buf[STRLEN];
return nchain;
}
-static gmx_bool check_have_atoms(t_atoms *atoms, char *string)
+static gmx_bool check_have_atoms(const t_atoms *atoms, char *string)
{
if (atoms == NULL)
{
}
}
-static gmx_bool parse_entry(char **string, int natoms, t_atoms *atoms,
+static gmx_bool parse_entry(char **string, int natoms, const t_atoms *atoms,
t_blocka *block, char ***gn,
int *nr, int *index, char *gname)
{
return bRet;
}
-static void list_residues(t_atoms *atoms)
+static void list_residues(const t_atoms *atoms)
{
int i, j, start, end, prev_resind, resind;
gmx_bool bDiff;
printf("\n");
}
-static void edit_index(int natoms, t_atoms *atoms, rvec *x, t_blocka *block, char ***gn, gmx_bool bVerbose)
+static void edit_index(int natoms, const t_atoms *atoms, const rvec *x, t_blocka *block, char ***gn, gmx_bool bVerbose)
{
static char **atnames, *ostring;
static gmx_bool bFirst = TRUE;
*
* 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,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.
}
static void periodic_mindist_plot(const char *trxfn, const char *outfn,
- t_topology *top, int ePBC,
+ const t_topology *top, int ePBC,
int n, int index[], gmx_bool bSplit,
const gmx_output_env_t *oenv)
{
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, t_atoms *atoms,
+ 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,
sfree(x0);
}
-int find_residues(t_atoms *atoms, int n, int index[], int **resindex)
+int find_residues(const t_atoms *atoms, int n, int index[], int **resindex)
{
int i;
int nres = 0, resnr, presnr = 0;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
-static int calc_ntype(int nft, int *ft, t_idef *idef)
+static int calc_ntype(int nft, int *ft, const t_idef *idef)
{
int i, f, nf = 0;
return nf;
}
-static void fill_ft_ind(int nft, int *ft, t_idef *idef,
+static void fill_ft_ind(int nft, int *ft, const t_idef *idef,
int ft_ind[], char *grpnames[])
{
char buf[125];
}
static void fill_ang(int nft, int *ft, int fac,
- int nr[], int *index[], int ft_ind[], t_topology *top,
+ int nr[], int *index[], int ft_ind[], const t_topology *top,
gmx_bool bNoH, real hq)
{
- int f, ftype, i, j, indg, nr_fac;
- gmx_bool bUse;
- t_idef *idef;
- t_atom *atom;
- t_iatom *ia;
+ int f, ftype, i, j, indg, nr_fac;
+ gmx_bool bUse;
+ const t_idef *idef;
+ t_atom *atom;
+ t_iatom *ia;
idef = &top->idef;
*
* 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,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.
}
t_corr *init_corr(int nrgrp, int type, int axis, real dim_factor,
- int nmol, gmx_bool bTen, gmx_bool bMass, real dt, t_topology *top,
+ int nmol, gmx_bool bTen, gmx_bool bMass, real dt, const t_topology *top,
real beginfit, real endfit)
{
t_corr *curr;
- t_atoms *atoms;
int i;
snew(curr, 1);
{
if (bMass)
{
- atoms = &top->atoms;
+ const t_atoms *atoms = &top->atoms;
snew(curr->mass, atoms->nr);
for (i = 0; (i < atoms->nr); i++)
{
}
/* calculate the com of molecules in x and put it into xa */
-static void calc_mol_com(int nmol, int *molindex, t_block *mols, t_atoms *atoms,
+static void calc_mol_com(int nmol, int *molindex, const t_block *mols, const t_atoms *atoms,
rvec *x, rvec *xa)
{
int m, mol, i, d;
atoms = atom data (for mass)
com(output) = center of mass */
static void calc_com(gmx_bool bMol, int gnx, int index[],
- rvec xcur[], rvec xprev[], matrix box, t_atoms *atoms,
+ rvec xcur[], rvec xprev[], matrix box, const t_atoms *atoms,
rvec com)
{
int i, m, ind;
return gtot/nx;
}
-void printmol(t_corr *curr, const char *fn,
- const char *fn_pdb, int *molindex, t_topology *top,
- rvec *x, int ePBC, matrix box, const gmx_output_env_t *oenv)
+static void printmol(t_corr *curr, const char *fn,
+ const char *fn_pdb, int *molindex, const t_topology *top,
+ rvec *x, int ePBC, matrix box, const gmx_output_env_t *oenv)
{
#define NDIST 100
FILE *out;
int i, j;
real a, b, D, Dav, D2av, VarD, sqrtD, sqrtD_max, scale;
t_pdbinfo *pdbinfo = NULL;
- int *mol2a = NULL;
+ const int *mol2a = NULL;
out = xvgropen(fn, "Diffusion Coefficients / Molecule", "Molecule", "D", oenv);
if (fn_pdb)
{
- if (top->atoms.pdbinfo == NULL)
- {
- snew(top->atoms.pdbinfo, top->atoms.nr);
- }
pdbinfo = top->atoms.pdbinfo;
mol2a = top->mols.index;
}
* 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, t_topology *top, int ePBC,
+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,
return natoms;
}
-static void index_atom2mol(int *n, int *index, t_block *mols)
+static void index_atom2mol(int *n, int *index, const t_block *mols)
{
int nat, i, nmol, mol, j;
}
i = top->atoms.nr;
top->atoms.nr = nat_trx;
+ if (pdb_file && top->atoms.pdbinfo == NULL)
+ {
+ snew(top->atoms.pdbinfo, top->atoms.nr);
+ }
printmol(msd, mol_file, pdb_file, index[0], top, x, ePBC, box, oenv);
top->atoms.nr = i;
}
}
}
-static size_t get_nharm_mt(gmx_moltype_t *mt)
+static size_t get_nharm_mt(const gmx_moltype_t *mt)
{
static int harm_func[] = { F_BONDS };
int i, ft;
return nh;
}
-static int get_nharm(gmx_mtop_t *mtop)
+static int get_nharm(const gmx_mtop_t *mtop)
{
int nh = 0;
nma_full_hessian(real *hess,
int ndim,
gmx_bool bM,
- t_topology *top,
+ const t_topology *top,
const std::vector<size_t> &atom_index,
int begin,
int end,
static void
nma_sparse_hessian(gmx_sparsematrix_t *sparse_hessian,
gmx_bool bM,
- t_topology *top,
+ const t_topology *top,
const std::vector<size_t> &atom_index,
int neig,
real *eigenvalues,
*
* 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,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.
/* Print name of first atom in all groups in index file */
static void print_types(int index[], int a[], int ngrps,
- char *groups[], t_topology *top)
+ char *groups[], const t_topology *top)
{
int i;
void calc_order(const char *fn, int *index, int *a, rvec **order,
real ***slOrder, real *slWidth, int nslices, gmx_bool bSliced,
- gmx_bool bUnsat, t_topology *top, int ePBC, int ngrps, int axis,
+ 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)
xvgrclose(slOrd);
}
-void write_bfactors(t_filenm *fnm, int nfile, int *index, int *a, int nslices, int ngrps, real **order, t_topology *top, real **distvals, gmx_output_env_t *oenv)
+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*/
/* calculate charge density */
-static void calc_q2all(
- gmx_mtop_t *mtop, /* molecular topology */
- real *q2all, real *q2allnr)
+static void calc_q2all(const gmx_mtop_t *mtop, /* molecular topology */
+ real *q2all, real *q2allnr)
{
int imol, iatom; /* indices for loops */
real q2_all = 0; /* Sum of squared charges */
/* Allocate and fill an array with coordinates and charges,
* returns the number of charges found
*/
-static int prepare_x_q(real *q[], rvec *x[], gmx_mtop_t *mtop, rvec x_orig[], t_commrec *cr)
+static int prepare_x_q(real *q[], rvec *x[], const gmx_mtop_t *mtop, const rvec x_orig[], t_commrec *cr)
{
int i;
int nq; /* number of charged particles */
* a) a homogeneous distribution of the charges
* b) a total charge of zero.
*/
-static void estimate_PME_error(t_inputinfo *info, t_state *state,
- gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, int seed,
+static void estimate_PME_error(t_inputinfo *info, const t_state *state,
+ const gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, unsigned int seed,
t_commrec *cr)
{
rvec *x = NULL; /* The coordinates */
*
* 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,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.
void calc_potential(const char *fn, int **index, int gnx[],
double ***slPotential, double ***slCharge,
double ***slField, int *nslices,
- t_topology *top, int ePBC,
+ 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)
*
* 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,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.
void
-calc_principal_axes(t_topology * top,
- rvec * x,
- int * index,
- int n,
- matrix axes,
- rvec inertia)
+calc_principal_axes(const t_topology *top,
+ rvec *x,
+ int *index,
+ int n,
+ matrix axes,
+ rvec inertia)
{
rvec xcm;
#include "gromacs/utility/pleasecite.h"
#include "gromacs/utility/smalloc.h"
-static void norm_princ(t_atoms *atoms, int isize, int *index, int natoms,
+static void norm_princ(const t_atoms *atoms, int isize, int *index, int natoms,
rvec *x)
{
int i, m;
*
* 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,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.
#include "gromacs/utility/strdb.h"
-static void calc_dist(int nind, int index[], rvec x[], int ePBC, matrix box,
+static void calc_dist(int nind, int index[], const rvec x[], int ePBC, matrix box,
real **d)
{
int i, j;
- real *xi;
rvec dx;
real temp2;
t_pbc pbc;
set_pbc(&pbc, ePBC, box);
for (i = 0; (i < nind-1); i++)
{
- xi = x[index[i]];
+ const real *xi = x[index[i]];
for (j = i+1; (j < nind); j++)
{
pbc_dx(&pbc, xi, x[index[j]], dx);
}
static int analyze_noe_equivalent(const char *eq_fn,
- t_atoms *atoms, int isize, int *index,
+ const t_atoms *atoms, int isize, int *index,
gmx_bool bSumH,
int *noe_index, t_noe_gr *noe_gr)
{
*
* 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,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.
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static real find_pdb_bfac(t_atoms *atoms, t_resinfo *ri, char *atomnm)
+static real find_pdb_bfac(const t_atoms *atoms, t_resinfo *ri, char *atomnm)
{
char rresnm[8];
int i;
static void average_residues(double f[], double **U, int uind,
int isize, int index[], real w_rls[],
- t_atoms *atoms)
+ const t_atoms *atoms)
{
int i, j, start;
double av, m;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,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.
static void get_refx(gmx_output_env_t *oenv, const char *trxfn, int nfitdim, int skip,
int gnx, int *index,
- gmx_bool bMW, t_topology *top, int ePBC, rvec *x_ref)
+ gmx_bool bMW, const t_topology *top, int ePBC, rvec *x_ref)
{
int natoms, nfr_all, nfr, i, j, a, r, c, min_fr;
t_trxstatus *status;
*
* 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,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.
real q;
} t_charge;
-static t_charge *mk_charge(t_atoms *atoms, t_block *cgs, int *nncg)
+static t_charge *mk_charge(const t_atoms *atoms, const t_block *cgs, int *nncg)
{
t_charge *cg = NULL;
char buf[32];
return cg;
}
-static real calc_dist(t_pbc *pbc, rvec x[], t_block *cgs, int icg, int jcg)
+static real calc_dist(t_pbc *pbc, rvec x[], const t_block *cgs, int icg, int jcg)
{
int i, j;
rvec dx;
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
+static void calc_com_pbc(int nrefat, const t_topology *top, rvec x[], t_pbc *pbc,
int index[], rvec xref, int ePBC)
{
const real tol = 1e-4;
}
}
-void spol_atom2molindex(int *n, int *index, t_block *mols)
+void spol_atom2molindex(int *n, int *index, const t_block *mols)
{
int nmol, i, j, m;
*
* 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,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.
}
}
-static void write_trx_x(t_trxstatus *status, t_trxframe *fr, real *mass, gmx_bool bCom,
+static void write_trx_x(t_trxstatus *status, const t_trxframe *fr, real *mass, gmx_bool bCom,
int ngrps, int isize[], int **index)
{
static rvec *xav = NULL;
t_trxframe fr_av;
int i;
- fr->bV = FALSE;
- fr->bF = FALSE;
if (bCom)
{
if (xav == NULL)
int ePBC;
real *mass, time;
const char *indexfn;
- t_trxframe fr, frout;
+ t_trxframe fr;
int flags, nvhisto = 0, *vhisto = NULL;
rvec *xtop, *xp = NULL;
rvec *sumx = NULL, *sumv = NULL, *sumf = NULL;
}
if (bOXT && fr.bX)
{
- frout = fr;
+ t_trxframe frout = fr;
if (!frout.bAtoms)
{
frout.atoms = &top.atoms;
frout.bAtoms = TRUE;
}
+ frout.bV = FALSE;
+ frout.bF = FALSE;
write_trx_x(status_out, &frout, mass, bCom, ngroups, isize, index);
}
if (bOV && fr.bV)
*
* 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,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.
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static void index_atom2mol(int *n, int *index, t_block *mols)
+static void index_atom2mol(int *n, int *index, const t_block *mols)
{
int nat, i, nmol, mol, j;
*n = nmol;
}
-static void precalc(t_topology top, real normm[])
+static void precalc(const t_topology &top, real normm[])
{
real mtot;
*
* 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,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.
gmx_bool has_dihedral(int Dih, t_dlist *dl);
t_dlist *mk_dlist(FILE *log,
- t_atoms *atoms, int *nlist,
+ const t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
int maxchi, int r0, struct gmx_residuetype_t *rt);
return (phitot/(gnx-4.0));
}
-real dip(int nbb, int bbind[], rvec x[], t_atom atom[])
+real dip(int nbb, int const bbind[], const rvec x[], const t_atom atom[])
{
int i, m, ai;
rvec dipje;
return rms;
}
-void calc_hxprops(int nres, t_bb bb[], rvec x[])
+void calc_hxprops(int nres, t_bb bb[], const rvec x[])
{
int i, ao, an, t1, t2, t3;
rvec dx, r_ij, r_kj, r_kl, m, n;
*
* 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,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.
extern real ca_phi(int gnx, int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
-extern real dip(int nbb, int bbind[], rvec x[], t_atom atom[]);
+extern real dip(int nbb, const int bbind[], const rvec x[], const t_atom atom[]);
extern real rise(int gnx, int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
int bbindex[], int *nca, int caindex[],
gmx_bool bRange, int rStart, int rEnd);
-extern void calc_hxprops(int nres, t_bb bb[], rvec x[]);
+extern void calc_hxprops(int nres, t_bb bb[], const rvec x[]);
extern void pr_bb(FILE *fp, int nres, t_bb bb[]);
*
* 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,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.
return -1;
}
-static void add_xr(t_xrama *xr, int ff[5], t_atoms *atoms)
+static void add_xr(t_xrama *xr, int ff[5], const t_atoms *atoms)
{
char buf[12];
int i;
xr->npp++;
}
-static void get_dih(t_xrama *xr, t_atoms *atoms)
+static void get_dih(t_xrama *xr, const t_atoms *atoms)
{
int found, ff[NPP];
int i;
}
}
-static void get_dih_props(t_xrama *xr, t_idef *idef, int mult)
+static void get_dih_props(t_xrama *xr, const t_idef *idef, int mult)
{
int i, ft, ftype, nra;
t_iatom *ia;
return (gmx_neutron_atomic_structurefactors_t *) gnsf;
}
-gmx_sans_t *gmx_sans_init (t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
+gmx_sans_t *gmx_sans_init (const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf)
{
gmx_sans_t *gsans = NULL;
int i, j;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
} gmx_neutron_atomic_structurefactors_t;
typedef struct gmx_sans_t {
- struct t_topology *top; /* topology */
- double *slength; /* scattering length for this topology */
+ const t_topology *top; /* topology */
+ double *slength; /* scattering length for this topology */
} gmx_sans_t;
typedef struct gmx_radial_distribution_histogram_t {
gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const char *datfn);
-gmx_sans_t *gmx_sans_init(struct t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
+gmx_sans_t *gmx_sans_init(const t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans,
rvec *x,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
}
#endif
-void principal_comp(int n, int index[], t_atom atom[], rvec x[],
+void principal_comp(int n, const int index[], t_atom atom[], rvec x[],
matrix trans, rvec d)
{
int i, j, ai, m, nrot;
}
}
-real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
+real calc_xcm(const rvec x[], int gnx, const int *index, const t_atom *atom, rvec xcm,
gmx_bool bQ)
{
int i, ii, m;
return tm;
}
-real sub_xcm(rvec x[], int gnx, int *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm,
gmx_bool bQ)
{
int i, ii;
}
}
-void orient_princ(t_atoms *atoms, int isize, int *index,
+void orient_princ(const t_atoms *atoms, int isize, const int *index,
int natoms, rvec x[], rvec *v, rvec d)
{
int i, m;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
void rotate_atoms(int gnx, int index[], rvec x[], matrix trans);
/* Rotate all atoms in index using matrix trans */
-void principal_comp(int n, int index[], t_atom atom[], rvec x[],
+void principal_comp(int n, const int index[], t_atom atom[], rvec x[],
matrix trans, rvec d);
/* Calculate the principal components of atoms in index. Atoms are
* mass weighted. It is assumed that the center of mass is in the origin!
*/
-void orient_princ(t_atoms *atoms, int isize, int *index,
+void orient_princ(const t_atoms *atoms, int isize, const int *index,
int natoms, rvec x[], rvec *v, rvec d);
/* rotates molecule to align principal axes with coordinate axes */
-real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
+real calc_xcm(const rvec x[], int gnx, const int *index, const t_atom *atom, rvec xcm,
gmx_bool bQ);
/* Calculate the center of mass of the atoms in index. if bQ then the atoms
* will be charge weighted rather than mass weighted.
* Returns the total mass/charge.
*/
-real sub_xcm(rvec x[], int gnx, int *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, const int *index, const t_atom atom[], rvec xcm,
gmx_bool bQ);
/* Calc. the center of mass and subtract it from all coordinates.
* Returns the original center of mass in xcm
*
* 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,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.
extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, int * index,
- int isize, t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf)
+ int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf)
/* given the group's index, return the (continuous) array of atoms */
{
int i;
*
* 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,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.
int return_atom_type (const char *name, gmx_structurefactors_t *gsf);
void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, int * index,
- int isize, struct t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
+ int isize, const t_topology * top, gmx_bool flag, gmx_structurefactors_t *gsf);
int do_scattering_intensity (const char* fnTPS, const char* fnNDX,
const char* fnXVG, const char *fnTRX,
}
static int check_atom_names(const char *fn1, const char *fn2,
- gmx_mtop_t *mtop, t_atoms *at)
+ gmx_mtop_t *mtop, const t_atoms *at)
{
int mb, m, i, j, nmismatch;
t_atoms *tat;
*
* 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,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.
sfree(moltypes);
}
-static void rm_res_pbc(t_atoms *atoms, std::vector<RVec> *x, matrix box)
+static void rm_res_pbc(const t_atoms *atoms, std::vector<RVec> *x, matrix box)
{
int start, nat;
rvec xcg;
int *nrmols,
t_molinfo **molinfo,
t_molinfo **intermolecular_interactions,
- t_inputrec *ir,
+ const t_inputrec *ir,
int *nmolblock,
gmx_molblock_t **molblock,
gmx_bool bGenborn,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
double check_mol(gmx_mtop_t *mtop, warninp_t wi);
/* Check mass and charge */
-char **do_top(gmx_bool bVerbose,
- const char *topfile,
- const char *topppfile,
- t_gromppopts *opts,
- gmx_bool bZero,
- struct t_symtab *symtab,
- t_params plist[],
- int *combination_rule,
- double *repulsion_power,
- real *fudgeQQ,
- gpp_atomtype_t atype,
- int *nrmols,
- t_molinfo **molinfo,
- t_molinfo **intermolecular_interactions,
- t_inputrec *ir,
- int *nmolblock,
- gmx_molblock_t **molblock,
- gmx_bool bGB,
- warninp_t wi);
+char **do_top(gmx_bool bVerbose,
+ const char *topfile,
+ const char *topppfile,
+ t_gromppopts *opts,
+ gmx_bool bZero,
+ struct t_symtab *symtab,
+ t_params plist[],
+ int *combination_rule,
+ double *repulsion_power,
+ real *fudgeQQ,
+ gpp_atomtype_t atype,
+ int *nrmols,
+ t_molinfo **molinfo,
+ t_molinfo **intermolecular_interactions,
+ const t_inputrec *ir,
+ int *nmolblock,
+ gmx_molblock_t **molblock,
+ gmx_bool bGB,
+ warninp_t wi);
/* This routine expects sys->molt[m].ilist to be of size F_NRE and ordered. */
void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp_t wi);
}
void mk_bonds(int nnm, t_nm2type nmt[],
- t_atoms *atoms, rvec x[], t_params *bond, int nbond[],
+ t_atoms *atoms, const rvec x[], t_params *bond, int nbond[],
gmx_bool bPBC, matrix box)
{
t_param b;
lo_set_force_const(&plist[F_PDIHS], c, 3, bRound, TRUE, bParam);
}
-void calc_angles_dihs(t_params *ang, t_params *dih, rvec x[], gmx_bool bPBC,
+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;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,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.
}
}
-void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v)
+void gmx_mat4_transform_point(mat4 m, const rvec x, vec4 v)
{
int i;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,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.
void gmx_mat4_copy(mat4 a, mat4 b);
-void gmx_mat4_transform_point(mat4 m, rvec x, vec4 v);
+void gmx_mat4_transform_point(mat4 m, const rvec x, vec4 v);
/*! \brief
* Computes the product of two `mat4` matrices as A = B * C.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
return calc_similar_ind(TRUE, natoms, NULL, mass, x, xp);
}
-void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x, matrix R)
+void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x, matrix R)
{
int c, r, n, j, i, irot, s;
double **omega, **om;
sfree(om);
}
-void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x)
+void do_fit_ndim(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x)
{
int j, m, r, c;
matrix R;
}
}
-void do_fit(int natoms, real *w_rls, rvec *xp, rvec *x)
+void do_fit(int natoms, real *w_rls, const rvec *xp, rvec *x)
{
do_fit_ndim(3, natoms, w_rls, xp, x);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
* Maiorov & Crippen, PROTEINS 22, 273 (1995).
*/
-void calc_fit_R(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x,
+void calc_fit_R(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x,
matrix R);
/* Calculates the rotation matrix R for which
* sum_i w_rls_i (xp_i - R x_i).(xp_i - R x_i)
* x_rotated[i] = sum R[i][j]*x[j]
*/
-void do_fit_ndim(int ndim, int natoms, real *w_rls, rvec *xp, rvec *x);
+void do_fit_ndim(int ndim, int natoms, real *w_rls, const rvec *xp, rvec *x);
/* Do a least squares fit of x to xp. Atoms which have zero mass
* (w_rls[i]) are not taken into account in fitting.
* This makes is possible to fit eg. on Calpha atoms and orient
* therefore both xp and x should be centered round the origin.
*/
-void do_fit(int natoms, real *w_rls, rvec *xp, rvec *x);
+void do_fit(int natoms, real *w_rls, const rvec *xp, rvec *x);
/* Calls do_fit with ndim=3, thus fitting in 3D */
void reset_x_ndim(int ndim, int ncm, const int *ind_cm,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,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.
}
static void pp_group_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
- matrix box,
+ const matrix box,
int *nq_tot, int *nlj_tot,
double *cost_pp,
gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
}
static void pp_verlet_load(const gmx_mtop_t *mtop, const t_inputrec *ir,
- matrix box,
+ const matrix box,
int *nq_tot, int *nlj_tot,
double *cost_pp,
gmx_bool *bChargePerturbed, gmx_bool *bTypePerturbed)
}
float pme_load_estimate(const gmx_mtop_t *mtop, const t_inputrec *ir,
- matrix box)
+ const matrix box)
{
int nq_tot, nlj_tot;
gmx_bool bChargePerturbed, bTypePerturbed;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
*/
float pme_load_estimate(const gmx_mtop_t *mtop, const t_inputrec *ir,
- matrix box);
+ const matrix box);
/* Returns an estimate for the relative load of the PME mesh calculation
* in the total force calculation.
* This estimate is reasonable for recent Intel and AMD x86_64 CPUs.
*
************************************************************/
-static void mk_1shift_tric(int npbcdim, matrix box, const rvec hbox,
+static void mk_1shift_tric(int npbcdim, const matrix box, const rvec hbox,
const rvec xi, const rvec xj, int *mi, int *mj)
{
/* Calculate periodicity for triclinic box... */
}
}
-static void mk_1shift_screw(matrix box, const rvec hbox,
+static void mk_1shift_screw(const matrix box, const rvec hbox,
const rvec xi, const rvec xj, int *mi, int *mj)
{
/* Calculate periodicity for rectangular box... */
}
static int mk_grey(egCol egc[], t_graph *g, int *AtomI,
- int npbcdim, matrix box, const rvec x[], int *nerror)
+ int npbcdim, const matrix box, const rvec x[], int *nerror)
{
int m, j, ng, ai, aj, g0;
rvec dx, hbox;
}
void mk_mshift(FILE *log, t_graph *g, int ePBC,
- matrix box, const rvec x[])
+ const matrix box, const rvec x[])
{
static int nerror_tot = 0;
int npbcdim;
*
************************************************************/
-void shift_x(const t_graph *g, matrix box, const rvec x[], rvec x_s[])
+void shift_x(const t_graph *g, const matrix box, const rvec x[], rvec x_s[])
{
ivec *is;
int g0, g1;
}
}
-void shift_self(const t_graph *g, matrix box, rvec x[])
+void shift_self(const t_graph *g, const matrix box, rvec x[])
{
ivec *is;
int g0, g1;
}
}
-void unshift_x(const t_graph *g, matrix box, rvec x[], const rvec x_s[])
+void unshift_x(const t_graph *g, const matrix box, rvec x[], const rvec x_s[])
{
ivec *is;
int g0, g1;
}
}
-void unshift_self(const t_graph *g, matrix box, rvec x[])
+void unshift_self(const t_graph *g, const matrix box, rvec x[])
{
ivec *is;
int g0, g1;
*
* 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,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.
/* Print a graph to log */
void mk_mshift(FILE *log, t_graph *g, int ePBC,
- matrix box, const rvec x[]);
+ const matrix box, const rvec x[]);
/* Calculate the mshift codes, based on the connection graph in g. */
-void shift_x(const t_graph *g, matrix box, const rvec x[], rvec x_s[]);
+void shift_x(const t_graph *g, const matrix box, const rvec x[], rvec x_s[]);
/* Add the shift vector to x, and store in x_s (may be same array as x) */
-void shift_self(const t_graph *g, matrix box, rvec x[]);
+void shift_self(const t_graph *g, const matrix box, rvec x[]);
/* Id. but in place */
-void unshift_x(const t_graph *g, matrix box, rvec x[], const rvec x_s[]);
+void unshift_x(const t_graph *g, const matrix box, rvec x[], const rvec x_s[]);
/* Subtract the shift vector from x_s, and store in x (may be same array) */
-void unshift_self(const t_graph *g, matrix box, rvec x[]);
+void unshift_self(const t_graph *g, const matrix box, rvec x[]);
/* Id, but in place */
#ifdef __cplusplus
*
* 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,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.
} rmpbc_graph_t;
struct gmx_rmpbc {
- t_idef *idef;
+ const t_idef *idef;
int natoms_init;
int ePBC;
int ngraph;
return gr->gr;
}
-gmx_rmpbc_t gmx_rmpbc_init(t_idef *idef, int ePBC, int natoms)
+gmx_rmpbc_t gmx_rmpbc_init(const t_idef *idef, int ePBC, int natoms)
{
gmx_rmpbc_t gpbc;
}
}
-static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, matrix box)
+static int gmx_rmpbc_ePBC(gmx_rmpbc_t gpbc, const matrix box)
{
if (NULL != gpbc && gpbc->ePBC >= 0)
{
}
}
-void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[])
+void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[])
{
int ePBC;
t_graph *gr;
}
}
-void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[], rvec x_s[])
+void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[], rvec x_s[])
{
int ePBC;
t_graph *gr;
}
}
-void rm_gropbc(t_atoms *atoms, rvec x[], matrix box)
+void rm_gropbc(const t_atoms *atoms, rvec x[], const matrix box)
{
real dist;
int n, m, d;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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.
typedef struct gmx_rmpbc *gmx_rmpbc_t;
-gmx_rmpbc_t gmx_rmpbc_init(struct t_idef *idef, int ePBC, int natoms);
+gmx_rmpbc_t gmx_rmpbc_init(const t_idef *idef, int ePBC, int natoms);
void gmx_rmpbc_done(gmx_rmpbc_t gpbc);
-void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[]);
+void gmx_rmpbc(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[]);
/* Correct coordinates x for atoms within every molecule for the periodic
* boundary conditions such that every molecule is whole.
* natoms is the size x and can be smaller than the number
* When ePBC=-1, the type of pbc is guessed from the box matrix.
*/
-void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, matrix box, rvec x[],
+void gmx_rmpbc_copy(gmx_rmpbc_t gpbc, int natoms, const matrix box, rvec x[],
rvec x_s[]);
/* As gmx_rmpbc, but outputs in x_s and does not modify x. */
void gmx_rmpbc_trxfr(gmx_rmpbc_t gpbc, struct t_trxframe *fr);
/* As gmx_rmpbc but operates on a t_trxframe data structure. */
-void rm_gropbc(struct t_atoms *atoms, rvec x[], matrix box);
+void rm_gropbc(const t_atoms *atoms, rvec x[], const matrix box);
/* Simple routine for use in analysis tools that just have a pdb or
* similar file.
*/
*
* 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,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.
float bBox;
} t_fr_time;
-static void tpx2system(FILE *fp, gmx_mtop_t *mtop)
+static void tpx2system(FILE *fp, const gmx_mtop_t *mtop)
{
int nmol, nvsite = 0;
gmx_mtop_atomloop_block_t aloop;
fprintf(fp, "\n\n");
}
-static void tpx2params(FILE *fp, t_inputrec *ir)
+static void tpx2params(FILE *fp, const t_inputrec *ir)
{
fprintf(fp, "\\subsection{Simulation settings}\n");
fprintf(fp, "A total of %g ns were simulated with a time step of %g fs.\n",
}
}
-static void cmp_rvec(FILE *fp, const char *s, int index, rvec i1, rvec i2, real ftol, real abstol)
+static void cmp_rvec(FILE *fp, const char *s, int index, const rvec i1, const rvec i2, real ftol, real abstol)
{
if (!equal_real(i1[XX], i2[XX], ftol, abstol) ||
!equal_real(i1[YY], i2[YY], ftol, abstol) ||
}
}
-static void cmp_ivec(FILE *fp, const char *s, int index, ivec i1, ivec i2)
+static void cmp_ivec(FILE *fp, const char *s, int index, const ivec i1, const ivec i2)
{
if ((i1[XX] != i2[XX]) || (i1[YY] != i2[YY]) || (i1[ZZ] != i2[ZZ]))
{
}
}
-static void cmp_ilist(FILE *fp, int ftype, t_ilist *il1, t_ilist *il2)
+static void cmp_ilist(FILE *fp, int ftype, const t_ilist *il1, const t_ilist *il2)
{
int i;
char buf[256];
}
void cmp_iparm(FILE *fp, const char *s, t_functype ft,
- t_iparams ip1, t_iparams ip2, real ftol, real abstol)
+ const t_iparams &ip1, const t_iparams &ip2, real ftol, real abstol)
{
int i;
gmx_bool bDiff;
}
}
-void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft, t_iparams ip1, real ftol, real abstol)
+void cmp_iparm_AB(FILE *fp, const char *s, t_functype ft, const t_iparams &ip1, real ftol, real abstol)
{
int nrfpA, nrfpB, p0, i;
gmx_bool bDiff;
}
}
-static void cmp_idef(FILE *fp, t_idef *id1, t_idef *id2, real ftol, real abstol)
+static void cmp_idef(FILE *fp, const t_idef *id1, const t_idef *id2, real ftol, real abstol)
{
int i;
char buf1[64], buf2[64];
}
}
-static void cmp_block(FILE *fp, t_block *b1, t_block *b2, const char *s)
+static void cmp_block(FILE *fp, const t_block *b1, const t_block *b2, const char *s)
{
char buf[32];
cmp_int(fp, buf, -1, b1->nr, b2->nr);
}
-static void cmp_blocka(FILE *fp, t_blocka *b1, t_blocka *b2, const char *s)
+static void cmp_blocka(FILE *fp, const t_blocka *b1, const t_blocka *b2, const char *s)
{
char buf[32];
cmp_int(fp, buf, -1, b1->nra, b2->nra);
}
-static void cmp_atom(FILE *fp, int index, t_atom *a1, t_atom *a2, real ftol, real abstol)
+static void cmp_atom(FILE *fp, int index, const t_atom *a1, const t_atom *a2, real ftol, real abstol)
{
if (a2)
{
}
}
-static void cmp_atoms(FILE *fp, t_atoms *a1, t_atoms *a2, real ftol, real abstol)
+static void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol)
{
int i;
}
}
-static void cmp_top(FILE *fp, t_topology *t1, t_topology *t2, real ftol, real abstol)
+static void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol)
{
fprintf(fp, "comparing top\n");
if (t2)
}
}
-static void cmp_groups(FILE *fp, gmx_groups_t *g0, gmx_groups_t *g1,
+static void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,
int natoms0, int natoms1)
{
int i, j;
*/
}
-static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, rvec x1[], rvec x2[],
+static void cmp_rvecs_rmstol(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
real ftol, real abstol)
{
int i, m;
}
}
-static void cmp_rvecs(FILE *fp, const char *title, int n, rvec x1[], rvec x2[],
+static void cmp_rvecs(FILE *fp, const char *title, int n, const rvec x1[], const rvec x2[],
gmx_bool bRMSD, real ftol, real abstol)
{
int i, m;
}
}
-static void cmp_grpopts(FILE *fp, t_grpopts *opt1, t_grpopts *opt2, real ftol, real abstol)
+static void cmp_grpopts(FILE *fp, const t_grpopts *opt1, const t_grpopts *opt2, real ftol, real abstol)
{
int i, j;
char buf1[256], buf2[256];
}
}
-static void cmp_cosines(FILE *fp, const char *s, t_cosines c1[DIM], t_cosines c2[DIM], real ftol, real abstol)
+static void cmp_cosines(FILE *fp, const char *s, const t_cosines c1[DIM], const t_cosines c2[DIM], real ftol, real abstol)
{
int i, m;
char buf[256];
fprintf(fp, "WARNING: Both files use COM pulling, but comparing of the pull struct is not implemented (yet). The pull parameters could be the same or different.\n");
}
-static void cmp_simtempvals(FILE *fp, t_simtemp *simtemp1, t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
+static void cmp_simtempvals(FILE *fp, const t_simtemp *simtemp1, const t_simtemp *simtemp2, int n_lambda, real ftol, real abstol)
{
int i;
cmp_int(fp, "inputrec->simtempvals->eSimTempScale", -1, simtemp1->eSimTempScale, simtemp2->eSimTempScale);
}
}
-static void cmp_expandedvals(FILE *fp, t_expanded *expand1, t_expanded *expand2, int n_lambda, real ftol, real abstol)
+static void cmp_expandedvals(FILE *fp, const t_expanded *expand1, const t_expanded *expand2, int n_lambda, real ftol, real abstol)
{
int i;
cmp_real(fp, "inputrec->expandedvals->mc-temperature", -1, expand1->mc_temp, expand2->mc_temp, ftol, abstol);
}
-static void cmp_fepvals(FILE *fp, t_lambda *fep1, t_lambda *fep2, real ftol, real abstol)
+static void cmp_fepvals(FILE *fp, const t_lambda *fep1, const t_lambda *fep2, real ftol, real abstol)
{
int i, j;
cmp_int(fp, "inputrec->nstdhdl", -1, fep1->nstdhdl, fep2->nstdhdl);
cmp_double(fp, "inputrec->dh_hist_spacing", -1, fep1->dh_hist_spacing, fep2->dh_hist_spacing, ftol, abstol);
}
-static void cmp_inputrec(FILE *fp, t_inputrec *ir1, t_inputrec *ir2, real ftol, real abstol)
+static void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real ftol, real abstol)
{
fprintf(fp, "comparing inputrec\n");
}
}
-static void comp_state(t_state *st1, t_state *st2,
+static void comp_state(const t_state *st1, const t_state *st2,
gmx_bool bRMSD, real ftol, real abstol)
{
int i, j, nc;
*
* 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,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.
comp_tpx(const char *fn1, const char *fn2, gmx_bool bRMSD, real ftol, real abstol);
/* Compare two binary run input files */
+void comp_tpx_a_and_b_states(const char *fn, real ftol, real abstol);
+/* Compare two A and B states of a free-energy run input file. */
+
void
comp_trx(const gmx_output_env_t *oenv, const char *fn1, const char *fn2,
gmx_bool bRMSD, real ftol, real abstol);
std::fill(pdbinfo->uij, pdbinfo->uij+6, 0.0);
}
-t_atoms *copy_t_atoms(t_atoms *src)
+t_atoms *copy_t_atoms(const t_atoms *src)
{
t_atoms *dst;
int i;
void gmx_pdbinfo_init_default(t_pdbinfo *pdbinfo);
-t_atoms *copy_t_atoms(t_atoms *src);
+t_atoms *copy_t_atoms(const t_atoms *src);
/* copy an atoms struct from src to a new one */
void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra);
static int *
-mk_aid(t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
+mk_aid(const t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
/* Make an array of ints for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
{
int *a;
char *gname;
} restp_t;
-static void analyse_other(const char ** restype, t_atoms *atoms,
+static void analyse_other(const char ** restype, const t_atoms *atoms,
t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
{
restp_t *restp = NULL;
int compareto;
} t_gmx_help_make_index_group;
-static void analyse_prot(const char ** restype, t_atoms *atoms,
+static void analyse_prot(const char ** restype, const t_atoms *atoms,
t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
{
/* lists of atomnames to be used in constructing index groups: */
}
-void analyse(t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
+void analyse(const t_atoms *atoms, t_blocka *gb, char ***gn, gmx_bool bASK, gmx_bool bVerb)
{
gmx_residuetype_t*rt = NULL;
char *resnm;
rd_groups(grps, gnames, grpnames, ngrps, isize, index, grpnr);
}
-void get_index(t_atoms *atoms, const char *fnm, int ngrps,
+void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
int isize[], int *index[], char *grpnames[])
{
char ***gnames;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
int *index[], char *grpnames[], int grpnr[]);
/* the same but also reads the number of the selected group*/
-void get_index(struct t_atoms *atoms, const char *fnm, int ngrps,
+void get_index(const t_atoms *atoms, const char *fnm, int ngrps,
int isize[], int *index[], char *grpnames[]);
/* Does the same as rd_index, but if the fnm pointer is NULL it
* will not read from fnm, but it will make default index groups
void add_grp(struct t_blocka *b, char ***gnames, int nra, int a[], const char *name);
/* Ads group a with name name to block b and namelist gnames */
-void analyse(struct t_atoms *atoms, struct t_blocka *gb, char ***gn,
+void analyse(const t_atoms *atoms, struct t_blocka *gb, char ***gn,
gmx_bool bASK, gmx_bool bVerb);
/* Makes index groups gb with names gn for atoms in atoms.
* bASK=FALSE gives default groups.
return top;
}
-std::vector<size_t> get_atom_index(gmx_mtop_t *mtop)
+std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop)
{
std::vector<size_t> atom_index;
* \param[in] mtop Molecular topology
* \returns Vector that will be filled with the atom indices
*/
-std::vector<size_t> get_atom_index(gmx_mtop_t *mtop);
+std::vector<size_t> get_atom_index(const gmx_mtop_t *mtop);
#endif