* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
+#include "gromacs/legacyheaders/update.h"
-#include <stdio.h>
#include <math.h>
+#include <stdio.h>
-#include "types/commrec.h"
-#include "sysstuff.h"
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "nrnb.h"
-#include "physics.h"
-#include "macros.h"
-#include "vec.h"
-#include "main.h"
-#include "update.h"
-#include "gromacs/random/random.h"
-#include "mshift.h"
-#include "tgroup.h"
-#include "force.h"
-#include "names.h"
-#include "txtdump.h"
-#include "mdrun.h"
-#include "constr.h"
-#include "disre.h"
-#include "orires.h"
-#include "gmx_omp_nthreads.h"
+#include <algorithm>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/legacyheaders/constr.h"
+#include "gromacs/legacyheaders/disre.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/mdrun.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/orires.h"
+#include "gromacs/legacyheaders/tgroup.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/math/units.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pulling/pull.h"
+#include "gromacs/random/random.h"
#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
-#include "gromacs/pulling/pull.h"
+#include "gromacs/utility/smalloc.h"
/*For debugging, start at v(-dt/2) for velolcity verlet -- uncomment next line */
/*#define STARTFROMDT2*/
unsigned short cACC[], rvec v[], rvec f[],
gmx_bool bExtended, real veta, real alpha)
{
- double imass, w_dt;
+ double w_dt;
int gf = 0, ga = 0;
- rvec vrel;
- real u, vn, vv, va, vb, vnrel;
int n, d;
double g, mv1, mv2;
rvec x[], rvec xprime[], rvec v[],
gmx_bool bExtended, real veta)
{
- double imass, w_dt;
int gf = 0;
int n, d;
double g, mr1, mr2;
}
for (d = 0; d < DIM; d++)
{
- vn = v[n][d];
-
if ((ptype[n] != eptVSite) && (ptype[n] != eptShell))
{
vn = (lg*vrel[d] + dt*(imass*f[n][d] - 0.5*vxi*vrel[d]
{
gmx_stochd_t *sd;
gmx_sd_const_t *sdc;
- int ngtc, n, th;
+ int ngtc, n;
real y;
snew(sd, 1);
for (n = 0; n < ngtc; n++)
{
- reft = max(0.0, opts->ref_t[n]);
+ reft = std::max<real>(0, opts->ref_t[n]);
if ((opts->tau_t[n] > 0) && (reft > 0)) /* tau_t or ref_t = 0 means that no randomization is done */
{
sd->randomize_group[n] = TRUE;
{
ga = cACC[n];
}
- if (cTC)
- {
- gt = cTC[n];
- }
for (d = 0; d < DIM; d++)
{
{
gf = cFREEZE[n];
}
- if (cACC)
- {
- ga = cACC[n];
- }
if (cTC)
{
gt = cTC[n];
* half of the update, needs to be remembered for the second half.
*/
rvec *sd_V;
- real kT;
int gf = 0, ga = 0, gt = 0;
real vn = 0, Vmh, Xmh;
real ism;
{
gmx_bool bTCouple = FALSE;
real dttc;
- int i, start, end, homenr, offset;
+ int i, offset;
/* if using vv with trotter decomposition methods, we do this elsewhere in the code */
if (inputrec->etc != etcNO &&
gmx_bool bCalcVir,
real vetanew)
{
- gmx_bool bExtended, bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
+ gmx_bool bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
double dt;
- real dt_1;
- int start, homenr, nrend, i, n, m, g, d;
+ int start, homenr, nrend, i, m;
tensor vir_con;
- rvec *vbuf, *xprime = NULL;
+ rvec *xprime = NULL;
int nth, th;
if (constr)
nrend = start+homenr;
dt = inputrec->delta_t;
- dt_1 = 1.0/dt;
/*
* Steps (7C, 8C)
}
else
{
+ // cppcheck-suppress unreadVariable
nth = gmx_omp_nthreads_get(emntUpdate);
#pragma omp parallel for num_threads(nth) schedule(static)
t_nrnb *nrnb,
gmx_update_t upd)
{
- gmx_bool bExtended, bLastStep, bLog = FALSE, bEner = FALSE;
double dt;
- real dt_1;
- int start, homenr, nrend, i, n, m, g;
- tensor vir_con;
+ int start, homenr, i, n, m;
start = 0;
homenr = md->homenr;
- nrend = start+homenr;
-
- bExtended =
- (inputrec->etc == etcNOSEHOOVER) ||
- (inputrec->epc == epcPARRINELLORAHMAN) ||
- (inputrec->epc == epcMTTK);
dt = inputrec->delta_t;
gmx_constr_t constr,
t_idef *idef)
{
- gmx_bool bNH, bPR, bLastStep, bLog = FALSE, bEner = FALSE, bDoConstr = FALSE;
+ gmx_bool bNH, bPR, bDoConstr = FALSE;
double dt, alpha;
- real *imass, *imassin;
rvec *force;
- real dt_1;
- int start, homenr, nrend, i, j, d, n, m, g;
- int blen0, blen1, iatom, jatom, nshake, nsettle, nconstr, nexpand;
- int *icom = NULL;
- tensor vir_con;
- rvec *vcom, *xcom, *vall, *xall, *xin, *vin, *forcein, *fall, *xpall, *xprimein, *xprime;
+ int start, homenr, nrend;
+ rvec *xprime;
int nth, th;
bDoConstr = (NULL != constr);
xprime = get_xprime(state, upd);
dt = inputrec->delta_t;
- dt_1 = 1.0/dt;
/* We need to update the NMR restraint history when time averaging is used */
if (state->flags & (1<<estDISRE_RM3TAV))
t_mdatoms *md, t_state *state, gmx_update_t upd, gmx_constr_t constr)
{
- int i;
real rate = (ir->delta_t)/ir->opts.tau_t[0];
if (ir->etc == etcANDERSEN && constr != NULL)