tpxv_VSite1, /**< Added 1 type virtual site */
tpxv_MTS, /**< Added multiple time stepping */
tpxv_RemovedConstantAcceleration, /**< Removed support for constant acceleration NEMD. */
+ tpxv_TransformationPullCoord, /**< Support for transformation pull coordinates */
+ tpxv_SoftcoreGapsys, /**< Added gapsys softcore function */
+ tpxv_ReaddedConstantAcceleration, /**< Re-added support for constant acceleration NEMD. */
tpxv_Count /**< the total number of tpxv versions */
};
{
if (pcrd->eType == PullingAlgorithm::External)
{
- std::string buf;
- if (serializer->reading())
- {
- serializer->doString(&buf);
- pcrd->externalPotentialProvider = gmx_strdup(buf.c_str());
- }
- else
- {
- buf = pcrd->externalPotentialProvider;
- serializer->doString(&buf);
- }
+ serializer->doString(&pcrd->externalPotentialProvider);
}
else
{
pcrd->ngroup = 0;
}
serializer->doIvec(&pcrd->dim.as_vec());
+ if (file_version >= tpxv_TransformationPullCoord)
+ {
+ serializer->doString(&pcrd->expression);
+ }
+ else
+ {
+ if (serializer->reading())
+ {
+ pcrd->expression.clear();
+ }
+ }
}
else
{
{
fepvals->edHdLPrintEnergy = FreeEnergyPrintEnergy::No;
}
+ if (file_version >= tpxv_SoftcoreGapsys)
+ {
+ serializer->doInt(reinterpret_cast<int*>(&fepvals->softcoreFunction));
+ serializer->doReal(&fepvals->scGapsysScaleLinpointLJ);
+ serializer->doReal(&fepvals->scGapsysScaleLinpointQ);
+ serializer->doReal(&fepvals->scGapsysSigmaLJ);
+ }
+ else
+ {
+ fepvals->softcoreFunction = SoftcoreType::Beutler;
+ fepvals->scGapsysScaleLinpointLJ = 0.85;
+ fepvals->scGapsysScaleLinpointQ = 0.3;
+ fepvals->scGapsysSigmaLJ = 0.3;
+ }
/* handle lambda_neighbors */
if ((file_version >= 83 && file_version < 90) || file_version >= 92)
{
ir->opts.nhchainlength = 1;
}
- int removedOptsNgacc = 0;
- if (serializer->reading() && file_version < tpxv_RemovedConstantAcceleration)
+ if (serializer->reading() && file_version >= tpxv_RemovedConstantAcceleration
+ && file_version < tpxv_ReaddedConstantAcceleration)
{
- serializer->doInt(&removedOptsNgacc);
+ ir->opts.ngacc = 0;
+ }
+ else
+ {
+ serializer->doInt(&ir->opts.ngacc);
}
serializer->doInt(&ir->opts.ngfrz);
serializer->doInt(&ir->opts.ngener);
snew(ir->opts.anneal_temp, ir->opts.ngtc);
snew(ir->opts.tau_t, ir->opts.ngtc);
snew(ir->opts.nFreeze, ir->opts.ngfrz);
+ snew(ir->opts.acceleration, ir->opts.ngacc);
snew(ir->opts.egp_flags, ir->opts.ngener * ir->opts.ngener);
}
if (ir->opts.ngtc > 0)
{
serializer->doIvecArray(ir->opts.nFreeze, ir->opts.ngfrz);
}
- if (serializer->reading() && file_version < tpxv_RemovedConstantAcceleration && removedOptsNgacc > 0)
+ if (ir->opts.ngacc > 0)
{
- std::vector<gmx::RVec> dummy;
- dummy.resize(removedOptsNgacc);
- serializer->doRvecArray(reinterpret_cast<rvec*>(dummy.data()), removedOptsNgacc);
- ir->useConstantAcceleration = std::any_of(dummy.begin(), dummy.end(), [](const gmx::RVec& vec) {
- return vec[XX] != 0.0 || vec[YY] != 0.0 || vec[ZZ] != 0.0;
- });
+ serializer->doRvecArray(ir->opts.acceleration, ir->opts.ngacc);
}
- else
+ if (serializer->reading())
{
ir->useConstantAcceleration = false;
+ for (int g = 0; g < ir->opts.ngacc; g++)
+ {
+ if (norm2(ir->opts.acceleration[g]) != 0)
+ {
+ ir->useConstantAcceleration = true;
+ }
+ }
}
serializer->doIntArray(ir->opts.egp_flags, ir->opts.ngener * ir->opts.ngener);
}
do_groups(serializer, &mtop->groups, &(mtop->symtab));
- if (file_version < tpxv_RemovedConstantAcceleration)
- {
- mtop->groups.groups[SimulationAtomGroupType::AccelerationUnused].clear();
- mtop->groups.groupNumbers[SimulationAtomGroupType::AccelerationUnused].clear();
- }
mtop->haveMoleculeIndices = true;