sdc = sd->sdc;
sig = sd->sdsig;
- if (nrend-start > sd->sd_V_nalloc)
- {
- sd->sd_V_nalloc = over_alloc_dd(nrend-start);
- srenew(sd->sd_V, sd->sd_V_nalloc);
- }
for (n = 0; n < ngtc; n++)
{
}
}
+static void check_sd2_work_data_allocation(gmx_stochd_t *sd, int nrend)
+{
+ if (nrend > sd->sd_V_nalloc)
+ {
+ sd->sd_V_nalloc = over_alloc_dd(nrend);
+ srenew(sd->sd_V, sd->sd_V_nalloc);
+ }
+}
+
static void do_update_sd2(gmx_stochd_t *sd,
gmx_rng_t gaussrand,
gmx_bool bInitStep,
real ism;
int n, d;
- sdc = sd->sdc;
- sig = sd->sdsig;
- if (nrend-start > sd->sd_V_nalloc)
- {
- sd->sd_V_nalloc = over_alloc_dd(nrend-start);
- srenew(sd->sd_V, sd->sd_V_nalloc);
- }
+ sdc = sd->sdc;
+ sig = sd->sdsig;
sd_V = sd->sd_V;
if (bFirstHalf)
}
Vmh = sd_X[n][d]*sdc[gt].d/(tau_t[gt]*sdc[gt].c)
+ ism*sig[gt].Yv*gmx_rng_gaussian_table(gaussrand);
- sd_V[n-start][d] = ism*sig[gt].V*gmx_rng_gaussian_table(gaussrand);
+ sd_V[n][d] = ism*sig[gt].V*gmx_rng_gaussian_table(gaussrand);
v[n][d] = vn*sdc[gt].em
+ (invmass[n]*f[n][d] + accel[ga][d])*tau_t[gt]*(1 - sdc[gt].em)
- + sd_V[n-start][d] - sdc[gt].em*Vmh;
+ + sd_V[n][d] - sdc[gt].em*Vmh;
xprime[n][d] = x[n][d] + v[n][d]*tau_t[gt]*(sdc[gt].eph - sdc[gt].emh);
}
v[n][d] =
(xprime[n][d] - x[n][d])/(tau_t[gt]*(sdc[gt].eph - sdc[gt].emh));
- Xmh = sd_V[n-start][d]*tau_t[gt]*sdc[gt].d/(sdc[gt].em-1)
+ Xmh = sd_V[n][d]*tau_t[gt]*sdc[gt].d/(sdc[gt].em-1)
+ ism*sig[gt].Yx*gmx_rng_gaussian_table(gaussrand);
sd_X[n][d] = ism*sig[gt].X*gmx_rng_gaussian_table(gaussrand);
nth = gmx_omp_nthreads_get(emntUpdate);
}
+ if (inputrec->eI == eiSD2)
+ {
+ check_sd2_work_data_allocation(upd->sd, nrend);
+ }
+
#pragma omp parallel for num_threads(nth) schedule(static) private(alpha)
for (th = 0; th < nth; th++)
{