Update Colvars library to version 2023-05-01
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 https://github.com/Colvars/colvars/pull/532 (@jhenin, @giacomofiorin) - 531 Delete objects quietly, unless explicitly requested via script (including VMD) https://github.com/Colvars/colvars/pull/531 (@giacomofiorin) - 530 Append newline to log and error messages if not already present https://github.com/Colvars/colvars/pull/530 (@giacomofiorin) - 528 Forward-declare OpenMP lock https://github.com/Colvars/colvars/pull/528 (@giacomofiorin) - 527 Remove unneeded STL container https://github.com/Colvars/colvars/pull/527 (@giacomofiorin) - 526 Allow collecting configuration files and strings before setting up interface https://github.com/Colvars/colvars/pull/526 (@giacomofiorin, @jhenin) - 523 Fallback to linearCombination when customFunction is missing in customColvar https://github.com/Colvars/colvars/pull/523 (@HanatoK, @giacomofiorin) - 522 Use iostream::fail() to check for I/O error https://github.com/Colvars/colvars/pull/522 (@jhenin) - 520 Fix ref count https://github.com/Colvars/colvars/pull/520 (@giacomofiorin) - 513 Set target temperature through a common code path https://github.com/Colvars/colvars/pull/513 (@giacomofiorin, @jhenin) - 509 Safer detection of Windows with recent Microsoft Visual Studio versions https://github.com/Colvars/colvars/pull/509 (@akohlmey) - 508 Update LAMMPS patching method to reflect Lepton availability https://github.com/Colvars/colvars/pull/508 (@giacomofiorin) - 497 Increase the precision of write_multicol https://github.com/Colvars/colvars/pull/497 (@HanatoK) - 496 Only perform MTS automatic enable/disable for timeStepFactor > 1 https://github.com/Colvars/colvars/pull/496 (@giacomofiorin) - 493 Remove unused branch of quaternion input function https://github.com/Colvars/colvars/pull/493 (@giacomofiorin) - 489 Ensure there are spaces between the fields in the header https://github.com/Colvars/colvars/pull/489 (@HanatoK) - 487 Use map of output streams, and return references to its elements https://github.com/Colvars/colvars/pull/487 (@giacomofiorin, @jhenin) - 486 Remember first step of moving restraint https://github.com/Colvars/colvars/pull/486 (@jhenin) - 485 Add decoupling option for moving restraints https://github.com/Colvars/colvars/pull/485 (@jhenin) - 483 Update Lepton via patching procedure https://github.com/Colvars/colvars/pull/483 (@giacomofiorin) - 481 Make file-reading operations of input data abstractable https://github.com/Colvars/colvars/pull/481 (@giacomofiorin) Authors: @akohlmey, @giacomofiorin, @HanatoK, @jhenin
This commit is contained in:
@ -134,11 +134,19 @@ CVSCRIPT(cv_config,
|
||||
char const *conf_str =
|
||||
script->obj_to_str(script->get_module_cmd_arg(0, objc, objv));
|
||||
std::string const conf(conf_str);
|
||||
if (cvm::main()->read_config_string(conf) == COLVARS_OK) {
|
||||
return COLVARS_OK;
|
||||
script->proxy()->add_config("config", conf);
|
||||
if (script->proxy()->engine_ready()) {
|
||||
// Engine allows immediate initialization
|
||||
if ((script->proxy()->parse_module_config() |
|
||||
script->proxy()->setup()) == COLVARS_OK) {
|
||||
return COLVARS_OK;
|
||||
} else {
|
||||
script->add_error_msg("Error parsing configuration string");
|
||||
return COLVARSCRIPT_ERROR;
|
||||
}
|
||||
}
|
||||
script->add_error_msg("Error parsing configuration string");
|
||||
return COLVARSCRIPT_ERROR;
|
||||
// Engine not ready, config will be read during proxy->setup()
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_configfile,
|
||||
@ -146,13 +154,20 @@ CVSCRIPT(cv_configfile,
|
||||
1, 1,
|
||||
"conf_file : string - Path to configuration file",
|
||||
char const *conf_file_name =
|
||||
script->obj_to_str(script->get_module_cmd_arg(0, objc, objv));
|
||||
if (script->module()->read_config_file(conf_file_name) == COLVARS_OK) {
|
||||
return COLVARS_OK;
|
||||
} else {
|
||||
script->add_error_msg("Error parsing configuration file");
|
||||
return COLVARSCRIPT_ERROR;
|
||||
script->obj_to_str(script->get_module_cmd_arg(0, objc, objv));
|
||||
script->proxy()->add_config("configfile", std::string(conf_file_name));
|
||||
if (script->proxy()->engine_ready()) {
|
||||
// Engine allows immediate initialization
|
||||
if ((script->proxy()->parse_module_config() |
|
||||
script->proxy()->setup()) == COLVARS_OK) {
|
||||
return COLVARS_OK;
|
||||
} else {
|
||||
script->add_error_msg("Error parsing configuration file");
|
||||
return COLVARSCRIPT_ERROR;
|
||||
}
|
||||
}
|
||||
// Engine not ready, config will be read during proxy->setup()
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_delete,
|
||||
@ -309,6 +324,51 @@ CVSCRIPT(cv_getenergy,
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_getnumactiveatomgroups,
|
||||
"Get the number of atom groups that currently have positive ref counts\n"
|
||||
"count : integer - Total number of atom groups",
|
||||
0, 0,
|
||||
"",
|
||||
script->set_result_int(static_cast<int>(script->proxy()->get_num_active_atom_groups()));
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_getnumactiveatoms,
|
||||
"Get the number of atoms that currently have positive ref counts\n"
|
||||
"count : integer - Total number of atoms",
|
||||
0, 0,
|
||||
"",
|
||||
script->set_result_int(static_cast<int>(script->proxy()->get_num_active_atoms()));
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_getnumatoms,
|
||||
"Get the number of requested atoms, including those not in use now\n"
|
||||
"count : integer - Total number of atoms",
|
||||
0, 0,
|
||||
"",
|
||||
script->set_result_int(static_cast<int>(script->proxy()->get_atom_ids()->size()));
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_getstepabsolute,
|
||||
"Get the current step number of the simulation (including restarts)\n"
|
||||
"step : int - Absolute step number",
|
||||
0, 0,
|
||||
"",
|
||||
script->set_result_int(cvm::step_absolute());
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_getsteprelative,
|
||||
"Get the current step number from the start of this job\n"
|
||||
"step : int - Relative step number",
|
||||
0, 0,
|
||||
"",
|
||||
script->set_result_int(cvm::step_relative());
|
||||
return COLVARS_OK;
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_help,
|
||||
"Get the help string of the Colvars scripting interface\n"
|
||||
"help : string - Help string",
|
||||
@ -481,6 +541,7 @@ CVSCRIPT(cv_reset,
|
||||
"Delete all internal configuration",
|
||||
0, 0,
|
||||
"",
|
||||
cvm::log("Resetting the Collective Variables module.");
|
||||
return script->module()->reset();
|
||||
)
|
||||
|
||||
@ -516,6 +577,20 @@ CVSCRIPT(cv_savetostring,
|
||||
return script->module()->write_restart_string(script->modify_str_result());
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_targettemperature,
|
||||
"Get/set target temperature, overriding what the MD engine provides\n"
|
||||
"T : float - Current target temperature in K",
|
||||
0, 1,
|
||||
"T : float - New target temperature in K",
|
||||
char const *Targ =
|
||||
script->obj_to_str(script->get_module_cmd_arg(0, objc, objv));
|
||||
if (Targ == NULL) {
|
||||
return script->set_result_real(script->proxy()->target_temperature());
|
||||
} else {
|
||||
return script->proxy()->set_target_temperature(strtod(Targ, NULL));
|
||||
}
|
||||
)
|
||||
|
||||
CVSCRIPT(cv_units,
|
||||
"Get or set the current Colvars unit system\n"
|
||||
"units : string - The current unit system",
|
||||
|
||||
Reference in New Issue
Block a user