|| legacySimulatorData_->inputrec->etc == TemperatureCoupling::Berendsen
|| legacySimulatorData_->inputrec->etc == TemperatureCoupling::NoseHoover)
{
- builder->add<VelocityScalingTemperatureCoupling>(-1,
+ builder->add<VelocityScalingTemperatureCoupling>(Offset(-1),
UseFullStepKE::No,
ReportPreviousStepConservedEnergy::No,
PropagatorTag("LeapFrogPropagator"));
}
builder->add<Propagator<IntegrationStage::LeapFrog>>(
- PropagatorTag("LeapFrogPropagator"), legacySimulatorData_->inputrec->delta_t);
+ PropagatorTag("LeapFrogPropagator"), TimeStep(legacySimulatorData_->inputrec->delta_t));
if (legacySimulatorData_->constr)
{
builder->add<ConstraintsElement<ConstraintVariable::Positions>>();
builder->add<ComputeGlobalsElement<ComputeGlobalsAlgorithm::LeapFrog>>();
if (legacySimulatorData_->inputrec->epc == PressureCoupling::ParrinelloRahman)
{
- builder->add<ParrinelloRahmanBarostat>(-1, PropagatorTag("LeapFrogPropagator"));
+ builder->add<ParrinelloRahmanBarostat>(Offset(-1), PropagatorTag("LeapFrogPropagator"));
}
}
else if (legacySimulatorData_->inputrec->eI == IntegrationAlgorithm::VV)
// The velocity verlet integration algorithm
builder->add<ForceElement>();
builder->add<Propagator<IntegrationStage::VelocitiesOnly>>(
- PropagatorTag("VelocityHalfStep"), 0.5 * legacySimulatorData_->inputrec->delta_t);
+ PropagatorTag("VelocityHalfStep"), TimeStep(0.5 * legacySimulatorData_->inputrec->delta_t));
if (legacySimulatorData_->constr)
{
builder->add<ConstraintsElement<ConstraintVariable::Velocities>>();
|| legacySimulatorData_->inputrec->etc == TemperatureCoupling::Berendsen)
{
builder->add<VelocityScalingTemperatureCoupling>(
- 0,
+ Offset(0),
UseFullStepKE::Yes,
ReportPreviousStepConservedEnergy::Yes,
PropagatorTag("VelocityHalfAndPositionFullStep"));
}
builder->add<Propagator<IntegrationStage::VelocityVerletPositionsAndVelocities>>(
- PropagatorTag("VelocityHalfAndPositionFullStep"), legacySimulatorData_->inputrec->delta_t);
+ PropagatorTag("VelocityHalfAndPositionFullStep"),
+ TimeStep(legacySimulatorData_->inputrec->delta_t));
if (legacySimulatorData_->constr)
{
builder->add<ConstraintsElement<ConstraintVariable::Positions>>();
builder->add<ComputeGlobalsElement<ComputeGlobalsAlgorithm::VelocityVerlet>>();
if (legacySimulatorData_->inputrec->epc == PressureCoupling::ParrinelloRahman)
{
- builder->add<ParrinelloRahmanBarostat>(-1, PropagatorTag("VelocityHalfStep"));
+ builder->add<ParrinelloRahmanBarostat>(Offset(-1), PropagatorTag("VelocityHalfStep"));
}
}
else
const std::string name_;
};
+/*! \internal
+ * \brief Strong type used to denote propagation time steps
+ */
+struct TimeStep
+{
+ //! Explicit constructor
+ explicit TimeStep(real timeStep) : timeStep_(timeStep) {}
+ //! Can be used as underlying type
+ operator const real&() const { return timeStep_; }
+
+private:
+ //! The time step
+ real timeStep_;
+};
+
+/*! \internal
+ * \brief Strong type used to denote scheduling offsets
+ */
+struct Offset
+{
+ //! Explicit constructor
+ explicit Offset(int offset) : offset_(offset) {}
+ //! Can be used as underlying type
+ operator const int&() const { return offset_; }
+
+private:
+ //! The offset
+ int offset_;
+};
+
/*! \internal
* \brief Information needed to connect a propagator to a thermostat
*/
FreeEnergyPerturbationData gmx_unused* freeEnergyPerturbationData,
GlobalCommunicationHelper gmx_unused* globalCommunicationHelper,
const PropagatorTag& propagatorTag,
- double timestep)
+ TimeStep timestep)
{
GMX_RELEASE_ASSERT(!(integrationStage == IntegrationStage::ScaleVelocities
|| integrationStage == IntegrationStage::ScalePositions)
freeEnergyPerturbationData,
globalCommunicationHelper,
propagatorTag,
- 0.0);
+ TimeStep(0.0));
}
//! \endcond