rvec cg_cm;
ivec ind;
real nrcg, inv_ncg, pos_d;
- atom_id *cgindex;
+ int *cgindex;
gmx_bool bScrew;
ma = dd->ma;
real pos_d;
matrix tcm;
rvec *cg_cm = NULL, cell_x0, cell_x1, limitd, limit0, limit1;
- atom_id *cgindex;
+ int *cgindex;
cginfo_mb_t *cginfo_mb;
gmx_domdec_comm_t *comm;
int *moved;
int ftype, nral, i, j, nlink, link;
const t_ilist *il;
t_iatom *ia;
- atom_id a;
+ int a;
int nint;
gmx_bool bVSite;
real *dvdlambda_q, real *dvdlambda_lj)
{
int i, i1, i2, j, k, m, iv, jv, q;
- atom_id *AA;
+ int *AA;
double Vexcl_q, dvdl_excl_q, dvdl_excl_lj; /* Necessary for precision */
double Vexcl_lj;
real one_4pi_eps;
void write_sto_conf_indexed(const char *outfile, const char *title,
t_atoms *atoms,
rvec x[], rvec *v, int ePBC, matrix box,
- atom_id nindex, atom_id index[])
+ int nindex, int index[])
{
FILE *out;
int ftp;
#define GMX_FILEIO_CONFIO_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
/* For reading coordinate files it is assumed that enough memory
void write_sto_conf_indexed(const char *outfile, const char *title,
struct t_atoms *atoms,
rvec x[], rvec *v, int ePBC, matrix box,
- atom_id nindex, atom_id index[]);
+ int nindex, int index[]);
/* like write_sto_conf, but indexed */
void write_sto_conf(const char *outfile, const char *title,
}
void write_espresso_conf_indexed(FILE *out, const char *title,
- t_atoms *atoms, int nx, atom_id *index,
+ t_atoms *atoms, int nx, int *index,
rvec *x, rvec *v, matrix box)
{
int i, j;
#include <cstdio>
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
struct t_atoms;
struct t_topology;
int get_espresso_coordnum(const char *infile);
void write_espresso_conf_indexed(FILE *out, const char *title,
- t_atoms *atoms, int nx, atom_id *index,
+ t_atoms *atoms, int nx, int *index,
rvec *x, rvec *v, matrix box);
#endif
}
void write_g96_conf(FILE *out, t_trxframe *fr,
- int nindex, const atom_id *index)
+ int nindex, const int *index)
{
t_atoms *atoms;
int nout, i, a;
#include <stdio.h>
-#include "gromacs/topology/atom_id.h"
#ifdef __cplusplus
extern "C" {
* 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 atom_id *index);
+void write_g96_conf(FILE *out, struct t_trxframe *fr, int nindex, const int *index);
/* write a Gromos96 coordinate file or trajectory frame *
* index can be NULL */
}
void write_hconf_indexed_p(FILE *out, const char *title, t_atoms *atoms,
- int nx, const atom_id index[], int pr,
+ int nx, const int index[], int pr,
rvec *x, rvec *v, matrix box)
{
char resnm[6], nm[6], format[100];
void write_hconf_p(FILE *out, const char *title, t_atoms *atoms, int pr,
rvec *x, rvec *v, matrix box)
{
- atom_id *aa;
+ int *aa;
int i;
snew(aa, atoms->nr);
#include <stdio.h>
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
/* 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,
- int nx, const atom_id index[], int ndec,
+ int nx, const int index[], int ndec,
rvec *x, rvec *v, matrix box);
void write_hconf_mtop(FILE *out, const char *title, struct gmx_mtop_t *mtop, int pr,
#ifndef GMX_FILEIO_OENV_H
#define GMX_FILEIO_OENV_H
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
void write_pdbfile_indexed(FILE *out, const char *title,
t_atoms *atoms, rvec x[],
int ePBC, matrix box, char chainid,
- int model_nr, atom_id nindex, const atom_id index[],
+ int model_nr, int nindex, const int index[],
gmx_conect conect, gmx_bool bTerSepChains)
{
gmx_conect_t *gc = (gmx_conect_t *)conect;
char resnm[6], nm[6], pukestring[100];
- atom_id i, ii;
+ int i, ii;
int resind, resnr;
enum PDB_record type;
unsigned char resic, ch;
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)
{
- atom_id i, *index;
+ int i, *index;
snew(index, atoms->nr);
for (i = 0; i < atoms->nr; i++)
#include <stdio.h>
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
rvec x[], int ePBC, matrix box, char chain,
- int model_nr, atom_id nindex, const atom_id index[],
+ int model_nr, int nindex, const int index[],
gmx_conect conect, gmx_bool bTerSepChains);
/* REALLY low level */
tng_trajectory_t *output,
int nAtoms,
const gmx_mtop_t *mtop,
- const atom_id *index,
+ const int *index,
const char *indexGroupName)
{
#ifdef GMX_USE_TNG
void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
const int nind,
- const atom_id *ind,
+ const int *ind,
const char *name)
{
#ifdef GMX_USE_TNG
#include "tng/tng_io_fwd.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
tng_trajectory_t *out,
int nAtoms,
const struct gmx_mtop_t *mtop,
- const atom_id *index,
+ const int *index,
const char *indexGroupName);
/*! \brief Write a trxframe to a TNG file
* selection group. */
void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
const int nind,
- const atom_id *ind,
+ const int *ind,
const char *name);
/*! \brief Read the first/next TNG frame. */
}
int write_trxframe_indexed(t_trxstatus *status, t_trxframe *fr, int nind,
- const atom_id *ind, gmx_conect gc)
+ const int *ind, gmx_conect gc)
{
char title[STRLEN];
rvec *xout = NULL, *vout = NULL, *fout = NULL;
const char *infile,
const int natoms,
const gmx_mtop_t *mtop,
- const atom_id *index,
+ const int *index,
const char *index_group_name)
{
if (filemode != 'w' && filemode != 'a')
return 0;
}
-int write_trx(t_trxstatus *status, int nind, const atom_id *ind, t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, t_atoms *atoms,
int step, real time, matrix box, rvec x[], rvec *v,
gmx_conect gc)
{
/* Returns the number of frames read from the trajectory */
int write_trxframe_indexed(t_trxstatus *status, struct t_trxframe *fr, int nind,
- const atom_id *ind, gmx_conect gc);
+ const int *ind, gmx_conect gc);
/* Write an indexed frame to a TRX file, see write_trxframe. gc may be NULL */
int write_trxframe(t_trxstatus *status, struct t_trxframe *fr, gmx_conect gc);
* gc is important for pdb file writing only and may be NULL.
*/
-int write_trx(t_trxstatus *status, int nind, const atom_id *ind, struct t_atoms *atoms,
+int write_trx(t_trxstatus *status, int nind, const int *ind, struct t_atoms *atoms,
int step, real time, matrix box, rvec x[], rvec *v,
gmx_conect gc);
/* Write an indexed frame to a TRX file.
const char *infile,
const int natoms,
const struct gmx_mtop_t *mtop,
- const atom_id *index,
+ const int *index,
const char *index_group_name);
/* Sets up *out for writing TNG. If *in != NULL and contains a TNG trajectory
* some data, e.g. molecule system, will be copied over from *in to *out.
}
static void calc_angles(struct t_pbc *pbc,
- int n3, atom_id index[], real ang[], rvec x_s[])
+ int n3, int index[], real ang[], rvec x_s[])
{
int i, ix, t1, t2;
rvec r_ij, r_kj;
}
static void calc_dihs(struct t_pbc *pbc,
- int n4, atom_id index[], real ang[], rvec x_s[])
+ int n4, int index[], real ang[], rvec x_s[])
{
int i, ix, t1, t2, t3;
rvec r_ij, r_kj, r_kl, m, n;
gmx_bool bAngles, gmx_bool bSaveAll, gmx_bool bRb, gmx_bool bPBC,
int maxangstat, int angstat[],
int *nframes, real **time,
- int isize, atom_id index[],
+ int isize, int index[],
real **trans_frac,
real **aver_angle,
real *dih[],
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static void my_calc_xcm(int nbb, atom_id bbind[], rvec x[], rvec xcm)
+static void my_calc_xcm(int nbb, int bbind[], rvec x[], rvec xcm)
{
int i, m, ai;
}
}
-static void my_sub_xcm(int nbb, atom_id bbind[], rvec x[], rvec xcm)
+static void my_sub_xcm(int nbb, int bbind[], rvec x[], rvec xcm)
{
int i, ai;
}
}
-real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[],
+real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
rvec x[], int nca,
- atom_id caindex[], gmx_bool bFit)
+ int caindex[], gmx_bool bFit)
{
static rvec *xref = NULL;
static real *mass = NULL;
{
#endif
-real fit_ahx(int nres, t_bb bb[], int natoms, int nall, atom_id allindex[],
- rvec x[], int nca, atom_id caindex[], gmx_bool bFit);
+real fit_ahx(int nres, t_bb bb[], int natoms, int nall, int allindex[],
+ rvec x[], int nca, int caindex[], gmx_bool bFit);
#ifdef __cplusplus
}
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, atom_id *index,
- gmx_bool bFit, rvec *xref, int nfit, atom_id *ifit, real *w_rls,
+ int nextr, 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,
int noutvec, int *outvec, gmx_bool bSplit,
t_trxstatus *status;
int noutvec_extr, imin, imax;
real *pmin, *pmax;
- atom_id *all_at;
+ int *all_at;
matrix box;
rvec *xread, *x;
real t, inp, **inprod = NULL;
const char *indexfile;
int i, j, d;
int nout, *iout, noutvec, *outvec, nfit;
- atom_id *index = NULL, *ifit = NULL;
+ int *index = NULL, *ifit = NULL;
const char *VecFile, *Vec2File, *topfile;
const char *EigFile, *Eig2File;
const char *CompFile, *RmsfFile, *ProjOnVecFile;
FILE *out;
real dt;
int isize;
- atom_id *index;
+ int *index;
char *grpname;
real maxang, S2, norm_fac, maxstat;
unsigned long mode;
axis[c1] = ax[c0]*tmp[c0] + ax[c1]*tmp[c1];
}
-static void calc_axes(rvec x[], t_atom atom[], int gnx[], atom_id *index[],
+static void calc_axes(rvec x[], t_atom atom[], int gnx[], int *index[],
gmx_bool bRot, t_bundle *bun)
{
int end, i, div, d;
/* FIXME: The constness should not be cast away */
char *anm = (char *)"CA", *rnm = (char *)"GLY";
int i, gnx[MAX_ENDS];
- atom_id *index[MAX_ENDS];
+ int *index[MAX_ENDS];
t_bundle bun;
gmx_bool bKink;
rvec va, vb, vc, vr, vl;
return (map[x][y] == '1') ? TRUE : FALSE;
}
-atom_id *make_chi_ind(int nl, t_dlist dl[], int *ndih)
+int *make_chi_ind(int nl, t_dlist dl[], int *ndih)
{
- atom_id *id;
+ int *id;
int i, Xi, n;
/* There are nl residues with max edMax dihedrals with 4 atoms each */
static void histogramming(FILE *log, int nbin, gmx_residuetype_t *rt,
int nf, int maxchi, real **dih,
int nlist, t_dlist dlist[],
- atom_id index[],
+ 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,
gmx_output_env_t *oenv;
gmx_residuetype_t *rt;
- atom_id isize, *index;
+ int isize, *index;
int ndih, nactdih, nf;
real **dih, *trans_frac, *aver_angle, *time;
int i, **chi_lookup, *multiplicity;
clust->ncl = k-1;
}
-rvec **read_whole_trj(const char *fn, int isize, atom_id index[], int skip,
+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;
static void analyze_clusters(int nf, t_clusters *clust, real **rmsd,
int natom, t_atoms *atoms, rvec *xtps,
real *mass, rvec **xx, real *time,
- int ifsize, atom_id *fitidx,
- int iosize, atom_id *outidx,
+ int ifsize, int *fitidx,
+ int iosize, int *outidx,
const char *trxfn, const char *sizefn,
const char *transfn, const char *ntransfn,
const char *clustidfn, gmx_bool bAverage,
real *eigenvectors;
int isize = 0, ifsize = 0, iosize = 0;
- atom_id *index = NULL, *fitidx = NULL, *outidx = NULL;
+ int *index = NULL, *fitidx = NULL, *outidx = NULL;
char *grpname;
real rmsd, **d1, **d2, *time = NULL, time_invfac, *mass = NULL;
char buf[STRLEN], buf1[80], title[STRLEN];
const gmx_output_env_t *oenv)
{
FILE *fp, *gp, *hp, *tp;
- atom_id *index = NULL;
+ int *index = NULL;
int nindex, natoms;
t_trxstatus *status;
rvec *x = NULL, *v = NULL, dx;
static const int NOTSET = -9368163;
-void calc_rm_cm(int isize, atom_id index[], t_atoms *atoms, rvec x[], rvec xcm)
+void calc_rm_cm(int isize, int index[], t_atoms *atoms, rvec x[], rvec xcm)
{
int i, d;
real tm, m;
}
}
-int build_res_index(int isize, atom_id index[], t_atom atom[], int rindex[])
+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, atom_id index[], t_atoms *atoms)
+int find_res_end(int i, int isize, int index[], t_atoms *atoms)
{
int rnr;
return std::strcmp(s1, s2);
}
-int find_next_match_atoms_in_res(int *i1, atom_id index1[],
+int find_next_match_atoms_in_res(int *i1, int index1[],
int m1, char **atnms1[],
- int *i2, atom_id index2[],
+ int *i2, int index2[],
int m2, char **atnms2[])
{
int dx, dy, dmax, cmp;
return cmp;
}
-int find_first_atom_in_res(int rnr, int isize, atom_id index[], t_atom atom[])
+int find_first_atom_in_res(int rnr, int isize, int index[], t_atom atom[])
{
int i;
}
}
-void find_matching_names(int *isize1, atom_id index1[], t_atoms *atoms1,
- int *isize2, atom_id index2[], t_atoms *atoms2)
+void find_matching_names(int *isize1, int index1[], t_atoms *atoms1,
+ int *isize2, int index2[], t_atoms *atoms2)
{
int i1, i2, ii1, ii2, m1, m2;
int atcmp, rescmp;
int ePBC1, ePBC2;
t_atoms *atoms1, *atoms2;
int warn = 0;
- atom_id at;
+ int at;
real *w_rls, mass, totmass;
rvec *x1, *v1, *x2, *v2, *fit_x;
matrix box1, box2;
/* variables for fit */
char *groupnames1, *groupnames2;
int isize1, isize2;
- atom_id *index1, *index2;
+ int *index1, *index2;
real rms, msd, minmsd, maxmsd;
real *msds;
const char *asciifile, *xpmfile, *xpmafile;
char str[STRLEN], *fitname, *ananame;
int d, dj, nfit;
- atom_id *index, *ifit;
+ int *index, *ifit;
gmx_bool bDiffMass1, bDiffMass2;
char timebuf[STRLEN];
t_rgb rlo, rmi, rhi;
int ePBC, t_topology top, t_trxframe fr, real temp,
real bfit, real efit, real bvit, real evit,
t_trxstatus *status, int isize, int nmols, int nshift,
- atom_id *index0, int indexm[], real mass2[],
+ int *index0, int indexm[], real mass2[],
real qmol[], real eps_rf, const gmx_output_env_t *oenv)
{
int i, j;
t_trxframe fr;
real *mass2 = NULL;
matrix box;
- atom_id *index0;
+ int *index0;
int *indexm = NULL;
int isize;
t_trxstatus *status;
return nr;
}
-void center_coords(t_atoms *atoms, atom_id *index_center, int ncenter,
+void center_coords(t_atoms *atoms, int *index_center, int ncenter,
matrix box, rvec x0[])
{
int i, k, m;
}
}
-void calc_electron_density(const char *fn, atom_id **index, int gnx[],
+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,
- atom_id *index_center, int ncenter,
+ int *index_center, int ncenter,
gmx_bool bRelative, const gmx_output_env_t *oenv)
{
rvec *x0; /* coordinates without pbc */
sfree(x0); /* free memory used by coordinate array */
}
-void calc_density(const char *fn, atom_id **index, int gnx[],
+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,
- atom_id *index_center, int ncenter,
+ int *index_center, int ncenter,
gmx_bool bRelative, const gmx_output_env_t *oenv)
{
rvec *x0; /* coordinates without pbc */
t_electron *el_tab; /* tabel with nr. of electrons*/
t_topology *top; /* topology */
int ePBC;
- atom_id *index_center; /* index for centering group */
- atom_id **index; /* indices for all groups */
+ int *index_center; /* index for centering group */
+ int **index; /* indices for all groups */
int i;
t_filenm fnm[] = { /* files for g_density */
char **grpname, buf[STRLEN];
const char *unit;
int i, j, k, l, ngrps, anagrp, *gnx = NULL, nindex, nradial = 0, nfr, nmpower;
- atom_id **ind = NULL, *index;
+ int **ind = NULL, *index;
real **grid, maxgrid, m1, m2, box1, box2, *tickx, *tickz, invcellvol;
real invspa = 0, invspz = 0, axial, r, vol_old, vol, rowsum;
int nlev = 51;
}
-static void density_in_time (const char *fn, atom_id **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, t_topology *top, int ePBC, int axis, gmx_bool bCenter, gmx_bool bps1d, const gmx_output_env_t *oenv)
{
/*
static int nsttblock = 100;
static int axis = 2;
static const char *axtitle = "Z";
- atom_id **index; /* Index list for single group*/
+ int **index; /* Index list for single group*/
int xslices, yslices, zslices, tblock;
static gmx_bool bGraph = FALSE;
static gmx_bool bCenter = FALSE;
};
int *gnx;
int nFF[2];
- atom_id **grpindex;
+ int **grpindex;
char **grpname = NULL;
gmx_bool bGkr, bMU, bSlab;
t_filenm fnm[] = {
t_ilist *disres, t_iparams forceparams[],
rvec x[], rvec f[],
t_pbc *pbc, t_graph *g, t_dr_result dr[],
- int clust_id, int isize, atom_id index[], real vvindex[],
+ int clust_id, int isize, int index[], real vvindex[],
t_fcdata *fcd)
{
t_iatom *forceatoms;
}
}
-static gmx_bool is_core(int i, int isize, atom_id index[])
+static gmx_bool is_core(int i, int isize, int index[])
{
int kk;
gmx_bool bIC = FALSE;
static void dump_stats(FILE *log, int nsteps, int ndr, t_ilist *disres,
t_iparams ip[], t_dr_result *dr,
- int isize, atom_id index[], t_atoms *atoms)
+ int isize, int index[], t_atoms *atoms)
{
int i, j, nra;
t_dr_stats *drs;
static void dump_clust_stats(FILE *fp, int ndr, t_ilist *disres,
t_iparams ip[], t_blocka *clust, t_dr_result dr[],
- char *clust_name[], int isize, atom_id index[])
+ char *clust_name[], int isize, int index[])
{
int i, j, k, nra, mmm = 0;
double sumV, maxV, sumVT3, sumVT6, maxVT3, maxVT6;
int n_res, a_offset, mb, mol, a;
t_atoms *atoms;
int i, j, nra, nratoms, tp, ri, rj, index, nlabel, label;
- atom_id ai, aj, *ptr;
+ int ai, aj, *ptr;
real **matrix, *t_res, hi, *w_dr, rav, rviol;
t_rgb rlo = { 1, 1, 1 };
t_rgb rhi = { 0, 0, 0 };
matrix box;
gmx_bool bPDB;
int isize;
- atom_id *index = NULL, *ind_fit = NULL;
+ int *index = NULL, *ind_fit = NULL;
char *grpname;
t_cluster_ndx *clust = NULL;
t_dr_result dr, *dr_clust = NULL;
matrix box = {{0}};
int gnx;
char *grpnm, *ss_str;
- atom_id *index;
+ int *index;
rvec *xp, *x;
int *average_area;
real **accr, *accr_ptr = NULL, *av_area, *norm_av_area;
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, atom_id *index, int nindex)
+static int calcMoleculesInIndexGroup(t_block *mols, int natoms, int *index, int nindex)
{
int i = 0;
int mol = 0;
double cP, DiffCoeff, Delta, f, y, z, sigHS, Shs, Sig, DoS0, recip_fac;
double wCdiff, wSdiff, wAdiff, wEdiff;
int grpNatoms;
- atom_id *index;
+ int *index;
char *grpname;
double invNormalize;
gmx_bool normalizeAutocorrelation;
const char *in_trajfile, *out_xvgrkfile = NULL, *out_xvginstefffile = NULL, *out_xvgrhistfile = NULL, *out_xvgkhistfile = NULL, *out_datfile = NULL;
gmx_bool bHaveFirstFrame, bHaveNextFrame, indexOK = TRUE;
int ndon, nacc;
- atom_id *donindex, *accindex;
+ int *donindex, *accindex;
char *grpnm;
t_trxstatus *status;
t_trxframe fr;
#include "gromacs/utility/smalloc.h"
static void rot_conf(t_atoms *atoms, rvec x[], rvec v[], real trans, real angle,
- rvec head, rvec tail, int isize, atom_id index[],
+ rvec head, rvec tail, int isize, int index[],
rvec xout[], rvec vout[])
{
rvec arrow, xcm;
};
int i, j, natoms, isize;
t_trxstatus *status;
- atom_id *index = NULL, *index_all;
+ int *index = NULL, *index_all;
char *grpname;
real angle, trans;
rvec *x, *v, *xout, *vout;
return tmass;
}
-real calc_geom(int isize, atom_id *index, rvec *x, rvec geom_center, rvec minval,
+real calc_geom(int isize, int *index, rvec *x, rvec geom_center, rvec minval,
rvec maxval, gmx_bool bDiam)
{
real diam2, d;
t_topology *top = NULL;
char *grpname, *sgrpname, *agrpname;
int isize, ssize, asize;
- atom_id *index, *sindex, *aindex;
+ int *index, *sindex, *aindex;
rvec *x, *v, gc, rmin, rmax, size;
int ePBC;
matrix box, rotmatrix, trans;
if (bOrient)
{
- atom_id *index;
+ int *index;
char *grpnames;
/* Get a group for principal component analysis */
matrix topbox, *box, boxf;
char *grpname;
int isize;
- atom_id *index;
+ int *index;
real *w_rls = NULL;
t_trxstatus *in;
t_trxstatus *outl, *outh;
int nffr, i, fr, nat, j, d, m;
- atom_id *ind;
+ int *ind;
real flen, *filt, sum, *t;
rvec xcmtop, xcm, **x, *ptr, *xf, *xn, *xp, hbox;
gmx_output_env_t *oenv;
#include "gromacs/utility/smalloc.h"
static void insert_ion(int nsa, int *nwater,
- gmx_bool bSet[], int repl[], atom_id index[],
+ gmx_bool bSet[], int repl[], int index[],
rvec x[], t_pbc *pbc,
int sign, int q, const char *ionname,
t_atoms *atoms,
return str;
}
-void sort_ions(int nsa, int nw, int repl[], atom_id index[],
+void sort_ions(int nsa, int nw, int repl[], int index[],
t_atoms *atoms, rvec x[],
const char *p_name, const char *n_name)
{
t_atoms atoms;
t_pbc pbc;
int *repl, ePBC;
- atom_id *index;
+ int *index;
char *grpname;
gmx_bool *bSet;
int i, nw, nwa, nsa, nsalt, iqtot;
FILE *out;
int igrp;
real d, dd, lo, hi;
- atom_id *ind_grp;
+ int *ind_grp;
const char *xfn, *nfn;
char *gn_grp;
matrix box;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-real calc_gyro(rvec x[], int gnx, atom_id index[], t_atom atom[], real tm,
+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;
}
void calc_gyro_z(rvec x[], matrix box,
- int gnx, atom_id index[], t_atom atom[],
+ int gnx, int index[], t_atom atom[],
int nz, real time, FILE *out)
{
static dvec *inertia = NULL;
int natoms;
char *grpname;
int j, m, gnx, nam, mol;
- atom_id *index;
+ int *index;
gmx_output_env_t *oenv;
gmx_rmpbc_t gpbc = NULL;
const char *leg[] = { "Rg", "Rg\\sX\\N", "Rg\\sY\\N", "Rg\\sZ\\N" };
/* directions. */
/****************************************************************************/
-void calc_h2order(const char *fn, atom_id index[], int ngx, rvec **slDipole,
+void calc_h2order(const char *fn, int index[], int ngx, rvec **slDipole,
real **slOrder, real *slWidth, int *nslices,
t_topology *top, int ePBC,
- int axis, gmx_bool bMicel, atom_id micel[], int nmic,
+ int axis, gmx_bool bMicel, int micel[], int nmic,
const gmx_output_env_t *oenv)
{
rvec *x0, /* coordinates with pbc */
nmic = 0; /* nr. of atoms in micelle */
t_topology *top; /* topology */
int ePBC;
- atom_id *index, /* indices for solvent group */
+ int *index, /* indices for solvent group */
*micelle = NULL;
gmx_bool bMicel = FALSE; /* think we're a micel */
t_filenm fnm[] = { /* files for g_order */
typedef struct {
int nr;
int maxnr;
- atom_id *atoms;
+ int *atoms;
} t_ncell;
typedef struct {
} t_gridcell;
typedef int t_icell[grNR];
-typedef atom_id h_id[MAXHYDRO];
+typedef int h_id[MAXHYDRO];
typedef struct {
int history[MAXHYDRO];
typedef struct {
int nra, max_nra;
- atom_id *acc; /* Atom numbers of the acceptors */
- int *grp; /* Group index */
- int *aptr; /* Map atom number to acceptor index */
+ int *acc; /* Atom numbers of the acceptors */
+ int *grp; /* Group index */
+ int *aptr; /* Map atom number to acceptor index */
} t_acceptors;
typedef struct {
}
}
-static int _acceptor_index(t_acceptors *a, int grp, atom_id i,
+static int _acceptor_index(t_acceptors *a, int grp, int i,
const char *file, int line)
{
int ai = a->aptr[i];
}
#define acceptor_index(a, grp, i) _acceptor_index(a, grp, i, __FILE__, __LINE__)
-static int _donor_index(t_donors *d, int grp, atom_id i, const char *file, int line)
+static int _donor_index(t_donors *d, int grp, int i, const char *file, int line)
{
int di = d->dptr[i];
return buf;
}
-static void gen_datable(atom_id *index, int isize, unsigned char *datable, int natoms)
+static void gen_datable(int *index, int isize, unsigned char *datable, int natoms)
{
/* Generates table of all atoms and sets the ingroup bit for atoms in index[] */
int i;
}
static void search_acceptors(t_topology *top, int isize,
- atom_id *index, t_acceptors *a, int grp,
+ 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, atom_id *index,
+static void search_donors(t_topology *top, int isize, 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;
- atom_id nr1, nr2, nr3;
+ int nr1, nr2, nr3;
if (!ddd->dptr)
{
ivec ngrid, t_gridcell ***grid)
{
int i, m, gr, xi, yi, zi, nr;
- atom_id *ad;
+ int *ad;
ivec grididx;
rvec invdelta, dshell;
t_ncell *newgrid;
int npargs, natoms, nframes = 0, shatom;
int *isize;
char **grpnames;
- atom_id **index;
+ int **index;
rvec *x, hbox;
matrix box;
real t, ccut, dist = 0.0, ang = 0.0;
if (rshell > 0)
{
int shisz;
- atom_id *shidx;
+ int *shidx;
char *shgrpnm;
/* get index group with atom for shell */
do
int natoms, nres;
t_bb *bb;
int i, j, nall, nbb, nca, teller;
- atom_id *bbindex, *caindex, *allindex;
+ int *bbindex, *caindex, *allindex;
t_topology *top;
int ePBC;
rvec *x, *xref;
int i, j, teller = 0;
int iCA, iSC;
- atom_id *ind_CA;
- atom_id *ind_SC;
+ int *ind_CA;
+ int *ind_SC;
char *gn_CA;
char *gn_SC;
rvec v1, v2;
#include "gromacs/utility/smalloc.h"
/* Print name of first atom in all groups in index file */
-static void print_types(atom_id index[], atom_id a[], int ngrps,
+static void print_types(int index[], int a[], int ngrps,
char *groups[], t_topology *top)
{
int i;
static void find_tetra_order_grid(t_topology top, int ePBC,
int natoms, matrix box,
- rvec x[], int maxidx, atom_id index[],
+ rvec x[], int maxidx, int index[],
real *sgmean, real *skmean,
int nslicex, int nslicey, int nslicez,
real ***sggrid, real ***skgrid)
rvec *xtop, *x;
matrix box;
real sg, sk, sgintf;
- atom_id **index = NULL;
+ int **index = NULL;
char **grpname = NULL;
int i, j, k, n, *isize, ng, nslicez, framenr;
real ***sg_grid = NULL, ***sk_grid = NULL, ***sg_fravg = NULL, ***sk_fravg = NULL, ****sk_4d = NULL, ****sg_4d = NULL;
-void make_t_edx(struct edix *edx, int natoms, rvec *pos, atom_id index[])
+void make_t_edx(struct edix *edx, int natoms, rvec *pos, int index[])
{
edx->nr = natoms;
edx->anrs = index;
snew(edx->anrs, 1);
}
-void filter2edx(struct edix *edx, int nindex, atom_id index[], int ngro,
- atom_id igro[], rvec *x, const char* structure)
+void filter2edx(struct edix *edx, int nindex, int index[], int ngro,
+ int igro[], 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,
const char *StructureFile, struct edix *edx, int nfit,
- atom_id ifit[], int nav, atom_id index[])
+ int ifit[], int nav, int index[])
{
- atom_id *igro; /*index corresponding to target or origin structure*/
+ int *igro; /*index corresponding to target or origin structure*/
int ngro;
int ntar;
rvec *xtar;
char *grpname;
const char *indexfile;
int i;
- atom_id *index, *ifit;
+ int *index, *ifit;
int nfit; /* Number of atoms in the reference/fit structure */
int ev_class; /* parameter _class i.e. evMON, evRADFIX etc. */
int nvecs;
gmx_bool bCase = FALSE;
-static int or_groups(atom_id nr1, atom_id *at1, atom_id nr2, atom_id *at2,
- atom_id *nr, atom_id *at)
+static int or_groups(int nr1, int *at1, int nr2, int *at2,
+ int *nr, int *at)
{
- atom_id i1, i2, max = 0;
+ int i1, i2, max = 0;
gmx_bool bNotIncr;
*nr = 0;
return *nr;
}
-static int and_groups(atom_id nr1, atom_id *at1, atom_id nr2, atom_id *at2,
- atom_id *nr, atom_id *at)
+static int and_groups(int nr1, int *at1, int nr2, int *at2,
+ int *nr, int *at)
{
- atom_id i1, i2;
+ int i1, i2;
*nr = 0;
for (i1 = 0; i1 < nr1; i1++)
return (*nr) != -1;
}
-static int select_atomnumbers(char **string, t_atoms *atoms, atom_id n1,
- atom_id *nr, atom_id *index, char *gname)
+static int select_atomnumbers(char **string, t_atoms *atoms, int n1,
+ int *nr, int *index, char *gname)
{
char buf[STRLEN];
int i, up;
}
static int select_residuenumbers(char **string, t_atoms *atoms,
- atom_id n1, char c,
- atom_id *nr, atom_id *index, char *gname)
+ int n1, char c,
+ int *nr, int *index, char *gname)
{
char buf[STRLEN];
int i, j, up;
}
static int select_residueindices(char **string, t_atoms *atoms,
- atom_id n1, char c,
- atom_id *nr, atom_id *index, char *gname)
+ int n1, char c,
+ int *nr, int *index, char *gname)
{
/*this should be similar to select_residuenumbers except select by index (sequential numbering in file)*/
/*resind+1 for 1-indexing*/
static gmx_bool atoms_from_residuenumbers(t_atoms *atoms, int group, t_blocka *block,
- atom_id *nr, atom_id *index, char *gname)
+ int *nr, int *index, char *gname)
{
int i, j, j0, j1, resnr, nres;
}
static int select_chainnames(t_atoms *atoms, int n_names, char **names,
- atom_id *nr, atom_id *index)
+ int *nr, int *index)
{
char name[2];
int j;
- atom_id i;
+ int i;
name[1] = 0;
*nr = 0;
}
static int select_atomnames(t_atoms *atoms, int n_names, char **names,
- atom_id *nr, atom_id *index, gmx_bool bType)
+ int *nr, int *index, gmx_bool bType)
{
char *name;
int j;
- atom_id i;
+ int i;
*nr = 0;
for (i = 0; i < atoms->nr; i++)
}
static int select_residuenames(t_atoms *atoms, int n_names, char **names,
- atom_id *nr, atom_id *index)
+ int *nr, int *index)
{
char *name;
int j;
- atom_id i;
+ int i;
*nr = 0;
for (i = 0; i < atoms->nr; i++)
return *nr;
}
-static void copy2block(int n, atom_id *index, t_blocka *block)
+static void copy2block(int n, int *index, t_blocka *block)
{
int i, n0;
}
}
-static void copy_group(int g, t_blocka *block, atom_id *nr, atom_id *index)
+static void copy_group(int g, t_blocka *block, int *nr, int *index)
{
int i, i0;
{
char buf[STRLEN], *name;
int i, resind;
- atom_id a, n0, n1;
+ int a, n0, n1;
printf("Splitting group %d '%s' into %s\n", sel_nr, (*gn)[sel_nr],
bAtom ? "atoms" : "residues");
{
char buf[STRLEN];
int j, nchain;
- atom_id i, a, natoms, *start = NULL, *end = NULL, ca_start, ca_end;
+ int i, a, natoms, *start = NULL, *end = NULL, ca_start, ca_end;
rvec vec;
natoms = atoms->nr;
static gmx_bool parse_entry(char **string, int natoms, t_atoms *atoms,
t_blocka *block, char ***gn,
- atom_id *nr, atom_id *index, char *gname)
+ int *nr, int *index, char *gname)
{
static char **names, *ostring;
static gmx_bool bFirst = TRUE;
int j, n_names, sel_nr1;
- atom_id i, nr1, *index1;
+ int i, nr1, *index1;
char c;
gmx_bool bRet, bCompl;
char inp_string[STRLEN], *string;
char gname[STRLEN], gname1[STRLEN], gname2[STRLEN];
int i, i0, i1, sel_nr, sel_nr2, newgroup;
- atom_id nr, nr1, nr2, *index, *index1, *index2;
+ int nr, nr1, nr2, *index, *index1, *index2;
gmx_bool bAnd, bOr, bPrintOnce;
if (bFirst)
}
static void calc_mat(int nres, int natoms, int rndx[],
- rvec x[], atom_id *index,
+ rvec x[], int *index,
real trunc, real **mdmat, int **nmat, int ePBC, matrix box)
{
int i, j, resi, resj;
int ePBC;
t_atoms useatoms;
int isize;
- atom_id *index;
+ int *index;
char *grpname;
int *rndx, *natm, prevres, newres;
static void periodic_dist(int ePBC,
- matrix box, rvec x[], int n, atom_id index[],
+ matrix box, rvec x[], int n, int index[],
real *rmin, real *rmax, int *min_ind)
{
#define NSHIFT_MAX 26
static void periodic_mindist_plot(const char *trxfn, const char *outfn,
t_topology *top, int ePBC,
- int n, atom_id index[], gmx_bool bSplit,
+ int n, int index[], gmx_bool bSplit,
const gmx_output_env_t *oenv)
{
FILE *out;
}
static void calc_dist(real rcut, gmx_bool bPBC, int ePBC, matrix box, rvec x[],
- int nx1, int nx2, atom_id index1[], atom_id index2[],
+ int nx1, int nx2, int index1[], int index2[],
gmx_bool bGroup,
real *rmin, real *rmax, int *nmin, int *nmax,
int *ixmin, int *jxmin, int *ixmax, int *jxmax)
{
int i, j, i0 = 0, j1;
int ix, jx;
- atom_id *index3;
+ int *index3;
rvec dx;
real r2, rmin2, rmax2, rcut2;
t_pbc pbc;
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,
- int ng, atom_id *index[], int gnx[], char *grpn[], gmx_bool bSplit,
- gmx_bool bMin, int nres, atom_id *residue, gmx_bool bPBC, int ePBC,
+ 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)
{
int min2, max2, min1r, min2r, max1r, max2r;
int min1 = 0;
int max1 = 0;
- atom_id oindex[2];
+ int oindex[2];
rvec *x0;
matrix box;
gmx_bool bFirst;
sfree(x0);
}
-int find_residues(t_atoms *atoms, int n, atom_id index[], atom_id **resindex)
+int find_residues(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, atom_id *resindex, atom_id index[])
+void dump_res(FILE *out, int nres, int *resindex, int index[])
{
int i, j;
const char *trxfnm, *tpsfnm, *ndxfnm, *distfnm, *numfnm, *atmfnm, *oxfnm, *resfnm;
char **grpname;
int *gnx;
- atom_id **index, *residues = NULL;
+ int **index, *residues = NULL;
t_filenm fnm[] = {
{ efTRX, "-f", NULL, ffREAD },
{ efTPS, NULL, NULL, ffOPTRD },
FILE *fp = NULL;
int i, isize, is_lsq, nat1, nat2;
t_trxstatus *status;
- atom_id *index, *index_lsq, *index_all, *dummy;
+ int *index, *index_lsq, *index_all, *dummy;
rvec *x1, *x2, *xx;
matrix box;
real rms1, rms2, fac, *mass;
point. */
} t_corr;
-typedef real t_calc_func (t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[],
+typedef real t_calc_func (t_corr *curr, int nx, int index[], int nx0, rvec xc[],
rvec dcom, gmx_bool bTen, matrix mat);
static real thistime(t_corr *curr)
}
/* called from corr_loop, to do the main calculations */
-static void calc_corr(t_corr *curr, int nr, int nx, atom_id index[], rvec xc[],
+static void calc_corr(t_corr *curr, int nr, int nx, int index[], rvec xc[],
gmx_bool bRmCOMM, rvec com, t_calc_func *calc1, gmx_bool bTen)
{
int nx0;
}
/* the non-mass-weighted mean-squared displacement calcuation */
-static real calc1_norm(t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[],
+static real calc1_norm(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
rvec dcom, gmx_bool bTen, matrix mat)
{
int i, ix, m, m2;
}
/* the normal, mass-weighted mean-squared displacement calcuation */
-static real calc1_mw(t_corr *curr, int nx, atom_id index[], int nx0, rvec xc[],
+static real calc1_mw(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
rvec dcom, gmx_bool bTen, matrix mat)
{
int i;
xcur = the current coordinates
xprev = the previous coordinates
box = the box matrix */
-static void prep_data(gmx_bool bMol, int gnx, atom_id index[],
+static void prep_data(gmx_bool bMol, int gnx, int index[],
rvec xcur[], rvec xprev[], matrix box)
{
int i, m, ind;
box = the box matrix
atoms = atom data (for mass)
com(output) = center of mass */
-static void calc_com(gmx_bool bMol, int gnx, atom_id index[],
+static void calc_com(gmx_bool bMol, int gnx, int index[],
rvec xcur[], rvec xprev[], matrix box, t_atoms *atoms,
rvec com)
{
}
-static real calc1_mol(t_corr *curr, int nx, atom_id gmx_unused index[], int nx0, rvec xc[],
+static real calc1_mol(t_corr *curr, int nx, int gmx_unused index[], int nx0, rvec xc[],
rvec dcom, gmx_bool bTen, matrix mat)
{
int i;
* read_next_x
*/
int corr_loop(t_corr *curr, const char *fn, t_topology *top, int ePBC,
- gmx_bool bMol, int gnx[], atom_id *index[],
- t_calc_func *calc1, gmx_bool bTen, int *gnx_com, atom_id *index_com[],
+ 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)
{
{
t_corr *msd;
int *gnx; /* the selected groups' sizes */
- atom_id **index; /* selected groups' indices */
+ int **index; /* selected groups' indices */
char **grpname;
int i, i0, i1, j, N, nat_trx;
real *DD, *SigmaD, a, a2, b, r, chi2;
rvec *x;
matrix box;
int *gnx_com = NULL; /* the COM removal group size */
- atom_id **index_com = NULL; /* the COM removal group atom indices */
+ int **index_com = NULL; /* the COM removal group atom indices */
char **grpname_com = NULL; /* the COM removal group name */
snew(gnx, nrgrp);
const char *indexfile;
int i, j, d, s, v;
int nout, *iout, noutvec, *outvec;
- atom_id *index;
+ int *index;
real rfac, rhalf, jr;
gmx_output_env_t *oenv;
gmx_rng_t rng;
static void find_nearest_neighbours(int ePBC,
int natoms, matrix box,
- rvec x[], int maxidx, atom_id index[],
+ rvec x[], int maxidx, int index[],
real *sgmean, real *skmean,
int nslice, int slice_dim,
real sgslice[], real skslice[],
rvec *xtop, *x;
matrix box;
real sg, sk;
- atom_id **index;
+ int **index;
char **grpname;
int i, *isize, ng, nframes;
real *sg_slice, *sg_slice_tot, *sk_slice, *sk_slice_tot;
/* Print name of first atom in all groups in index file */
-static void print_types(atom_id index[], atom_id a[], int ngrps,
+static void print_types(int index[], int a[], int ngrps,
char *groups[], t_topology *top)
{
int i;
}
}
-void calc_order(const char *fn, atom_id *index, atom_id *a, rvec **order,
+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 permolecule, gmx_bool radial, gmx_bool distcalc, const char *radfn,
gmx_bool use_unitvector = FALSE; /* use a specified unit vector instead of axis to specify unit normal*/
rvec direction, com, dref, dvec;
int comsize, distsize;
- atom_id *comidx = NULL, *distidx = NULL;
+ int *comidx = NULL, *distidx = NULL;
char *grpname = NULL;
t_pbc pbc;
real arcdist, tmpdist;
xvgrclose(slOrd);
}
-void write_bfactors(t_filenm *fnm, int nfile, atom_id *index, atom_id *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, 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*/
axis = 0; /* normal axis */
t_topology *top; /* topology */
int ePBC;
- atom_id *index, /* indices for a */
+ int *index, /* indices for a */
*a; /* atom numbers in each group */
t_blocka *block; /* data from index file */
t_filenm fnm[] = { /* files for g_order */
return;
}
-void calc_potential(const char *fn, atom_id **index, int gnx[],
+void calc_potential(const char *fn, int **index, int gnx[],
double ***slPotential, double ***slCharge,
double ***slField, int *nslices,
t_topology *top, int ePBC,
int *ngx; /* sizes of groups */
t_topology *top; /* topology */
int ePBC;
- atom_id **index; /* indices for all groups */
+ int **index; /* indices for all groups */
t_filenm fnm[] = { /* files for g_order */
{ efTRX, "-f", NULL, ffREAD }, /* trajectory file */
{ efNDX, NULL, NULL, ffREAD }, /* index file */
void
calc_principal_axes(t_topology * top,
rvec * x,
- atom_id * index,
+ int * index,
int n,
matrix axes,
rvec inertia)
int natoms;
char *grpname;
int i, gnx;
- atom_id *index;
+ int *index;
rvec moi;
FILE * axis1;
FILE * axis2;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static void norm_princ(t_atoms *atoms, int isize, atom_id *index, int natoms,
+static void norm_princ(t_atoms *atoms, int isize, int *index, int natoms,
rvec *x)
{
int i, m;
gmx_bool bA1, bA2, bPrev, bTop, *bInMat = NULL;
int ifit, *irms, ibond = 0, *ind_bond1 = NULL, *ind_bond2 = NULL, n_ind_m =
0;
- atom_id *ind_fit, **ind_rms, *ind_m = NULL, *rev_ind_m = NULL, *ind_rms_m =
+ int *ind_fit, **ind_rms, *ind_m = NULL, *rev_ind_m = NULL, *ind_rms_m =
NULL;
char *gn_fit, **gn_rms;
t_rgb rlo, rhi;
#include "gromacs/utility/smalloc.h"
-static void calc_dist(int nind, atom_id index[], rvec x[], int ePBC, matrix box,
+static void calc_dist(int nind, int index[], rvec x[], int ePBC, matrix box,
real **d)
{
int i, j;
}
}
-static void calc_dist_tot(int nind, atom_id index[], rvec x[],
+static void calc_dist_tot(int nind, int index[], rvec x[],
int ePBC, matrix box,
real **d, real **dtot, real **dtot2,
gmx_bool bNMR, real **dtot1_3, real **dtot1_6)
}
static int analyze_noe_equivalent(const char *eq_fn,
- t_atoms *atoms, int isize, atom_id *index,
+ t_atoms *atoms, int isize, int *index,
gmx_bool bSumH,
- atom_id *noe_index, t_noe_gr *noe_gr)
+ int *noe_index, t_noe_gr *noe_gr)
{
int i, j, anmil, anmjl, rnri, rnrj, gi, groupnr, neq;
char *anmi, *anmj, **nnm;
return buf;
}
-static void calc_noe(int isize, atom_id *noe_index,
+static void calc_noe(int isize, int *noe_index,
real **dtot1_3, real **dtot1_6, int gnr, t_noe **noe)
{
int i, j, gi, gj;
t_trxstatus *status;
int isize, gnr = 0;
- atom_id *index, *noe_index;
+ int *index, *noe_index;
char *grpname;
real **d_r, **d, **dtot, **dtot2, **mean, **rms, **rmsc, *resnr;
real **dtot1_3 = NULL, **dtot1_6 = NULL;
}
static void average_residues(double f[], double **U, int uind,
- int isize, atom_id index[], real w_rls[],
+ int isize, int index[], real w_rls[],
t_atoms *atoms)
{
int i, j, start;
int resind;
gmx_bool bReadPDB;
- atom_id *index;
+ int *index;
int isize;
char *grpnames;
real bfac, pdb_bfac, *Uaver;
double **U, *xav;
- atom_id aid;
+ int aid;
rvec *rmsd_x = NULL;
double *rmsf, invcount, totmass;
int d;
t_trxstatus *status;
int isize;
- atom_id *index;
+ int *index;
char *grpname;
rvec *x, *x_s;
matrix box;
char *grpname;
int gnx;
gmx_rmpbc_t gpbc = NULL;
- atom_id *index;
+ int *index;
gmx_output_env_t *oenv;
real *w_rls;
const char *leg[] = { "xx", "xy", "xz", "yx", "yy", "yz", "zx", "zy", "zz" };
int natoms;
real t;
char **grpname = NULL;
- atom_id *index = NULL;
+ int *index = NULL;
int isize;
int i;
char *hdr = NULL;
#include "gromacs/utility/smalloc.h"
static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
- atom_id index[], rvec xref, gmx_bool bPBC)
+ int index[], rvec xref, gmx_bool bPBC)
{
const real tol = 1e-4;
gmx_bool bChanged;
real *histi1, *histi2, invbw, invrbw;
double sum1, sum2;
int *isize, nrefgrp, nrefat;
- atom_id **index;
+ int **index;
char **grpname;
real inp, outp, nav, normfac, rmin2, rmax2, rcut, rcut2, r2, r;
real c1, c2;
t_atoms *atoms;
int natoms;
char *grpnm, *grpnmp;
- atom_id *index, *indexp;
+ int *index, *indexp;
int i, nidx, nidxp;
int v;
int j, k;
#include "gromacs/utility/smalloc.h"
static void calc_com_pbc(int nrefat, t_topology *top, rvec x[], t_pbc *pbc,
- atom_id index[], rvec xref, int ePBC)
+ int index[], rvec xref, int ePBC)
{
const real tol = 1e-4;
gmx_bool bChanged;
FILE *fp;
int *isize, nrefgrp;
- atom_id **index, *molindex;
+ int **index, *molindex;
char **grpname;
real rmin2, rmax2, rcut, rcut2, rdx2 = 0, rtry2, qav, q, dip2, invbw;
int nbin, i, m, mol, a0, a1, a, d;
matrix box;
gmx_bool bTop;
int gnx;
- atom_id *index, *atndx = NULL, at;
+ int *index, *atndx = NULL, at;
char *grpname;
char title[256];
real t0, t1, dt, m, mtot, sysmass, rho, sx, cx;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static void low_print_data(FILE *fp, real time, rvec x[], int n, atom_id *index,
+static void low_print_data(FILE *fp, real time, rvec x[], int n, int *index,
gmx_bool bDim[], const char *sffmt)
{
int i, ii, d;
}
static void average_data(rvec x[], rvec xav[], real *mass,
- int ngrps, int isize[], atom_id **index)
+ int ngrps, int isize[], int **index)
{
int g, i, ind, d;
real m;
}
static void print_data(FILE *fp, real time, rvec x[], real *mass, gmx_bool bCom,
- int ngrps, int isize[], atom_id **index, gmx_bool bDim[],
+ int ngrps, int isize[], int **index, gmx_bool bDim[],
const char *sffmt)
{
static rvec *xav = NULL;
}
static void write_trx_x(t_trxstatus *status, t_trxframe *fr, real *mass, gmx_bool bCom,
- int ngrps, int isize[], atom_id **index)
+ int ngrps, int isize[], int **index)
{
static rvec *xav = NULL;
static t_atoms *atoms = NULL;
}
}
-static void make_legend(FILE *fp, int ngrps, int isize, atom_id index[],
+static void make_legend(FILE *fp, int ngrps, int isize, int index[],
char **name, gmx_bool bCom, gmx_bool bMol, gmx_bool bDim[],
const gmx_output_env_t *oenv)
{
sfree(leg);
}
-static real ekrot(rvec x[], rvec v[], real mass[], int isize, atom_id index[])
+static real ekrot(rvec x[], rvec v[], real mass[], int isize, int index[])
{
static real **TCM = NULL, **L;
double tm, m0, lxx, lxy, lxz, lyy, lyz, lzz, ekrot;
return ekrot;
}
-static real ektrans(rvec v[], real mass[], int isize, atom_id index[])
+static real ektrans(rvec v[], real mass[], int isize, int index[])
{
dvec mvcom;
double mtot;
return dnorm2(mvcom)/(mtot*2);
}
-static real temp(rvec v[], real mass[], int isize, atom_id index[])
+static real temp(rvec v[], real mass[], int isize, int index[])
{
double ekin2;
int i, j;
static void write_pdb_bfac(const char *fname, const char *xname,
const char *title, t_atoms *atoms, int ePBC, matrix box,
- int isize, atom_id *index, int nfr_x, rvec *x,
+ int isize, int *index, int nfr_x, rvec *x,
int nfr_v, rvec *sum,
gmx_bool bDim[], real scale_factor,
const gmx_output_env_t *oenv)
{
FILE *fp;
real max, len2, scale;
- atom_id maxi;
+ int maxi;
int i, m, onedim;
if ((nfr_x == 0) || (nfr_v == 0))
}
}
-static void update_histo(int gnx, atom_id index[], rvec v[],
+static void update_histo(int gnx, int index[], rvec v[],
int *nhisto, int **histo, real binwidth)
{
int i, m, in, nnn;
int nr_xfr, nr_vfr, nr_ffr;
char **grpname;
int *isize0, *isize;
- atom_id **index0, **index;
- atom_id *atndx;
+ int **index0, **index;
+ int *atndx;
t_block *mols;
gmx_bool bTop, bOX, bOXT, bOV, bOF, bOB, bOT, bEKT, bEKR, bCV, bCF;
gmx_bool bDim[4], bDum[4], bVD;
#define FLAGS (TRX_READ_X | TRX_READ_V | TRX_READ_F)
static void scan_trj_files(char **fnms, int nfiles, real *readtime,
- real *timestep, atom_id imax,
+ real *timestep, int imax,
const gmx_output_env_t *oenv)
{
/* Check start time of all files */
}
else
{
- if (imax == NO_ATID)
+ if (imax == -1)
{
if (natoms != fr.natoms)
{
static void do_demux(int nset, char *fnms[], char *fnms_out[], int nval,
real **value, real *time, real dt_remd, int isize,
- atom_id index[], real dt, const gmx_output_env_t *oenv)
+ int index[], real dt, const gmx_output_env_t *oenv)
{
int i, j, k, natoms, nnn;
t_trxstatus **fp_in, **fp_out;
gmx_bool lastTimeSet = FALSE;
real last_frame_time, searchtime;
int isize = 0, j;
- atom_id *index = NULL, imax;
+ int *index = NULL, imax;
char *grpname;
real **val = NULL, *t = NULL, dt_remd;
int n, nset, ftpout = -1, prevEndStep = 0, filetype;
bDeMux = ftp2bSet(efXVG, NFILE, fnm);
bSort = bSort && !bDeMux;
- imax = NO_ATID;
+ imax = -1;
if (bIndex)
{
printf("Select group for output\n");
static void calc_pbc_cluster(int ecenter, int nrefat, t_topology *top, int ePBC,
- rvec x[], atom_id index[], matrix box)
+ rvec x[], int index[], matrix box)
{
int m, i, j, j0, j1, jj, ai, aj;
int imin, jmin;
real fac, min_dist2;
rvec dx, xtest, box_center;
int nmol, imol_center;
- atom_id *molind;
+ int *molind;
gmx_bool *bMol, *bTmp;
rvec *m_com, *m_shift;
t_pbc pbc;
int natoms, t_atom atom[],
int ePBC, matrix box, rvec x[])
{
- atom_id i, j;
+ int i, j;
int d;
rvec com, new_com, shift, box_center;
real m;
int natoms, t_atom atom[],
int ePBC, matrix box, rvec x[])
{
- atom_id i, j, res_start, res_end;
+ int i, j, res_start, res_end;
int d, presnr;
real m;
double mtot;
}
}
-static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, atom_id ci[])
+static void center_x(int ecenter, rvec x[], matrix box, int n, int nc, int ci[])
{
int i, m, ai;
rvec cmin, cmax, box_center, dx;
int ePBC = -1;
t_atoms *atoms = NULL, useatoms;
matrix top_box;
- atom_id *index, *cindex;
+ int *index, *cindex;
char *grpnm;
int *frindex, nrfri;
char *frname;
int ifit, my_clust = -1;
- atom_id *ind_fit;
+ int *ind_fit;
char *gn_fit;
t_cluster_ndx *clust = NULL;
t_trxstatus **clust_status = NULL;
if (opt2bSet("-fr", NFILE, fnm))
{
printf("Select groups of frame number indices:\n");
- rd_index(opt2fn("-fr", NFILE, fnm), 1, &nrfri, (atom_id **)&frindex, &frname);
+ rd_index(opt2fn("-fr", NFILE, fnm), 1, &nrfri, (int **)&frindex, &frname);
if (debug)
{
for (i = 0; i < nrfri; i++)
my_clust = clust->inv_clust[frame];
}
if ((my_clust < 0) || (my_clust >= clust->clust->nr) ||
- (my_clust == NO_ATID))
+ (my_clust == -1))
{
my_clust = -1;
}
#include "gromacs/utility/smalloc.h"
typedef struct {
- atom_id i;
+ int i;
real d2;
} t_order;
int natoms, nwat, ncut;
char **grpname;
int i, j, d, *isize, isize_ref = 0, isize_sol;
- atom_id sa, sr, *swi, **index, *ind_ref = NULL, *ind_sol;
+ int sa, sr, *swi, **index, *ind_ref = NULL, *ind_sol;
gmx_output_env_t *oenv;
t_filenm fnm[] = {
{ efTRX, "-f", NULL, ffREAD },
rvec *xtop, *x, **sx;
int isize, nalloc, nallocn;
t_trxstatus *status;
- atom_id *index;
+ int *index;
char *grpname;
int nfr, f, ff, i, m, mat_nx = 0, nbin = 0, bin, mbin, fbin;
real *time, t, invbin = 0, rmax2 = 0, rint2 = 0, d2;
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
-static void index_atom2mol(int *n, atom_id *index, t_block *mols)
+static void index_atom2mol(int *n, int *index, t_block *mols)
{
int nat, i, nmol, mol, j;
matrix box;
gmx_bool bTPS = FALSE, bTop = FALSE;
int gnx;
- atom_id *index;
+ int *index;
char *grpname;
/* t0, t1 are the beginning and end time respectively.
* dt is the time step, mass is temp variable for atomic mass.
gmx_bool bAngles, gmx_bool bSaveAll, gmx_bool bRb, gmx_bool bPBC,
int maxangstat, int angstat[],
int *nframes, real **time,
- int isize, atom_id index[],
+ int isize, int index[],
real **trans_frac,
real **aver_angle,
real *dih[],
return ell;
}
-real ahx_len(int gnx, atom_id index[], rvec x[])
+real ahx_len(int gnx, int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
rvec dx;
return norm(dx);
}
-real radius(FILE *fp, int nca, atom_id ca_index[], rvec x[])
+real radius(FILE *fp, int nca, int ca_index[], rvec x[])
/* Assume we have all the backbone */
{
real dl2, dlt;
return dphi;
}
-real twist(int nca, atom_id caindex[], rvec x[])
+real twist(int nca, int caindex[], rvec x[])
{
real pt, dphi;
int i, a0, a1;
return (pt/(nca-1));
}
-real ca_phi(int gnx, atom_id index[], rvec x[])
+real ca_phi(int gnx, int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
real phi, phitot;
return (phitot/(gnx-4.0));
}
-real dip(int nbb, atom_id bbind[], rvec x[], t_atom atom[])
+real dip(int nbb, int bbind[], rvec x[], t_atom atom[])
{
int i, m, ai;
rvec dipje;
return norm(dipje);
}
-real rise(int gnx, atom_id index[], rvec x[])
+real rise(int gnx, int index[], rvec x[])
/* Assume we have a list of Calpha atoms only! */
{
real z, z0, ztot;
}
t_bb *mkbbind(const char *fn, int *nres, int *nbb, int res0,
- int *nall, atom_id **index,
+ int *nall, int **index,
char ***atomname, t_atom atom[],
t_resinfo *resinfo)
{
*hend = h1sav;
}
-void do_start_end(int nres, t_bb bb[], int *nbb, atom_id bbindex[],
- int *nca, atom_id caindex[],
+void do_start_end(int nres, t_bb bb[], int *nbb, int bbindex[],
+ int *nca, int caindex[],
gmx_bool bRange, int rStart, int rEnd)
{
int i, j, hstart = 0, hend = 0;
efhAHX, efhNR
};
-extern real ahx_len(int gnx, atom_id index[], rvec x[]);
+extern real ahx_len(int gnx, int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
extern real ellipticity(int nres, t_bb bb[]);
-extern real radius(FILE *fp, int nca, atom_id ca_index[], rvec x[]);
+extern real radius(FILE *fp, int nca, int ca_index[], rvec x[]);
/* Assume we have calphas */
-extern real twist(int nca, atom_id caindex[], rvec x[]);
+extern real twist(int nca, int caindex[], rvec x[]);
/* Calculate the twist of the helix */
extern real pprms(FILE *fp, int nbb, t_bb bb[]);
* and the distance per residue
*/
-extern real ca_phi(int gnx, atom_id index[], rvec x[]);
+extern real ca_phi(int gnx, int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
-extern real dip(int nbb, atom_id bbind[], rvec x[], t_atom atom[]);
+extern real dip(int nbb, int bbind[], rvec x[], t_atom atom[]);
-extern real rise(int gnx, atom_id index[], rvec x[]);
+extern real rise(int gnx, int index[], rvec x[]);
/* Assume we have a list of Calpha atoms only! */
extern void av_hblen(FILE *fp3, FILE *fp3a,
real t, int nres, t_bb bb[]);
extern t_bb *mkbbind(const char *fn, int *nres, int *nbb, int res0,
- int *nall, atom_id **index,
+ int *nall, int **index,
char ***atomname, t_atom atom[],
t_resinfo *resinfo);
extern void do_start_end(int nres, t_bb bb[], int *nbb,
- atom_id bbindex[], int *nca, atom_id caindex[],
+ int bbindex[], int *nca, int caindex[],
gmx_bool bRange, int rStart, int rEnd);
extern void calc_hxprops(int nres, t_bb bb[], rvec x[]);
} t_phipsi;
typedef struct {
- atom_id ai[4];
+ int ai[4];
int mult;
real phi0;
real ang;
#include "gromacs/fileio/strdb.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
gmx_sans_t *gsans,
rvec *x,
matrix box,
- atom_id *index,
+ int *index,
int isize,
double binwidth,
gmx_bool bMC,
#define GMX_GMXANA_NSFACTOR_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
struct t_topology;
gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans,
rvec *x,
matrix box,
- atom_id *index,
+ int *index,
int isize,
double binwidth,
gmx_bool bMC,
}
#endif
-void principal_comp(int n, atom_id index[], t_atom atom[], rvec x[],
+void principal_comp(int n, int index[], t_atom atom[], rvec x[],
matrix trans, rvec d)
{
int i, j, ai, m, nrot;
sfree(ev);
}
-void rotate_atoms(int gnx, atom_id *index, rvec x[], matrix trans)
+void rotate_atoms(int gnx, int *index, rvec x[], matrix trans)
{
real xt, yt, zt;
int i, ii;
}
}
-real calc_xcm(rvec x[], int gnx, atom_id *index, t_atom *atom, rvec xcm,
+real calc_xcm(rvec x[], int gnx, int *index, t_atom *atom, rvec xcm,
gmx_bool bQ)
{
int i, ii, m;
return tm;
}
-real sub_xcm(rvec x[], int gnx, atom_id *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, int *index, t_atom atom[], rvec xcm,
gmx_bool bQ)
{
int i, ii;
return tm;
}
-void add_xcm(rvec x[], int gnx, atom_id *index, rvec xcm)
+void add_xcm(rvec x[], int gnx, int *index, rvec xcm)
{
int i, ii;
}
}
-void orient_princ(t_atoms *atoms, int isize, atom_id *index,
+void orient_princ(t_atoms *atoms, int isize, int *index,
int natoms, rvec x[], rvec *v, rvec d)
{
int i, m;
extern "C" {
#endif
-void rotate_atoms(int gnx, atom_id index[], rvec x[], matrix trans);
+void rotate_atoms(int gnx, int index[], rvec x[], matrix trans);
/* Rotate all atoms in index using matrix trans */
-void principal_comp(int n, atom_id index[], t_atom atom[], rvec x[],
+void principal_comp(int n, 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, atom_id *index,
+void orient_princ(t_atoms *atoms, int isize, 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, atom_id *index, t_atom *atom, rvec xcm,
+real calc_xcm(rvec x[], int gnx, int *index, 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, atom_id *index, t_atom atom[], rvec xcm,
+real sub_xcm(rvec x[], int gnx, int *index, 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
* Returns the total mass
*/
-void add_xcm(rvec x[], int gnx, atom_id *index, rvec xcm);
+void add_xcm(rvec x[], int gnx, int *index, rvec xcm);
/* Increment all atoms in index with xcm */
#ifdef __cplusplus
#include "gromacs/legacyheaders/names.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/cstringutil.h"
}
-extern void rearrange_atoms (reduced_atom_t * positions, t_trxframe *fr, atom_id * index,
+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)
/* given the group's index, return the (continuous) array of atoms */
{
int i, *isize, flags = TRX_READ_X, **index_atp;
t_trxstatus *status;
char **grpname;
- atom_id **index;
+ int **index;
t_topology top;
int ePBC;
t_trxframe fr;
#include "gromacs/math/gmxcomplex.h"
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
struct gmx_output_env_t;
int return_atom_type (const char *name, gmx_structurefactors_t *gsf);
-void rearrange_atoms (reduced_atom_t * positions, struct t_trxframe *fr, atom_id * index,
+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 do_scattering_intensity (const char* fnTPS, const char* fnNDX,
int icg, k, k0, k1, d;
rvec cg;
real nrcg, inv_ncg;
- atom_id *cgindex;
+ int *cgindex;
#ifdef DEBUG
fprintf(fplog, "Calculating centre of geometry for charge groups %d to %d\n",
int npbcdim, icg, k, k0, k1, d, e;
rvec cg;
real nrcg, inv_ncg;
- atom_id *cgindex;
+ int *cgindex;
gmx_bool bTric;
if (ePBC == epbcNONE)
}
}
-static void low_rotate_conf_indexed(int nindex, atom_id *index, rvec *x, real alfa, real beta, real gamma)
+static void low_rotate_conf_indexed(int nindex, int *index, rvec *x, real alfa, real beta, real gamma)
{
int i;
rvec x_old;
const rvec x[], const t_pbc *pbc,
t_fcdata *fcd, history_t *hist)
{
- atom_id ai, aj;
+ int ai, aj;
int fa, res, pair;
int type, npair, np;
rvec dx;
const real sixth = 1.0/6.0;
const real seven_three = 7.0/3.0;
- atom_id ai, aj;
+ int ai, aj;
int fa, res, npair, p, pair, ki = CENTRAL, m;
int type;
rvec dx;
const t_mdatoms gmx_unused *md, t_fcdata *fcd,
int gmx_unused *global_atom_index)
{
- atom_id ai, aj;
+ int ai, aj;
int fa, d, i, type, ex, power, ki = CENTRAL;
ivec dt;
real r2, invr, invr2, fc, smooth_fc, dev, devins, pfac;
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-static void clear_atom_list(int i0, atom_id a[])
+static void clear_atom_list(int i0, int a[])
{
int i;
}
static void append_interaction(t_ilist *ilist,
- int type, int nral, atom_id a[MAXATOMLIST])
+ int type, int nral, int a[MAXATOMLIST])
{
int i, where1;
}
}
-static void set_p(t_param *p, atom_id ai[4], real *c, char *s)
+static void set_p(t_param *p, int ai[4], real *c, char *s)
{
int j;
return (*(int *)a) - (*(int *)b);
}
-static int atom_id_comp(const void *a, const void *b)
-{
- return (*(atom_id *)a) - (*(atom_id *)b);
-}
-
-static int eq_imp(atom_id a1[], atom_id a2[])
+static int eq_imp(int a1[], int a2[])
{
int b1[4], b2[4];
int j;
}
}
-static int n_hydro(atom_id a[], char ***atomname)
+static int n_hydro(int a[], char ***atomname)
{
int i, nh = 0;
char c0, c1, *aname;
{
t_rbondeds *impropers;
int nimproper, i, j, k, start, ninc, nalloc;
- atom_id ai[MAXATOMLIST];
+ int ai[MAXATOMLIST];
gmx_bool bStop;
ninc = 500;
ai[k] = search_atom(impropers->b[j].a[k], start,
atoms,
"improper", bAllowMissing);
- if (ai[k] == NO_ATID)
+ if (ai[k] == -1)
{
bStop = TRUE;
}
}
static void get_atomnames_min(int n, char **anm,
- int resind, t_atoms *atoms, atom_id *a)
+ int resind, t_atoms *atoms, int *a)
{
int m;
gmx_bool bAllowMissing)
{
int r;
- atom_id a, astart, i1, i2, itmp;
+ int a, astart, i1, i2, itmp;
t_rbondeds *hbexcl;
int e;
char *anm;
anm = hbexcl->b[e].a[1];
i2 = search_atom(anm, astart, atoms,
"exclusion", bAllowMissing);
- if (i1 != NO_ATID && i2 != NO_ATID)
+ if (i1 != -1 && i2 != -1)
{
if (i1 > i2)
{
{
if (excls[a].nr > 1)
{
- qsort(excls[a].e, excls[a].nr, (size_t)sizeof(atom_id), atom_id_comp);
+ qsort(excls[a].e, excls[a].nr, (size_t)sizeof(int), int_comp);
}
}
}
res++;
}
ang[nang].a[k] = search_res_atom(p, res, atoms, "angle", TRUE);
- bFound = (ang[nang].a[k] != NO_ATID);
+ bFound = (ang[nang].a[k] != -1);
}
ang[nang].c0() = NOTSET;
ang[nang].c1() = NOTSET;
res++;
}
dih[ndih].a[k] = search_res_atom(p, res, atoms, "dihedral", TRUE);
- bFound = (dih[ndih].a[k] != NO_ATID);
+ bFound = (dih[ndih].a[k] != -1);
}
for (m = 0; m < MAXFORCEPARAM; m++)
{
*atoms2->atomname[a2] = gmx_strdup(*atoms1->atomname[a1]);
}
-static atom_id pdbasearch_atom(const char *name, int resind, t_atoms *pdba,
- const char *searchtype, gmx_bool bAllowMissing)
+static int pdbasearch_atom(const char *name, int resind, t_atoms *pdba,
+ const char *searchtype, gmx_bool bAllowMissing)
{
int i;
#ifndef GMX_GMXPREPROCESS_GROMPP_IMPL_H
#define GMX_GMXPREPROCESS_GROMPP_IMPL_H
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/idef.h"
*/
typedef struct {
- atom_id a[MAXATOMLIST]; /* The atom list (eg. bonds: particle */
+ int a[MAXATOMLIST]; /* The atom list (eg. bonds: particle */
/* i = a[0] (ai), j = a[1] (aj)) */
real c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0]) */
char s[MAXSLEN]; /* A string (instead of parameters), *
* read from the .rtp file in pdb2gmx */
- atom_id &ai() { return a[0]; }
- atom_id &aj() { return a[1]; }
- atom_id &ak() { return a[2]; }
- atom_id &al() { return a[3]; }
- atom_id &am() { return a[4]; }
+ int &ai() { return a[0]; }
+ int &aj() { return a[1]; }
+ int &ak() { return a[2]; }
+ int &al() { return a[3]; }
+ int &am() { return a[4]; }
real &c0() { return c[0]; }
real &c1() { return c[1]; }
} t_params;
typedef struct {
- int nr; /* The number of exclusions */
- atom_id *e; /* The excluded atoms */
+ int nr; /* The number of exclusions */
+ int *e; /* The excluded atoms */
} t_excls;
typedef struct {
gmx_bool bAlreadyPresent;
gmx_bool bXSet;
rvec newx; /* calculated new position */
- atom_id newi; /* new atom index number (after additions) */
+ int newi; /* new atom index number (after additions) */
char* &ai() { return a[0]; }
char* &aj() { return a[1]; }
char* &ak() { return a[2]; }
int i, j;
t_restp *rptr;
t_pdbindex *pdbi;
- atom_id *a;
+ int *a;
char *atomnm;
pdba = *pdbaptr;
int nssbonds, t_ssbond *ssbonds, gmx_bool bAllowMissing)
{
int i, ri, rj;
- atom_id ai, aj;
+ int ai, aj;
for (i = 0; (i < nssbonds); i++)
{
"special bond", bAllowMissing);
aj = search_res_atom(ssbonds[i].a2, rj, atoms,
"special bond", bAllowMissing);
- if ((ai == NO_ATID) || (aj == NO_ATID))
+ if ((ai == -1) || (aj == -1))
{
gmx_fatal(FARGS, "Trying to make impossible special bond (%s-%s)!",
ssbonds[i].a1, ssbonds[i].a2);
real long_bond_dist, real short_bond_dist)
{
int resind, i, j, k;
- atom_id ai, aj;
+ int ai, aj;
real dist2, long_bond_dist2, short_bond_dist2;
const char *ptr;
ptr, TRUE);
aj = search_atom(hb[resind].rb[ebtsBONDS].b[j].a[1], i, atoms,
ptr, TRUE);
- if (ai != NO_ATID && aj != NO_ATID)
+ if (ai != -1 && aj != -1)
{
dist2 = distance2(x[ai], x[aj]);
if (dist2 > long_bond_dist2)
static void clean_bonds(t_params *ps)
{
int i, j;
- atom_id a;
+ int a;
if (ps->nr > 0)
{
t_resinfo *resinfo = atoms->resinfo;
int nres = atoms->nres;
gmx_bool bAddCMAP;
- atom_id cmap_atomid[NUM_CMAP_ATOMS];
+ int cmap_atomid[NUM_CMAP_ATOMS];
int cmap_chainnum = -1, this_residue_index;
if (debug)
cmap_atomid[k] = search_atom(pname,
i, atoms, ptr, TRUE);
- bAddCMAP = bAddCMAP && (cmap_atomid[k] != NO_ATID);
+ bAddCMAP = bAddCMAP && (cmap_atomid[k] != -1);
if (!bAddCMAP)
{
/* This break is necessary, because cmap_atomid[k]
- * == NO_ATID cannot be safely used as an index
+ * == -1 cannot be safely used as an index
* into the atom array. */
break;
}
}
}
-atom_id search_atom(const char *type, int start,
- t_atoms *atoms,
- const char *bondtype, gmx_bool bAllowMissing)
+int search_atom(const char *type, int start,
+ t_atoms *atoms,
+ const char *bondtype, gmx_bool bAllowMissing)
{
int i, resind = -1;
gmx_bool bPrevious, bNext;
{
if (anm[i] && gmx_strcasecmp(type, *(anm[i])) == 0)
{
- return (atom_id) i;
+ return (int) i;
}
}
if (!(bNext && at[start].resind == at[natoms-1].resind))
{
if (gmx_strcasecmp(type, *(anm[i])) == 0)
{
- return (atom_id) i;
+ return (int) i;
}
}
if (start > 0)
atom_not_found(FARGS, type, at[start].resind, *atoms->resinfo[resind].name, bondtype, bAllowMissing);
}
}
- return NO_ATID;
+ return -1;
}
-atom_id
+int
search_res_atom(const char *type, int resind,
t_atoms *atoms,
const char *bondtype, gmx_bool bAllowMissing)
}
}
- return NO_ATID;
+ return -1;
}
#ifndef GMX_GMXPREPROCESS_PGUTIL_H
#define GMX_GMXPREPROCESS_PGUTIL_H
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
* when bondtype="check" no error/warning is issued.
* When bAllowMissing=FALSE an fatal error is issued, otherwise a warning.
*/
-atom_id search_atom(const char *type, int start,
- t_atoms *atoms,
- const char *bondtype, gmx_bool bAllowMissing);
+int search_atom(const char *type, int start,
+ t_atoms *atoms,
+ const char *bondtype, gmx_bool bAllowMissing);
/* Similar to search_atom, but this routine searches for the specified
* atom in residue resind.
*/
-atom_id
+int
search_res_atom(const char *type, int resind,
t_atoms *atoms,
const char *bondtype, gmx_bool bAllowMissing);
*/
int
i, j, l, k = 0, jmax, qm_max = 0, qm_nr = 0, nratoms = 0, link_nr = 0, link_max = 0;
- atom_id
+ int
*qm_arr = NULL, *link_arr = NULL, a1, a2, a3, a4, ftype = 0;
t_blocka
qmexcl;
int i, f, n, ftype, nrfp;
double c[4], dum;
real cr[4];
- atom_id ai, aj;
+ int ai, aj;
t_nbparam *nbp;
gmx_bool bId;
char errbuf[256];
void b_to_b2(t_blocka *b, t_block2 *b2)
{
int i;
- atom_id j, a;
+ int j, a;
for (i = 0; (i < b->nr); i++)
{
void b2_to_b(t_block2 *b2, t_blocka *b)
{
int i, nra;
- atom_id j;
+ int j;
nra = 0;
for (i = 0; (i < b2->nr); i++)
static int icomp(const void *v1, const void *v2)
{
- return (*((atom_id *) v1))-(*((atom_id *) v2));
+ return (*((int *) v1))-(*((int *) v2));
}
void merge_excl(t_blocka *excl, t_block2 *b2)
{
int i, k;
- atom_id j;
+ int j;
int nra;
if (!b2->nr)
typedef struct {
int nr; /* The number of entries in the list */
int nra2; /* The total number of entries in a */
- atom_id *nra; /* The number of entries in each a array (dim nr) */
- atom_id **a; /* The atom numbers (dim nr) the length of each element */
+ int *nra; /* The number of entries in each a array (dim nr) */
+ int **a; /* The atom numbers (dim nr) the length of each element */
/* i is nra[i] */
} t_block2;
}
}
-static int count_hydrogens (char ***atomname, int nra, atom_id a[])
+static int count_hydrogens (char ***atomname, int nra, int a[])
{
int i, nh;
void print_excl(FILE *out, int natoms, t_excls excls[])
{
- atom_id i;
+ int i;
gmx_bool have_excl;
int j;
int cftype, int vsite_type[])
{
int i, k, n;
- atom_id atom;
+ int atom;
t_params *ps;
n = 0;
{
int ftype, i, j, k, m, n, nvsite, nOut, kept_i;
int nconverted, nremoved;
- atom_id atom, oatom, at1, at2;
+ int atom, oatom, at1, at2;
gmx_bool bKeep, bRemove, bUsed, bPresent, bThisFD, bThisOUT, bAllFD, bFirstTwo;
t_params *ps;
for (i = 0; (i < ps->nr); i++) /* for all bonds in the plist */
{
int vsnral = 0;
- const atom_id *first_atoms = NULL;
+ const int *first_atoms = NULL;
bKeep = FALSE;
bRemove = FALSE;
{
for (m = 0; (m < vsnral) && !bKeep; m++)
{
- const atom_id *atoms;
+ const int *atoms;
bPresent = FALSE;
atoms = plist[pindex[atom].ftype].param[pindex[atom].parnr].a + 1;
at2vsitecon_t *at2vc)
{
int i, j, k, m, n, nvsite, kept_i;
- atom_id atom, at1, at2;
+ int atom, at1, at2;
gmx_bool bKeep, bUsed, bPresent, bAll3FAD, bFirstTwo;
t_params *ps;
for (i = 0; (i < ps->nr); i++) /* for all angles in the plist */
{
int vsnral = 0;
- const atom_id *first_atoms = NULL;
+ const int *first_atoms = NULL;
bKeep = FALSE;
bAll3FAD = TRUE;
{
for (m = 0; (m < vsnral) && !bKeep; m++)
{
- const atom_id *atoms;
+ const int *atoms;
bPresent = FALSE;
atoms = plist[pindex[atom].ftype].param[pindex[atom].parnr].a + 1;
{
int k, m, n, nvsite;
int vsnral = 0;
- const atom_id *first_atoms = NULL;
- atom_id atom;
+ const int *first_atoms = NULL;
+ int atom;
gmx_bool bKeep, bUsed, bPresent;
{
for (m = 0; (m < vsnral) && !bKeep; m++)
{
- const atom_id *atoms;
+ const int *atoms;
bPresent = FALSE;
atoms = plist[pindex[atom].ftype].param[pindex[atom].parnr].a + 1;
int nat; /**< Number of atoms that can be pulled via IMD. */
int nat_loc; /**< Part of the atoms that are local. */
- atom_id *ind; /**< Global indices of the IMD atoms. */
- atom_id *ind_loc; /**< Local indices of the IMD atoms. */
+ int *ind; /**< Global indices of the IMD atoms. */
+ int *ind_loc; /**< Local indices of the IMD atoms. */
int nalloc_loc; /**< Allocation size for ind_loc. */
rvec *xa; /**< Positions for all IMD atoms assembled on
the master node. */
float *vmd_forces; /**< The VMD forces flat in memory. */
int nforces; /**< Number of actual MD forces;
this gets communicated to the clients. */
- atom_id *f_ind; /**< Force indices. */
+ int *f_ind; /**< Force indices. */
rvec *f; /**< The IMD pulling forces. */
char *forcesendbuf; /**< Buffer for force sending. */
/* The next block is used on the master node only to reduce the output
* without sacrificing information. If any of these values changes,
* we need to write output */
- int old_nforces; /**< Old value for nforces. */
- atom_id *old_f_ind; /**< Old values for force indices. */
- rvec *old_forces; /**< Old values for IMD pulling forces. */
+ int old_nforces; /**< Old value for nforces. */
+ int *old_f_ind; /**< Old values for force indices. */
+ rvec *old_forces; /**< Old values for IMD pulling forces. */
} t_gmx_IMD_setup;
int gstart, gend, count;
t_block gmols, lmols;
int nat;
- atom_id *ind;
+ int *ind;
gmols = top_global->mols;
nat = IMDsetup->nat;
#include "gromacs/legacyheaders/types/enums.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/swap/enums.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
} t_grpopts;
typedef struct {
- int nat; /* Number of atoms in the pull group */
- atom_id *ind; /* The global atoms numbers */
- int nweight; /* The number of weights (0 or nat) */
- real *weight; /* Weights (use all 1 when weight==NULL) */
- atom_id pbcatom; /* The reference atom for pbc (global number) */
+ int nat; /* Number of atoms in the pull group */
+ int *ind; /* The global atoms numbers */
+ int nweight; /* The number of weights (0 or nat) */
+ real *weight; /* Weights (use all 1 when weight==NULL) */
+ int pbcatom; /* The reference atom for pbc (global number) */
} t_pull_group;
typedef struct {
int eType; /* Rotation type for this group */
int bMassW; /* Use mass-weighed positions? */
int nat; /* Number of atoms in the group */
- atom_id *ind; /* The global atoms numbers */
+ int *ind; /* The global atoms numbers */
rvec *x_ref; /* The reference positions */
rvec vec; /* The normalized rotation vector */
real rate; /* Rate of rotation (degree/ps) */
typedef struct t_IMD {
int nat; /* Number of interactive atoms */
- atom_id *ind; /* The global indices of the interactive atoms */
+ int *ind; /* The global indices of the interactive atoms */
struct t_gmx_IMD *setup; /* Stores non-inputrec IMD data */
} t_IMD;
int nat; /* Number of atoms in the ion group */
int nat_split[2]; /* Number of atoms in the split group */
int nat_sol; /* Number of atoms in the solvent group */
- atom_id *ind; /* The global ion group atoms numbers */
- atom_id *ind_split[2]; /* Split groups for compartment partitioning */
- atom_id *ind_sol; /* The global solvent group atom numbers */
+ int *ind; /* The global ion group atoms numbers */
+ int *ind_split[2]; /* Split groups for compartment partitioning */
+ int *ind_sol; /* The global solvent group atom numbers */
gmx_bool massw_split[2]; /* Use mass-weighted positions in split group? */
real cyl0r, cyl1r; /* Split cylinders defined by radius, upper and */
real cyl0u, cyl1u; /* ... lower extension. The split cylinders de- */
#define GMX_LEGACYHEADERS_TYPES_NS_H
#include "gromacs/legacyheaders/types/nblist.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
typedef struct {
int ncg;
int nj;
- atom_id jcg[MAX_CG];
+ int jcg[MAX_CG];
} t_ns_buf;
typedef struct gmx_ns_t {
gmx_bool bCGlist;
- atom_id *simple_aaj;
+ int *simple_aaj;
struct t_grid*grid;
t_excl *bexcl;
gmx_bool *bHaveVdW;
gmx_bool *bExcludeAlleg;
int nra_alloc;
int cg_alloc;
- atom_id **nl_sr;
+ int **nl_sr;
int *nsr;
- atom_id **nl_lr_ljc;
- atom_id **nl_lr_one;
+ int **nl_lr_ljc;
+ int **nl_lr_one;
int *nlr_ljc;
int *nlr_one;
/* the nblists should probably go in here */
{
int icg, k, k0, k1, d;
real nrcg, inv_ncg, mtot, inv_mtot;
- atom_id * cgindex;
+ int * cgindex;
rvec ix;
int adresstype;
real adressr, adressw;
t_pbc * pbc)
{
int icg, k, k0, k1;
- atom_id * cgindex;
+ int * cgindex;
int adresstype;
real adressr, adressw;
rvec * ref;
t_pbc * pbc)
{
int icg, k, k0, k1;
- atom_id * cgindex;
+ int * cgindex;
int adresstype;
real adressr, adressw;
rvec * ref;
} t_gmx_constr;
typedef struct {
- atom_id iatom[3];
- atom_id blocknr;
+ int iatom[3];
+ int blocknr;
} t_sortblock;
static int pcomp(const void *p1, const void *p2)
{
int db;
- atom_id min1, min2, max1, max2;
+ int min1, min2, max1, max2;
t_sortblock *a1 = (t_sortblock *)p1;
t_sortblock *a2 = (t_sortblock *)p2;
t_blocka sblocks;
t_sortblock *sb;
t_iatom *iatom;
- atom_id *inv_sblock;
+ int *inv_sblock;
/* Since we are processing the local topology,
* the F_CONSTRNC ilist has been concatenated to the F_CONSTR ilist.
* of coordinates working on settle type constraint.
*/
-void cshake(const atom_id iatom[], int ncon, int *nnit, int maxnit,
+void cshake(const int iatom[], int ncon, int *nnit, int maxnit,
const real dist2[], real xp[], const real rij[], const real m2[], real omega,
const real invmass[], const real tt[], real lagr[], int *nerror);
/* Regular iterative shake */
-void crattle(atom_id iatom[], int ncon, int *nnit, int maxnit,
+void crattle(int iatom[], int ncon, int *nnit, int maxnit,
real dist2[], real vp[], real rij[], real m2[], real omega,
real invmass[], real tt[], real lagr[], int *nerror, real invdt);
*/
#ifdef DEBUG
-static void SETEXCL_(t_excl e[], atom_id i, atom_id j)
+static void SETEXCL_(t_excl e[], int i, int j)
{
e[j] = e[j] | (1<<i);
}
-static void RMEXCL_(t_excl e[], atom_id i, atom_id j)
+static void RMEXCL_(t_excl e[], int i, int j)
{
e[j] = e[j] & ~(1<<i);
}
-static gmx_bool ISEXCL_(t_excl e[], atom_id i, atom_id j)
+static gmx_bool ISEXCL_(t_excl e[], int i, int j)
{
return (gmx_bool)(e[j] & (1<<i));
}
-static gmx_bool NOTEXCL_(t_excl e[], atom_id i, atom_id j)
+static gmx_bool NOTEXCL_(t_excl e[], int i, int j)
{
return !(ISEXCL(e, i, j));
}
#else
-#define SETEXCL(e, i, j) (e)[((atom_id) (j))] |= (1<<((atom_id) (i)))
-#define RMEXCL(e, i, j) (e)[((atom_id) (j))] &= (~(1<<((atom_id) (i))))
-#define ISEXCL(e, i, j) (gmx_bool) ((e)[((atom_id) (j))] & (1<<((atom_id) (i))))
+#define SETEXCL(e, i, j) (e)[((int) (j))] |= (1<<((int) (i)))
+#define RMEXCL(e, i, j) (e)[((int) (j))] &= (~(1<<((int) (i))))
+#define ISEXCL(e, i, j) (gmx_bool) ((e)[((int) (j))] & (1<<((int) (i))))
#define NOTEXCL(e, i, j) !(ISEXCL(e, i, j))
#endif
-static gmx_inline void new_i_nblist(t_nblist *nlist, atom_id i_atom, int shift, int gid)
+static gmx_inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int gid)
{
int nri = nlist->nri;
}
-static gmx_inline void add_j_to_nblist(t_nblist *nlist, atom_id j_atom, gmx_bool bLR)
+static gmx_inline void add_j_to_nblist(t_nblist *nlist, int j_atom, gmx_bool bLR)
{
int nrj = nlist->nrj;
}
static gmx_inline void add_j_to_nblist_cg(t_nblist *nlist,
- atom_id j_start, int j_end,
+ int j_start, int j_end,
t_excl *bexcl, gmx_bool i_is_j,
gmx_bool bLR)
{
int icg,
int jgid,
int nj,
- atom_id jjcg[],
- atom_id index[],
+ int jjcg[],
+ int index[],
t_excl bExcl[],
int shift,
t_forcerec * fr,
int icg,
int jgid,
int nj,
- atom_id jjcg[],
- atom_id index[],
+ int jjcg[],
+ int index[],
t_excl bExcl[],
int shift,
t_forcerec * fr,
t_nblist * coul_ww = NULL;
int i, j, jcg, igid, gid, nbl_ind;
- atom_id jj, jj0, jj1, i_atom;
+ int jj, jj0, jj1, i_atom;
int i0, nicg;
int *cginfo;
int icg,
int jgid,
int nj,
- atom_id jjcg[],
- atom_id index[],
+ int jjcg[],
+ int index[],
t_excl bExcl[],
int shift,
t_forcerec * fr,
t_nblist * coul_adress = NULL;
int i, j, jcg, igid, gid, nbl_ind, nbl_ind_adress;
- atom_id jj, jj0, jj1, i_atom;
+ int jj, jj0, jj1, i_atom;
int i0, nicg;
int *cginfo;
int icg,
int jgid,
int nj,
- atom_id jjcg[],
- atom_id index[],
+ int jjcg[],
+ int index[],
t_excl bExcl[],
int shift,
t_forcerec * fr,
{
t_nblist * coul;
int i, j, jcg, igid, gid;
- atom_id jj, jj0, jj1, i_atom;
+ int jj, jj0, jj1, i_atom;
int i0, nicg;
gmx_bool bNotEx;
int icg,
int jgid,
int nj,
- atom_id jjcg[],
- atom_id index[],
+ int jjcg[],
+ int index[],
t_excl bExcl[],
int shift,
t_forcerec * fr,
close_i_nblist(vdwc);
}
-static void setexcl(atom_id start, atom_id end, t_blocka *excl, gmx_bool b,
+static void setexcl(int start, int end, t_blocka *excl, gmx_bool b,
t_excl bexcl[])
{
- atom_id i, k;
+ int i, k;
if (b)
{
return r2;
}
-static void add_simple(t_ns_buf * nsbuf, int nrj, atom_id cg_j,
+static void add_simple(t_ns_buf * nsbuf, int nrj, int cg_j,
gmx_bool bHaveVdW[], int ngid, t_mdatoms *md,
int icg, int jgid, t_block *cgs, t_excl bexcl[],
int shift, t_forcerec *fr, put_in_list_t *put_in_list)
}
static void ns_inner_tric(rvec x[], int icg, int *i_egp_flags,
- int njcg, atom_id jcg[],
+ int njcg, int jcg[],
matrix box, rvec b_inv, real rcut2,
t_block *cgs, t_ns_buf **ns_buf,
gmx_bool bHaveVdW[], int ngid, t_mdatoms *md,
int shift;
int j, nrj, jgid;
int *cginfo = fr->cginfo;
- atom_id cg_j, *cgindex;
+ int cg_j, *cgindex;
cgindex = cgs->index;
shift = CENTRAL;
}
static void ns_inner_rect(rvec x[], int icg, int *i_egp_flags,
- int njcg, atom_id jcg[],
+ int njcg, int jcg[],
gmx_bool bBox, rvec box_size, rvec b_inv, real rcut2,
t_block *cgs, t_ns_buf **ns_buf,
gmx_bool bHaveVdW[], int ngid, t_mdatoms *md,
int shift;
int j, nrj, jgid;
int *cginfo = fr->cginfo;
- atom_id cg_j, *cgindex;
+ int cg_j, *cgindex;
cgindex = cgs->index;
if (bBox)
gmx_localtop_t *top,
t_mdatoms *md,
matrix box, rvec box_size,
- t_excl bexcl[], atom_id *aaj,
+ t_excl bexcl[], int *aaj,
int ngid, t_ns_buf **ns_buf,
put_in_list_t *put_in_list, gmx_bool bHaveVdW[])
{
int nsearch, icg, igid, nn;
int *cginfo;
t_ns_buf *nsbuf;
- /* atom_id *i_atoms; */
+ /* int *i_atoms; */
t_block *cgs = &(top->cgs);
t_blocka *excl = &(top->excls);
rvec b_inv;
gmx_bool bDoLongRange, gmx_bool bMakeQMMMnblist)
{
gmx_ns_t *ns;
- atom_id **nl_lr_ljc, **nl_lr_one, **nl_sr;
+ int **nl_lr_ljc, **nl_lr_one, **nl_sr;
int *nlr_ljc, *nlr_one, *nsr;
gmx_domdec_t *dd;
t_block *cgs = &(top->cgs);
int *cginfo = fr->cginfo;
- /* atom_id *i_atoms,*cgsindex=cgs->index; */
+ /* int *i_atoms,*cgsindex=cgs->index; */
ivec sh0, sh1, shp;
int cell_x, cell_y, cell_z;
int d, tx, ty, tz, dx, dy, dz, cj;
*/
gmx_groups_t *groups;
- atom_id *qm_arr = NULL, vsite, ai, aj;
+ int *qm_arr = NULL, vsite, ai, aj;
int qm_max = 0, qm_nr = 0, i, j, jmax, k, l, nrvsite2 = 0;
t_QMMMrec *qr;
t_MMrec *mm;
const real *chargeA, *chargeB;
real ek, ec, L1, qiA, qiB, qqA, qqB, qqL, v;
rvec dx, df;
- atom_id *AA;
+ int *AA;
ivec dt;
int start = 0;
int end = mdatoms->homenr;
* problematic constraint if the input was malformed
*
* \todo Make SHAKE use better data structures, in particular for iatom. */
-void cshake(const atom_id iatom[], int ncon, int *nnit, int maxnit,
+void cshake(const int iatom[], int ncon, int *nnit, int maxnit,
const real constraint_distance_squared[], real positions[],
const real initial_displacements[], const real half_of_reduced_mass[], real omega,
const real invmass[], const real distance_squared_tolerance[],
return TRUE;
}
-void crattle(atom_id iatom[], int ncon, int *nnit, int maxnit,
+void crattle(int iatom[], int ncon, int *nnit, int maxnit,
real constraint_distance_squared[], real vp[], real rij[], real m2[], real omega,
real invmass[], real distance_squared_tolerance[], real scaled_lagrange_multiplier[],
int *nerror, real invdt)
typedef struct {
int nnucl;
- atom_id shell; /* The shell id */
- atom_id nucl1, nucl2, nucl3; /* The nuclei connected to the shell */
+ int shell; /* The shell id */
+ int nucl1, nucl2, nucl3; /* The nuclei connected to the shell */
/* gmx_bool bInterCG; */ /* Coupled to nuclei outside cg? */
real k; /* force constant */
real k_1; /* 1 over force constant */
/* Initiate the shell structures */
for (i = 0; (i < nshell); i++)
{
- shell[i].shell = NO_ATID;
+ shell[i].shell = -1;
shell[i].nnucl = 0;
- shell[i].nucl1 = NO_ATID;
- shell[i].nucl2 = NO_ATID;
- shell[i].nucl3 = NO_ATID;
+ shell[i].nucl1 = -1;
+ shell[i].nucl2 = -1;
+ shell[i].nucl3 = -1;
/* shell[i].bInterCG=FALSE; */
shell[i].k_1 = 0;
shell[i].k = 0;
nra = interaction_function[ftype].nratoms;
/* Check whether we have a bond with a shell */
- aS = NO_ATID;
+ aS = -1;
switch (bondtypes[j])
{
gmx_fatal(FARGS, "Death Horror: %s, %d", __FILE__, __LINE__);
}
- if (aS != NO_ATID)
+ if (aS != -1)
{
qS = atom[aS].q;
gmx_fatal(FARGS, "nsi is %d should be within 0 - %d. aS = %d",
nsi, nshell, aS);
}
- if (shell[nsi].shell == NO_ATID)
+ if (shell[nsi].shell == -1)
{
shell[nsi].shell = a_offset + aS;
ns++;
gmx_fatal(FARGS, "Weird stuff in %s, %d", __FILE__, __LINE__);
}
- if (shell[nsi].nucl1 == NO_ATID)
+ if (shell[nsi].nucl1 == -1)
{
shell[nsi].nucl1 = a_offset + aN;
}
- else if (shell[nsi].nucl2 == NO_ATID)
+ else if (shell[nsi].nucl2 == -1)
{
shell[nsi].nucl2 = a_offset + aN;
}
- else if (shell[nsi].nucl3 == NO_ATID)
+ else if (shell[nsi].nucl3 == -1)
{
shell[nsi].nucl3 = a_offset + aN;
}
namespace
{
-/*! \brief Stride of the vector of atom_id used to describe each SHAKE
+/*! \brief Stride of the vector of int used to describe each SHAKE
* constraint
*
* Like other such code, SHAKE is hard-wired to use t_ilist.iatoms as
/*! \brief Compute the displacements between pairs of constrained
* atoms described in the iatom "topology". */
std::vector<real>
-computeDisplacements(const std::vector<atom_id> &iatom,
+computeDisplacements(const std::vector<int> &iatom,
const std::vector<real> &positions)
{
assert(0 == iatom.size() % constraintStride);
*
* The reduced mass is m = 1/(1/m_i + 1/m_j)) */
std::vector<real>
-computeHalfOfReducedMasses(const std::vector<atom_id> &iatom,
+computeHalfOfReducedMasses(const std::vector<int> &iatom,
const std::vector<real> &inverseMasses)
{
int numConstraints = iatom.size() / constraintStride;
//! Run the test
void runTest(size_t gmx_unused numAtoms,
size_t numConstraints,
- const std::vector<atom_id> &iatom,
+ const std::vector<int> &iatom,
const std::vector<real> &constrainedDistances,
const std::vector<real> &inverseMasses,
const std::vector<real> &positions)
{
// Check that the topology refers to atoms that have masses and positions
assert(iatom[i*constraintStride + j] >= 0);
- assert(iatom[i*constraintStride + j] < static_cast<atom_id>(numAtoms));
+ assert(iatom[i*constraintStride + j] < static_cast<int>(numAtoms));
}
}
std::vector<real> distanceSquaredTolerances;
int numAtoms = 2;
int numConstraints = 1;
- std::vector<atom_id> iatom;
+ std::vector<int> iatom;
iatom.push_back(-1); // unused
iatom.push_back(0); // i atom index
iatom.push_back(1); // j atom index
int numAtoms = 4;
int numConstraints = 2;
- std::vector<atom_id> iatom;
+ std::vector<int> iatom;
iatom.push_back(-1); // unused
iatom.push_back(0); // i atom index
iatom.push_back(1); // j atom index
int numAtoms = 3;
int numConstraints = 2;
- std::vector<atom_id> iatom;
+ std::vector<int> iatom;
iatom.push_back(-1); // unused
iatom.push_back(0); // i atom index
iatom.push_back(1); // j atom index
int numAtoms = 4;
int numConstraints = 3;
- std::vector<atom_id> iatom;
+ std::vector<int> iatom;
iatom.push_back(-1); // unused
iatom.push_back(0); // i atom index
iatom.push_back(1); // j atom index
t_pbc *pbc, t_graph *g)
{
rvec fi, fj, fk, dx;
- atom_id av, ai, aj, ak;
+ int av, ai, aj, ak;
ivec di;
int siv, sij, sik;
{
rvec xvi, xij, xik, fv, fj, fk;
real cfx, cfy, cfz;
- atom_id av, ai, aj, ak;
+ int av, ai, aj, ak;
ivec di;
int svi, sji, ski;
{
real d, invl, fproj, a1;
rvec xvi, xij, xjk, xjl, xix, fv, temp;
- atom_id av, ai, aj, ak, al;
+ int av, ai, aj, ak, al;
ivec di;
int svi, sji, skj, slj, m;
*
************************************************************/
-static void add_gbond(t_graph *g, atom_id a0, atom_id a1)
+static void add_gbond(t_graph *g, int a0, int a1)
{
int i;
- atom_id inda0, inda1;
+ int inda0, inda1;
gmx_bool bFound;
inda0 = a0 - g->at_start;
{
int i, e;
int nchanged;
- atom_id at_i, *at_i2;
+ int at_i, *at_i2;
gmx_bool bMultiPart;
/* Initialize the part array with all entries different */
#include <stdio.h>
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
int at_start; /* The first connected atom in this graph */
int at_end; /* The last+1 connected atom in this graph */
int *nedge; /* For each node the number of edges */
- atom_id **edge; /* For each node, the actual edges (bidirect.) */
+ int **edge; /* For each node, the actual edges (bidirect.) */
gmx_bool bScrewPBC; /* Screw boundary conditions */
ivec *ishift; /* Shift for each particle */
int negc;
int nat_loc; /* Number of local pull atoms */
int nalloc_loc; /* Allocation size for ind_loc and weight_loc */
- atom_id *ind_loc; /* Local pull indices */
+ int *ind_loc; /* Local pull indices */
real *weight_loc; /* Weights for the local indices */
real mwscale; /* mass*weight scaling factor 1/sum w m */
/* Global enforced rotation data for a single rotation group */
typedef struct gmx_enfrotgrp
{
- real degangle; /* Rotation angle in degrees */
- matrix rotmat; /* Rotation matrix */
- atom_id *ind_loc; /* Local rotation indices */
- int nat_loc; /* Number of local group atoms */
- int nalloc_loc; /* Allocation size for ind_loc and weight_loc */
-
- real V; /* Rotation potential for this rotation group */
- rvec *f_rot_loc; /* Array to store the forces on the local atoms
- resulting from enforced rotation potential */
+ real degangle; /* Rotation angle in degrees */
+ matrix rotmat; /* Rotation matrix */
+ int *ind_loc; /* Local rotation indices */
+ int nat_loc; /* Number of local group atoms */
+ int nalloc_loc; /* Allocation size for ind_loc and weight_loc */
+
+ real V; /* Rotation potential for this rotation group */
+ rvec *f_rot_loc; /* Array to store the forces on the local atoms
+ resulting from enforced rotation potential */
/* Collective coordinates for the whole rotation group */
real *xc_ref_length; /* Length of each x_rotref vector after x_rotref
#include "gromacs/utility/fatalerror.h"
int
-gmx_calc_cog(t_topology * /* top */, rvec x[], int nrefat, atom_id index[], rvec xout)
+gmx_calc_cog(t_topology * /* top */, rvec x[], int nrefat, int index[], rvec xout)
{
int m, ai;
* mass are calculated, and hence a topology with masses is required.
*/
int
-gmx_calc_com(t_topology *top, rvec x[], int nrefat, atom_id index[], rvec xout)
+gmx_calc_com(t_topology *top, rvec x[], int nrefat, int index[], rvec xout)
{
int m, j, ai;
real mass, mtot;
* \returns 0 on success, EINVAL if \p top is NULL.
*/
int
-gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout)
+gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, int index[], rvec fout)
{
int m, j, ai;
real mass, mtot;
}
int
-gmx_calc_com_f(t_topology * /* top */, rvec f[], int nrefat, atom_id index[], rvec fout)
+gmx_calc_com_f(t_topology * /* top */, rvec f[], int nrefat, int index[], rvec fout)
{
clear_rvec(fout);
for (int m = 0; m < nrefat; ++m)
* Other parameters are passed unmodified to these functions.
*/
int
-gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
+gmx_calc_comg(t_topology *top, rvec x[], int nrefat, int index[],
bool bMass, rvec xout)
{
if (bMass)
* Other parameters are passed unmodified to these functions.
*/
int
-gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, atom_id index[],
+gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, int index[],
bool bMass, rvec fout)
{
if (bMass)
*/
int
gmx_calc_cog_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], rvec xout)
+ int nrefat, int index[], rvec xout)
{
const real tol = 1e-4;
bool bChanged;
*/
int
gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], rvec xout)
+ int nrefat, int index[], rvec xout)
{
const real tol = 1e-4;
bool bChanged;
*/
int
gmx_calc_comg_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], bool bMass, rvec xout)
+ int nrefat, int index[], bool bMass, rvec xout)
{
if (bMass)
{
int
-gmx_calc_cog_block(t_topology * /* top */, rvec x[], t_block *block, atom_id index[],
+gmx_calc_cog_block(t_topology * /* top */, rvec x[], t_block *block, int index[],
rvec xout[])
{
int b, i, ai;
* mass are calculated, and hence a topology with masses is required.
*/
int
-gmx_calc_com_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
+gmx_calc_com_block(t_topology *top, rvec x[], t_block *block, int index[],
rvec xout[])
{
int b, i, ai, d;
* \returns 0 on success, EINVAL if \p top is NULL.
*/
int
-gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[],
+gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block, int index[],
rvec fout[])
{
int b, i, ai, d;
}
int
-gmx_calc_com_f_block(t_topology * /* top */, rvec f[], t_block *block, atom_id index[],
+gmx_calc_com_f_block(t_topology * /* top */, rvec f[], t_block *block, int index[],
rvec fout[])
{
for (int b = 0; b < block->nr; ++b)
* Other parameters are passed unmodified to these functions.
*/
int
-gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, atom_id index[],
+gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block, int index[],
bool bMass, rvec xout[])
{
if (bMass)
* Other parameters are passed unmodified to these functions.
*/
int
-gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block, atom_id index[],
+gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block, int index[],
bool bMass, rvec fout[])
{
if (bMass)
#define GMX_SELECTION_CENTEROFMASS_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
struct t_block;
struct t_blocka;
* \returns 0 on success.
*/
int
-gmx_calc_cog(t_topology *top, rvec x[], int nrefat, atom_id index[], rvec xout);
+gmx_calc_cog(t_topology *top, rvec x[], int nrefat, int index[], rvec xout);
/** Calculate a single center of mass. */
int
-gmx_calc_com(t_topology *top, rvec x[], int nrefat, atom_id index[], rvec xout);
+gmx_calc_com(t_topology *top, rvec x[], int nrefat, int index[], rvec xout);
/** Calculate force on a single center of geometry. */
int
-gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout);
+gmx_calc_cog_f(t_topology *top, rvec f[], int nrefat, int index[], rvec fout);
/*! \brief
* Calculate force on a single center of mass.
*
* \returns 0 on success.
*/
int
-gmx_calc_com_f(t_topology *top, rvec f[], int nrefat, atom_id index[], rvec fout);
+gmx_calc_com_f(t_topology *top, rvec f[], int nrefat, int index[], rvec fout);
/** Calculate a single center of mass/geometry. */
int
-gmx_calc_comg(t_topology *top, rvec x[], int nrefat, atom_id index[],
+gmx_calc_comg(t_topology *top, rvec x[], int nrefat, int index[],
bool bMass, rvec xout);
/** Calculate force on a single center of mass/geometry. */
int
-gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, atom_id index[],
+gmx_calc_comg_f(t_topology *top, rvec f[], int nrefat, int index[],
bool bMass, rvec fout);
/** Calculate a single center of geometry iteratively, taking PBC into account. */
int
gmx_calc_cog_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], rvec xout);
+ int nrefat, int index[], rvec xout);
/** Calculate a single center of mass iteratively, taking PBC into account. */
int
gmx_calc_com_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], rvec xout);
+ int nrefat, int index[], rvec xout);
/** Calculate a single center of mass/geometry iteratively with PBC. */
int
gmx_calc_comg_pbc(t_topology *top, rvec x[], t_pbc *pbc,
- int nrefat, atom_id index[], bool bMass, rvec xout);
+ int nrefat, int index[], bool bMass, rvec xout);
/*! \brief
* Calculate centers of geometry for a blocked index.
*/
int
gmx_calc_cog_block(t_topology *top, rvec x[], t_block *block,
- atom_id index[], rvec xout[]);
+ int index[], rvec xout[]);
/** Calculate centers of mass for a blocked index. */
int
gmx_calc_com_block(t_topology *top, rvec x[], t_block *block,
- atom_id index[], rvec xout[]);
+ int index[], rvec xout[]);
/** Calculate forces on centers of geometry for a blocked index. */
int
gmx_calc_cog_f_block(t_topology *top, rvec f[], t_block *block,
- atom_id index[], rvec fout[]);
+ int index[], rvec fout[]);
/*! \brief
* Calculate forces on centers of mass for a blocked index.
*
*/
int
gmx_calc_com_f_block(t_topology *top, rvec f[], t_block *block,
- atom_id index[], rvec fout[]);
+ int index[], rvec fout[]);
/** Calculate centers of mass/geometry for a blocked index. */
int
gmx_calc_comg_block(t_topology *top, rvec x[], t_block *block,
- atom_id index[], bool bMass, rvec xout[]);
+ int index[], bool bMass, rvec xout[]);
/** Calculate forces on centers of mass/geometry for a blocked index. */
int
gmx_calc_comg_f_block(t_topology *top, rvec f[], t_block *block,
- atom_id index[], bool bMass, rvec fout[]);
+ int index[], bool bMass, rvec fout[]);
/** Calculate centers of mass/geometry for a set of blocks; */
int
gmx_calc_comg_blocka(t_topology *top, rvec x[], t_blocka *block,
* No copy if \p index is made.
*/
void
-gmx_ana_index_set(gmx_ana_index_t *g, int isize, atom_id *index, int nalloc)
+gmx_ana_index_set(gmx_ana_index_t *g, int isize, int *index, int nalloc)
{
g->isize = isize;
g->index = index;
static int
cmp_atomid(const void *a, const void *b)
{
- if (*(atom_id *)a < *(atom_id *)b)
+ if (*(int *)a < *(int *)b)
{
return -1;
}
- if (*(atom_id *)a > *(atom_id *)b)
+ if (*(int *)a > *(int *)b)
{
return 1;
}
#include <string>
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/block.h"
namespace gmx
/** Number of atoms. */
int isize;
/** List of atoms. */
- atom_id *index;
+ int *index;
/** Number of items allocated for \p index. */
int nalloc_index;
};
gmx_ana_index_clear(gmx_ana_index_t *g);
/** Constructs a \c gmx_ana_index_t from given values. */
void
-gmx_ana_index_set(gmx_ana_index_t *g, int isize, atom_id *index, int nalloc);
+gmx_ana_index_set(gmx_ana_index_t *g, int isize, int *index, int nalloc);
/** Creates a simple index group from the first to the \p natoms'th atom. */
void
gmx_ana_index_init_simple(gmx_ana_index_t *g, int natoms);
*/
typedef struct swap_group
{
- int nat; /**< Number of atoms in the group */
- int apm; /**< Number of atoms in each molecule */
- atom_id *ind; /**< Global atom indices of the group */
- atom_id *ind_loc; /**< Local atom indices of the group */
- int nat_loc; /**< Number of local group atoms */
- int nalloc_loc; /**< Allocation size for ind_loc */
- rvec *xc; /**< Collective array of group atom positions */
- ivec *xc_shifts; /**< Current (collective) shifts */
- ivec *xc_eshifts; /**< Extra shifts since last DD step */
- rvec *xc_old; /**< Old (collective) positions */
- real *qc; /**< Collective array of charges */
- int *c_ind_loc; /**< Position of local atoms in the
- collective array, [0..nat_loc] */
- real *m; /**< Masses (can be omitted) */
- unsigned char *comp_from; /**< (Collective) Stores from which compartment this
- atom has come. This way we keep track of through
- which channel an ion permeates (only used for
- the ion group) */
- unsigned char *comp_now; /**< In which compartment this ion is now */
- unsigned char *channel_label; /**< Which channel was passed at last by this ion? */
- rvec center; /**< Center of the group; COM if masses are used */
+ int nat; /**< Number of atoms in the group */
+ int apm; /**< Number of atoms in each molecule */
+ int *ind; /**< Global atom indices of the group */
+ int *ind_loc; /**< Local atom indices of the group */
+ int nat_loc; /**< Number of local group atoms */
+ int nalloc_loc; /**< Allocation size for ind_loc */
+ rvec *xc; /**< Collective array of group atom positions */
+ ivec *xc_shifts; /**< Current (collective) shifts */
+ ivec *xc_eshifts; /**< Extra shifts since last DD step */
+ rvec *xc_old; /**< Old (collective) positions */
+ real *qc; /**< Collective array of charges */
+ int *c_ind_loc; /**< Position of local atoms in the
+ collective array, [0..nat_loc] */
+ real *m; /**< Masses (can be omitted) */
+ unsigned char *comp_from; /**< (Collective) Stores from which compartment this
+ atom has come. This way we keep track of through
+ which channel an ion permeates (only used for
+ the ion group) */
+ unsigned char *comp_now; /**< In which compartment this ion is now */
+ unsigned char *channel_label; /**< Which channel was passed at last by this ion? */
+ rvec center; /**< Center of the group; COM if masses are used */
} t_group;
{
t_group *g;
int i, j;
- atom_id *nGroup = NULL; /* This array counts for each atom in the MD system to
- how many swap groups it belongs (should be 0 or 1!) */
+ int *nGroup = NULL; /* This array counts for each atom in the MD system to
+ how many swap groups it belongs (should be 0 or 1!) */
int ind = -1;
int nMultiple = 0; /* Number of atoms belonging to multiple groups */
#include "gromacs/legacyheaders/types/state.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
#define RANGECHK(i, n) if ((i) >= (n)) gmx_fatal(FARGS, "Your index file contains atomnumbers (e.g. %d)\nthat are larger than the number of atoms in the tpr file (%d)", (i), (n))
-static gmx_bool *bKeepIt(int gnx, int natoms, atom_id index[])
+static gmx_bool *bKeepIt(int gnx, int natoms, int index[])
{
gmx_bool *b;
int i;
return b;
}
-static atom_id *invind(int gnx, int natoms, atom_id index[])
+static int *invind(int gnx, int natoms, int index[])
{
- atom_id *inv;
+ int *inv;
int i;
snew(inv, natoms);
static void reduce_block(gmx_bool bKeep[], t_block *block,
const char *name)
{
- atom_id *index;
+ int *index;
int i, j, newi, newj;
snew(index, block->nr);
block->nr = newi;
}
-static void reduce_blocka(atom_id invindex[], gmx_bool bKeep[], t_blocka *block,
+static void reduce_blocka(int invindex[], gmx_bool bKeep[], t_blocka *block,
const char *name)
{
- atom_id *index, *a;
+ int *index, *a;
int i, j, k, newi, newj;
snew(index, block->nr);
block->nra = newj;
}
-static void reduce_rvec(int gnx, atom_id index[], rvec vv[])
+static void reduce_rvec(int gnx, int index[], rvec vv[])
{
rvec *ptr;
int i;
sfree(ptr);
}
-static void reduce_atom(int gnx, atom_id index[], t_atom atom[], char ***atomname,
+static void reduce_atom(int gnx, int index[], t_atom atom[], char ***atomname,
int *nres, t_resinfo *resinfo)
{
t_atom *ptr;
sfree(rinfo);
}
-static void reduce_ilist(atom_id invindex[], gmx_bool bKeep[],
+static void reduce_ilist(int invindex[], gmx_bool bKeep[],
t_ilist *il, int nratoms, const char *name)
{
t_iatom *ia;
}
}
-static void reduce_topology_x(int gnx, atom_id index[],
+static void reduce_topology_x(int gnx, int index[],
gmx_mtop_t *mtop, rvec x[], rvec v[])
{
t_topology top;
gmx_bool *bKeep;
- atom_id *invindex;
+ int *invindex;
int i;
top = gmx_mtop_t_to_t_topology(mtop);
mtop->natoms = top.atoms.nr;
}
-static void zeroq(atom_id index[], gmx_mtop_t *mtop)
+static void zeroq(int index[], gmx_mtop_t *mtop)
{
int mt, i;
matrix newbox;
int gnx;
char *grpname;
- atom_id *index = NULL;
+ int *index = NULL;
int nre;
gmx_enxnm_t *enm = NULL;
t_enxframe *fr_ener = NULL;
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOPOLOGY_SOURCES} PARENT_SCOPE)
gmx_install_headers(
- atom_id.h
atomprop.h
atoms.h
block.h
+++ /dev/null
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2015, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifndef GMX_TOPOLOGY_ATOM_ID_H
-#define GMX_TOPOLOGY_ATOM_ID_H
-
-typedef int atom_id; /* To indicate an atoms id */
-#define NO_ATID (atom_id)(~0) /* Use this to indicate invalid atid */
-
-#endif
#ifndef GMX_TOPOLOGY_BLOCK_H
#define GMX_TOPOLOGY_BLOCK_H
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
extern "C" {
#endif
-/* the block structure points into an array (usually of atom_ids).
+/* the block structure points into an array (usually of ints).
It is a list of starting indices for objects of consecutive ids, such
as molecules.
For example, if this block denotes molecules, then the first molecule
typedef struct t_block
{
int nr; /* The number of blocks */
- atom_id *index; /* Array of indices (dim: nr+1) */
+ int *index; /* Array of indices (dim: nr+1) */
int nalloc_index; /* The allocation size for index */
} t_block;
typedef struct t_blocka
{
int nr; /* The number of blocks */
- atom_id *index; /* Array of indices in a (dim: nr+1) */
+ int *index; /* Array of indices in a (dim: nr+1) */
int nra; /* The number of atoms */
- atom_id *a; /* Array of atom numbers in each group */
+ int *a; /* Array of atom numbers in each group */
/* (dim: nra) */
/* Block i (0<=i<nr) runs from */
/* index[i] to index[i+1]-1. There will */
#define GMX_TOPOLOGY_IDEF_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/real.h"
#ifdef __cplusplus
#define NR_CBTDIHS 6
#define NR_FOURDIHS 4
-typedef atom_id t_iatom;
+typedef int t_iatom;
/* this MUST correspond to the
t_interaction_function[F_NRE] in gmxlib/ifunc.c */
gmx_fio_fclose(out);
}
-void add_grp(t_blocka *b, char ***gnames, int nra, atom_id a[], const char *name)
+void add_grp(t_blocka *b, char ***gnames, int nra, int a[], const char *name)
{
int i;
/* compare index in `a' with group in `b' at `index',
when `index'<0 it is relative to end of `b' */
-static gmx_bool grp_cmp(t_blocka *b, int nra, atom_id a[], int index)
+static gmx_bool grp_cmp(t_blocka *b, int nra, int a[], int index)
{
int i;
}
-static atom_id *
+static int *
mk_aid(t_atoms *atoms, const char ** restype, const char * typestring, int *nra, gmx_bool bMatch)
-/* Make an array of atom_ids for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
+/* Make an array of ints for all atoms with residuetypes matching typestring, or the opposite if bMatch is false */
{
- atom_id *a;
+ int *a;
int i;
int res;
restp_t *restp = NULL;
char **attp = NULL;
char *rname, *aname;
- atom_id *aid, *aaid;
+ int *aid, *aaid;
int i, j, k, l, resind, naid, naaid, natp, nrestp = 0;
for (i = 0; (i < atoms->nres); i++)
const int num_index_groups = asize(constructing_data);
int n, j;
- atom_id *aid;
+ int *aid;
int nra, npres;
gmx_bool match;
char ndx_name[STRLEN], *atnm;
{
gmx_residuetype_t*rt = NULL;
char *resnm;
- atom_id *aid;
+ int *aid;
const char ** restype;
int nra;
int i, k;
}
-void check_index(char *gname, int n, atom_id index[], char *traj, int natoms)
+void check_index(char *gname, int n, int index[], char *traj, int natoms)
{
int i;
}
static void rd_groups(t_blocka *grps, char **grpname, char *gnames[],
- int ngrps, int isize[], atom_id *index[], int grpnr[])
+ int ngrps, int isize[], int *index[], int grpnr[])
{
int i, j, gnr1;
}
void rd_index(const char *statfile, int ngrps, int isize[],
- atom_id *index[], char *grpnames[])
+ int *index[], char *grpnames[])
{
char **gnames;
t_blocka *grps;
}
void rd_index_nrs(char *statfile, int ngrps, int isize[],
- atom_id *index[], char *grpnames[], int grpnr[])
+ int *index[], char *grpnames[], int grpnr[])
{
char **gnames;
t_blocka *grps;
}
void get_index(t_atoms *atoms, const char *fnm, int ngrps,
- int isize[], atom_id *index[], char *grpnames[])
+ int isize[], int *index[], char *grpnames[])
{
char ***gnames;
t_blocka *grps = NULL;
#include <stdio.h>
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
struct t_atoms;
struct t_blocka;
-void check_index(char *gname, int n, atom_id index[],
+void check_index(char *gname, int n, int index[],
char *traj, int natoms);
/* Checks if any index is smaller than zero or larger than natoms,
* if so a fatal_error is given with the gname (if gname=NULL, "Index" is used)
/* Lower level routine than the next */
void rd_index(const char *statfile, int ngrps, int isize[],
- atom_id *index[], char *grpnames[]);
+ int *index[], char *grpnames[]);
/* Assume the group file is generated, so the
* format need not be user-friendly. The format is:
* nr of groups, total nr of atoms
*
* The function opens a file, reads ngrps groups, asks the
* user for group numbers, and puts the resulting sizes in
- * isize, the atom_id s in index and the names of
+ * isize, the int s in index and the names of
* the groups in grpnames.
*
* It is also assumed, that when ngrps groups are requested
*/
void rd_index_nrs(char *statfile, int ngrps, int isize[],
- atom_id *index[], char *grpnames[], int grpnr[]);
+ 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,
- int isize[], atom_id *index[], char *grpnames[]);
+ 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
* for the atoms in *atoms.
int maxframe;
char **grpname;
struct t_blocka *clust;
- atom_id *inv_clust;
+ int *inv_clust;
} t_cluster_ndx;
t_cluster_ndx *cluster_index(FILE *fplog, const char *ndx);
void write_index(const char *outf, struct t_blocka *b, char **gnames, gmx_bool bDuplicate, int natoms);
/* Writes index blocks to outf (writes an indexfile) */
-void add_grp(struct t_blocka *b, char ***gnames, int nra, atom_id a[], const char *name);
+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,
#include "invblock.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/topology/block.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-atom_id *make_invblock(const t_block *block, int nr)
+int *make_invblock(const t_block *block, int nr)
{
int i, j;
- atom_id *invblock;
+ int *invblock;
snew(invblock, nr+1);
/* Mark unused numbers */
for (i = 0; i <= nr; i++)
{
- invblock[i] = NO_ATID;
+ invblock[i] = -1;
}
for (i = 0; (i < block->nr); i++)
{
for (j = block->index[i]; (j < block->index[i+1]); j++)
{
- if (invblock[j] == NO_ATID)
+ if (invblock[j] == -1)
{
invblock[j] = i;
}
return invblock;
}
-atom_id *make_invblocka(const t_blocka *block, int nr)
+int *make_invblocka(const t_blocka *block, int nr)
{
int i, j;
- atom_id *invblock;
+ int *invblock;
snew(invblock, nr+1);
/* Mark unused numbers */
for (i = 0; i <= nr; i++)
{
- invblock[i] = NO_ATID;
+ invblock[i] = -1;
}
for (i = 0; (i < block->nr); i++)
{
for (j = block->index[i]; (j < block->index[i+1]); j++)
{
- if (invblock[block->a[j]] == NO_ATID)
+ if (invblock[block->a[j]] == -1)
{
invblock[block->a[j]] = i;
}
#ifndef GMX_TOPOLOGY_INVBLOCK_H
#define GMX_TOPOLOGY_INVBLOCK_H
-#include "gromacs/topology/atom_id.h"
struct t_block;
struct t_blocka;
-atom_id *make_invblock(const struct t_block *block, int nr);
+int *make_invblock(const struct t_block *block, int nr);
/* Inverse the block structure. nr is the maximum entry in the inversed
* array, and therefore the dimension of the returned array
*/
-atom_id *make_invblocka(const struct t_blocka *block, int nr);
+int *make_invblocka(const struct t_blocka *block, int nr);
/* Inverse the block structure. nr is the maximum entry in the inversed
* array, and therefore the dimension of the returned array
*/
struct t_conect
{
//! Index of the second nearest neighbor dot.
- atom_id aa;
+ int aa;
//! Index of the nearest neighbor dot.
- atom_id ab;
+ int ab;
//! Squared distance to `aa`.
real d2a;
//! Squared distance to `ab`.
* \param[in] j Index of the other surface dot to add to the array.
* \param[in] d2 Squared distance between `i` and `j`.
*/
-void add_rec(t_conect c[], atom_id i, atom_id j, real d2)
+void add_rec(t_conect c[], int i, int j, real d2)
{
- if (c[i].aa == NO_ATID)
+ if (c[i].aa == -1)
{
c[i].aa = j;
c[i].d2a = d2;
}
- else if (c[i].ab == NO_ATID)
+ else if (c[i].ab == -1)
{
c[i].ab = j;
c[i].d2b = d2;
snew(c, n);
for (i = 0; (i < n); i++)
{
- c[i].aa = c[i].ab = NO_ATID;
+ c[i].aa = c[i].ab = -1;
}
for (i = 0; (i < n); i++)
fp = gmx_ffopen(fn, "a");
for (i = 0; (i < n); i++)
{
- if ((c[i].aa == NO_ATID) || (c[i].ab == NO_ATID))
+ if ((c[i].aa == -1) || (c[i].ab == -1))
{
fprintf(stderr, "Warning dot %d has no conections\n", i+1);
}
real *value_of_area, real **at_area,
real *value_of_vol,
real **lidots, int *nu_dots,
- atom_id index[], AnalysisNeighborhood *nb,
+ int index[], AnalysisNeighborhood *nb,
const t_pbc *pbc)
{
const real dotarea = FOURPI/(real) n_dot;
void SurfaceAreaCalculator::calculate(
const rvec *x, const t_pbc *pbc,
- int nat, atom_id index[], int flags, real *area, real *volume,
+ int nat, int index[], int flags, real *area, real *volume,
real **at_area, real **lidots, int *n_dots) const
{
flags |= impl_->flags_;
#define GMX_TRAJECTORYANALYSIS_SURFACEAREA_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atom_id.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/real.h"
* outputs.
*/
void calculate(const rvec *x, const t_pbc *pbc,
- int nat, atom_id index[], int flags, real *area,
+ int nat, int index[], int flags, real *area,
real *volume, real **at_area,
real **lidots, int *n_dots) const;
/* information about scaling center */
typedef struct {
- rvec xmin; /* smallest coordinates of all embedded molecules */
- rvec xmax; /* largest coordinates of all embedded molecules */
- rvec *geom_cent; /* scaling center of each independent molecule to embed */
- int pieces; /* number of molecules to embed independently */
- int *nidx; /* n atoms for every independent embedded molecule (index in subindex) */
- atom_id **subindex; /* atomids for independent molecule *
- * atoms of piece i run from subindex[i][0] to subindex[i][nidx[i]] */
+ rvec xmin; /* smallest coordinates of all embedded molecules */
+ rvec xmax; /* largest coordinates of all embedded molecules */
+ rvec *geom_cent; /* scaling center of each independent molecule to embed */
+ int pieces; /* number of molecules to embed independently */
+ int *nidx; /* n atoms for every independent embedded molecule (index in subindex) */
+ int **subindex; /* atomids for independent molecule *
+ * atoms of piece i run from subindex[i][0] to subindex[i][nidx[i]] */
} pos_ins_t;
/* variables needed in do_md */
t_block *mem_a;
real z, zmin, zmax, mem_area;
gmx_bool bNew;
- atom_id *mol_id;
+ int *mol_id;
int type = 0, block = 0;
nmol = count = 0;
{
int i, j, k, n, rm, mol_id, at, block;
rvec *x_tmp, *v_tmp;
- atom_id *list, *new_mols;
+ int *list, *new_mols;
unsigned char *new_egrp[egcNR];
gmx_bool bRM;
int RMmolblock;
#include "3dview.h"
#include "nmol.h"
-static void add_object(t_manager *man, eObject eO, atom_id ai, atom_id aj)
+static void add_object(t_manager *man, eObject eO, int ai, int aj)
{
srenew(man->obj, ++man->nobj);
man->obj[man->nobj-1].eO = eO;
}
}
-static atom_id which_atom(t_manager *man, int x, int y)
+static int which_atom(t_manager *man, int x, int y)
{
#define DELTA 5
int i;
{
if (man->bVis[i])
{
- return (atom_id) i;
+ return (int) i;
}
}
}
- return NO_ATID;
+ return -1;
}
static void do_label(t_x11 *x11, t_manager *man, int x, int y, bool bSet)
{
- atom_id ai;
+ int ai;
unsigned long col;
- if ((ai = which_atom(man, x, y)) != NO_ATID)
+ if ((ai = which_atom(man, x, y)) != -1)
{
x = man->ix[ai][XX];
y = man->ix[ai][YY];
{
if (!bB[i])
{
- add_object(man, eOSingle, (atom_id) i, 0);
+ add_object(man, eOSingle, (int) i, 0);
}
}
sfree(bB);
void do_filter(t_x11 *x11, t_manager *man, t_filter *filter)
{
int i;
- atom_id j;
+ int j;
for (i = 0; (i < man->natom); i++)
{
eObject eO; /* The type of object */
eVisible eV; /* Visibility status of the object */
unsigned long color; /* The color (only when eV==evSpecial) */
- atom_id ai, aj; /* The atom_id for i (and j if bond) */
+ int ai, aj; /* The int for i (and j if bond) */
real z; /* The Z-coordinate for depht cueing */
} t_object;
#define MSIZE 4
-static void ps_draw_atom(t_psdata ps, atom_id ai, iv2 vec2[], char **atomnm[])
+static void ps_draw_atom(t_psdata ps, int ai, iv2 vec2[], char **atomnm[])
{
int xi, yi;
}
static void ps_draw_bond(t_psdata ps,
- atom_id ai, atom_id aj, iv2 vec2[],
+ int ai, int aj, iv2 vec2[],
rvec x[], char **atomnm[])
{
char *ic, *jc;
}
static void draw_atom(Display *disp, Window w, GC gc,
- atom_id ai, iv2 vec2[], unsigned long col[], int size[],
+ int ai, iv2 vec2[], unsigned long col[], int size[],
bool bBall, bool bPlus)
{
int xi, yi;
}
static void draw_bond(Display *disp, Window w, GC gc,
- atom_id ai, atom_id aj, iv2 vec2[],
+ int ai, int aj, iv2 vec2[],
rvec x[], unsigned long col[], int size[], bool bBalls)
{
unsigned long ic, jc;
int filter_vis(t_manager *man)
{
int i, nobj, nvis, nhide;
- atom_id ai;
+ int ai;
bool bAdd, *bVis;
t_object *obj;
t_object *newobj;