* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 2009 Christoph Junghans, Brad Lambeth.
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,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.
#include "adress.h"
+#include <cmath>
+
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/legacyheaders/types/simple.h"
#include "gromacs/math/utilities.h"
return 1;
}
- dl = sqrt(sqr_dl);
+ dl = std::sqrt(sqr_dl);
/* molecule is coarse grained */
if (dl > l2)
/* hybrid region */
else
{
- tmp = cos((dl-adressr)*M_PI/2/adressw);
+ tmp = std::cos((dl-adressr)*M_PI/2/adressw);
return tmp*tmp;
}
}
t_mdatoms * mdatoms,
t_pbc * pbc)
{
- int icg, k, k0, k1, d;
- real nrcg, inv_ncg, mtot, inv_mtot;
+ int icg, k, k0, k1;
atom_id * cgindex;
- rvec ix;
int adresstype;
real adressr, adressw;
rvec * ref;
- real * massT;
real * wf;
adresstype = fr->adress_type;
adressr = fr->adress_ex_width;
adressw = fr->adress_hy_width;
- massT = mdatoms->massT;
wf = mdatoms->wf;
ref = &(fr->adress_refs);
{
k0 = cgindex[icg];
k1 = cgindex[icg + 1];
- nrcg = k1 - k0;
for (k = (k0); (k < k1); k++)
{
t_mdatoms * mdatoms,
t_pbc * pbc)
{
- int i, j, k, nr, nra, inc;
+ int i, j, nr, nra, inc;
int ftype, adresstype;
t_iatom avsite, ai, aj, ak, al;
t_iatom * ia;
int adresstype;
real adressr, adressw;
rvec * ref;
- real * massT;
real * wf;
adresstype = fr->adress_type;
adressr = fr->adress_ex_width;
adressw = fr->adress_hy_width;
- massT = mdatoms->massT;
wf = mdatoms->wf;
ref = &(fr->adress_refs);
cgindex = cgs->index;
void
adress_thermo_force(int start,
int homenr,
- t_block * cgs,
rvec x[],
rvec f[],
t_forcerec * fr,
t_mdatoms * mdatoms,
t_pbc * pbc)
{
- int iatom, n0, nnn, nrcg, i;
+ int iatom, n0, nnn, i;
int adresstype;
- real adressw, adressr;
- atom_id * cgindex;
unsigned short * ptype;
rvec * ref;
- real * wf;
real tabscale;
real * ATFtab;
rvec dr;
- real w, wsq, wmin1, wmin1sq, wp, wt, rinv, sqr_dl, dl;
- real eps, eps2, F, Geps, Heps2, Fp, dmu_dwp, dwp_dr, fscal;
+ real wt, rinv, sqr_dl, dl;
+ real eps, eps2, F, Geps, Heps2, Fp, fscal;
adresstype = fr->adress_type;
- adressw = fr->adress_hy_width;
- adressr = fr->adress_ex_width;
- cgindex = cgs->index;
ptype = mdatoms->ptype;
ref = &(fr->adress_refs);
- wf = mdatoms->wf;
for (iatom = start; (iatom < start+homenr); iatom++)
{
{
if (ptype[iatom] == eptVSite)
{
- w = wf[iatom];
/* is it hybrid or apply the thermodynamics force everywhere?*/
if (mdatoms->tf_table_index[iatom] != NO_TF_TABLE)
{
tabscale = fr->atf_tabs[DEFAULT_TF_TABLE].scale;
}
- fscal = 0;
if (pbc)
{
pbc_dx(pbc, (*ref), x[iatom], dr);
rinv = 0.0;
}
- dl = sqrt(sqr_dl);
+ dl = std::sqrt(sqr_dl);
/* table origin is adress center */
wt = dl*tabscale;
- n0 = wt;
+ n0 = static_cast<int>(wt);
eps = wt-n0;
eps2 = eps*eps;
nnn = 4*n0;