double dt;
t_grp_tcstat *tcstat;
double *ivxi, *ixi;
- double *iQinv;
double *GQ;
gmx_bool bBarostat;
int mstepsi, mstepsj;
ivxi = &vxi[i*nh];
ixi = &xi[i*nh];
+ gmx::ArrayRef<const double> iQinv;
if (bBarostat)
{
- iQinv = &(MassQ->QPinv[i*nh]);
+ iQinv = gmx::arrayRefFromArray(&MassQ->QPinv[i*nh], nh);
nd = 1.0; /* THIS WILL CHANGE IF NOT ISOTROPIC */
reft = std::max<real>(0, opts->ref_t[0]);
Ekin = gmx::square(*veta)/MassQ->Winv;
}
else
{
- iQinv = &(MassQ->Qinv[i*nh]);
+ iQinv = gmx::arrayRefFromArray(&MassQ->Qinv[i*nh], nh);
tcstat = &ekind->tcstat[i];
nd = opts->nrdf[i];
reft = std::max<real>(0, opts->ref_t[i]);
{
if (bInit)
{
- snew(MassQ->Qinv, ngtc);
+ MassQ->Qinv.resize(ngtc);
}
for (i = 0; (i < ngtc); i++)
{
/* Allocate space for thermostat variables */
if (bInit)
{
- snew(MassQ->Qinv, ngtc*nh);
+ MassQ->Qinv.resize(ngtc * nh);
}
/* now, set temperature variables */
bmass = DIM*DIM; /* recommended mass parameters for isotropic barostat */
}
- snew(MassQ->QPinv, nnhpres*opts->nhchainlength);
+ MassQ->QPinv.resize(nnhpres*opts->nhchainlength);
/* barostat temperature */
if ((ir->tau_p > 0) && (opts->ref_t[0] > 0))
* TODO: Move the next two structs out of state.h.
*/
-typedef struct t_extmass
+struct t_extmass
{
- double *Qinv; /* inverse mass of thermostat -- computed from inputs, but a good place to store */
- double *QPinv; /* inverse mass of thermostat for barostat -- computed from inputs, but a good place to store */
- double Winv; /* Pressure mass inverse -- computed, not input, but a good place to store. Need to make a matrix later */
- tensor Winvm; /* inverse pressure mass tensor, computed */
-} t_extmass;
+ std::vector<double> Qinv; /* inverse mass of thermostat -- computed from inputs, but a good place to store */
+ std::vector<double> QPinv; /* inverse mass of thermostat for barostat -- computed from inputs, but a good place to store */
+ double Winv; /* Pressure mass inverse -- computed, not input, but a good place to store. Need to make a matrix later */
+ tensor Winvm; /* inverse pressure mass tensor, computed */
+};
typedef struct