-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix several issues preventing reading state from LAMMPS restart file #579
Conversation
895cc49
to
ddea477
Compare
ddea477
to
eb9b6b1
Compare
Looks good. Why is the new function |
It just rewinds the string stream to allow future reads (as when the files are read as strings embedded in a TPR file), but then the condition below remains true, and the input state string keeps being loaded every time Lines 1313 to 1320 in 0a997fc
The above is clearly an issue that needs to be fixed, either by adding a new function (as in this case) or a separate flag that is activated once and deactivated after the state is read. This is where a second set of eyes is most helpful ;-) |
With both NAMD and LAMMPS now allowing to first initialize Colvars after a simulation has begun (initial step > 0), it's getting harder to get everything right for moving restraints that require knowledge of the step when they were first defined (see #486).
This PR fixes this behavior by recording that number as
firstStep
and embedding it in the state file.For LAMMPS specifically, this now works both with a Colvars state file provided via the
input
keyword or by the LAMMPS binary restart file.