-
Notifications
You must be signed in to change notification settings - Fork 56
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
Set target temperature through a common code path #513
Conversation
Trying to think of a possible use for an override... The only one that comes to mind is an annealing method that would be driven from Colvars. That seems distant and unlikely, so I'd keep a plain setter for now, for simplicity. If the need arises to override it, making it virtual will be an easy change.
I think a getter would be useful too. The function could be called |
9f66b59
to
070c042
Compare
May be useful to dynamically redefine unit system, but at the moment other parameters need redefinition, e.g. angstrom_value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have 2 comments but otherwise it's looks good on the gromacs side
// From Gnu units | ||
// $ units -ts 'k' 'kJ/mol/K/avogadro' | ||
// 0.0083144621 | ||
boltzmann_ = 0.0083144621; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be worth using the GROMACS constant here: see gmx::c_boltz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we always write the number before but we could benefit from the PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HubLot I couldn't the definition of c_boltz
anywhere. Is it auto-generated? I tried guessing from what similar source files include.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay so:
- for 2020 & 2021:
#include "gromacs/math/units.h"
withBOLTZ
as a name (withoutgmx::
) - for 2022:
#include "gromacs/math/units.h"
withgmx::c_boltz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't catch they changed the constant name in 2022 and above :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay this works. Thanks!
8742d86
to
fb165ee
Compare
Trying VMD...
Hmmm... This will need a little fix. |
and remove now unused backend_angstrom_value()
and kcal_mol_value, which is unused but preserved for completeness
c852bdf
to
61e38cf
Compare
Force-pushed an update because of malicious behavior of multi-file search in VS Code, intentionally missing Gromacs files. |
@@ -2107,18 +2107,6 @@ int cvm::load_coords_xyz(char const *filename, | |||
// Wrappers to proxy functions: these may go in the future |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"these may go in the future": Is this the right time to get rid of the other wrapper functions below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, but in another PR. #487 is an example where tidying things up ended up in the way of finishing a specific task.
...or not. Remember that in VMD it is the caller's responsibility to initialize class members? :-) |
|
This update consists exclusively of bugfixes or maintenance-related changes. The following is a list of pull requests in the Colvars repository since the previous update to LAMMPS: - 532 Add XYZ trajectory reading feature Colvars/colvars#532 (@jhenin, @giacomofiorin) - 531 Delete objects quietly, unless explicitly requested via script (including VMD) Colvars/colvars#531 (@giacomofiorin) - 530 Append newline to log and error messages if not already present Colvars/colvars#530 (@giacomofiorin) - 528 Forward-declare OpenMP lock Colvars/colvars#528 (@giacomofiorin) - 527 Remove unneeded STL container Colvars/colvars#527 (@giacomofiorin) - 526 Allow collecting configuration files and strings before setting up interface Colvars/colvars#526 (@giacomofiorin, @jhenin) - 523 Fallback to linearCombination when customFunction is missing in customColvar Colvars/colvars#523 (@HanatoK, @giacomofiorin) - 522 Use iostream::fail() to check for I/O error Colvars/colvars#522 (@jhenin) - 520 Fix ref count Colvars/colvars#520 (@giacomofiorin) - 513 Set target temperature through a common code path Colvars/colvars#513 (@giacomofiorin, @jhenin) - 509 Safer detection of Windows with recent Microsoft Visual Studio versions Colvars/colvars#509 (@akohlmey) - 508 Update LAMMPS patching method to reflect Lepton availability Colvars/colvars#508 (@giacomofiorin) - 497 Increase the precision of write_multicol Colvars/colvars#497 (@HanatoK) - 496 Only perform MTS automatic enable/disable for timeStepFactor > 1 Colvars/colvars#496 (@giacomofiorin) - 493 Remove unused branch of quaternion input function Colvars/colvars#493 (@giacomofiorin) - 489 Ensure there are spaces between the fields in the header Colvars/colvars#489 (@HanatoK) - 487 Use map of output streams, and return references to its elements Colvars/colvars#487 (@giacomofiorin, @jhenin) - 486 Remember first step of moving restraint Colvars/colvars#486 (@jhenin) - 485 Add decoupling option for moving restraints Colvars/colvars#485 (@jhenin) - 483 Update Lepton via patching procedure Colvars/colvars#483 (@giacomofiorin) - 481 Make file-reading operations of input data abstractable Colvars/colvars#481 (@giacomofiorin) Authors: @akohlmey, @giacomofiorin, @HanatoK, @jhenin
Minimize divergences between MD engines by storing the target temperature in a proxy member and provide a shared function
set_target_temperature()
to set it. The previous virtual functiontemperature()
is now aconst
accessortarget_temperature()
.Additionally, there is now a script method
settemperature
targettemperature
to set it in scripts, i.e. in post-processing or when we are temporarily unable to get it from the MD engine (see e.g. #218).Questions:Shouldset_target_temperature()
bevirtual
or just remain a plain setter?Name of the script function (settemperature ->
settargettemperature`)?