Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
196 stars 56 forks source link

Fix restarting mwABF simulations #686

Closed jhenin closed 1 month ago

jhenin commented 2 months ago

Fixes #685

jhenin commented 1 month ago

About history_last_step: I can move the initialization to the class declaration, but it would look strange as it would be the only variable initialized there. I'm in favor of doing that systematically, but that would count as refactoring and would perhaps deserve a PR of its own. Or was there a specific reason to not have it in init()? I think it would be functionally equivalent because init() is called only once for each instance.

giacomofiorin commented 1 month ago

About history_last_step: I can move the initialization to the class declaration, but it would look strange as it would be the only variable initialized there. I'm in favor of doing that systematically, but that would count as refactoring and would perhaps deserve a PR of its own. Or was there a specific reason to not have it in init()? I think it would be functionally equivalent because init() is called only once for each instance.

Sounds okay to me. The main reason to do differently is to minimize the chance of initialize data before init() is called, which is unlikely if not impossible now. I did say it was a nitpick :-)