colvars
colvars copied to clipboard
Remember first step of moving restraint
This is needed for correct handling of moving restraints (continuous, using targetNumSteps) that don't begin at step 0.
A VMD test fails with a segfault. Locally I can't replicate the segfault but I do get an error:
colvars: Error: trying to interpolate between two colvarvalues with a lamdba outside [0:1].
which is due to a negative lambda, because VMD does not guarantee that timestep numbers increase over time. Not sure how to handle this: generally speaking, time-dependent biases don't behave correctly in VMD in the overwhelming majority of cases. In the case of moving restraints, we have no information on the mapping between VMD frames and simulation timesteps, so there is no way to recover the right time dependence. Should time-dependent biases just freeze when simulation_running
is false?
I didn't look closely at that job, but in many cases it is spiff that segfaults when the differences are too big... :-/
I'm okay with turning those biases into static ones for VMD purposes.
Freshly rebased onto master. Provided that the tests pass, I'll request a final review @giacomofiorin
Well, after fixing my oversight, we have passing tests! Ready for merging IMO.
@giacomofiorin followed your advice and moved the test into the update_* functions