colvars icon indicating copy to clipboard operation
colvars copied to clipboard

Remember first step of moving restraint

Open jhenin opened this issue 2 years ago • 2 comments

This is needed for correct handling of moving restraints (continuous, using targetNumSteps) that don't begin at step 0.

jhenin avatar Jul 08 '22 09:07 jhenin

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?

jhenin avatar Jul 08 '22 12:07 jhenin

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.

giacomofiorin avatar Jul 08 '22 16:07 giacomofiorin

Freshly rebased onto master. Provided that the tests pass, I'll request a final review @giacomofiorin

jhenin avatar Sep 08 '22 16:09 jhenin

Well, after fixing my oversight, we have passing tests! Ready for merging IMO.

jhenin avatar Sep 09 '22 15:09 jhenin

@giacomofiorin followed your advice and moved the test into the update_* functions

jhenin avatar Sep 23 '22 21:09 jhenin