Update Colvars library to version 2019-04-26
The following is list of relevant issues fixed and improvements: Fix forces and missing output of runtime histogram for histogramRestraint https://github.com/Colvars/colvars/pull/246 Use fix_modify to add configuration to Colvars: https://github.com/Colvars/colvars/pull/216 Fix componentCoeff and name not working with orientationAngle components: https://github.com/Colvars/colvars/issues/213 Fix 1-timestep offset with extendedLagrangian: https://github.com/Colvars/colvars/pull/210 Changes to improve compiler support: https://github.com/Colvars/colvars/pull/203 Fix ignored anisotropic cutoff3 for groupCoordNum: https://github.com/Colvars/colvars/pull/202 New dipoleMagnitude variable: https://github.com/Colvars/colvars/pull/198 Parser improvements: https://github.com/Colvars/colvars/pull/196
This commit is contained in:
@ -137,6 +137,10 @@ int colvarscript::run(int objc, unsigned char *const objv[])
|
||||
|
||||
if (cmd == "update") {
|
||||
error_code |= proxy->update_input();
|
||||
if (error_code) {
|
||||
result += "Error updating the Colvars module.\n";
|
||||
return error_code;
|
||||
}
|
||||
error_code |= colvars->calc();
|
||||
error_code |= proxy->update_output();
|
||||
if (error_code) {
|
||||
@ -273,6 +277,10 @@ int colvarscript::run(int objc, unsigned char *const objv[])
|
||||
|
||||
int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) {
|
||||
|
||||
if (objc < 3) {
|
||||
result = "Missing arguments";
|
||||
return COLVARSCRIPT_ERROR;
|
||||
}
|
||||
std::string const subcmd(obj_to_str(objv[2]));
|
||||
|
||||
if (subcmd == "value") {
|
||||
@ -323,6 +331,47 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[])
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
if (subcmd == "getatomgroups") {
|
||||
std::vector<std::vector<int> > lists = cv->get_atom_lists();
|
||||
std::vector<std::vector<int> >::iterator li = lists.begin();
|
||||
|
||||
for ( ; li != lists.end(); ++li) {
|
||||
result += "{";
|
||||
std::vector<int>::iterator lj = (*li).begin();
|
||||
for ( ; lj != (*li).end(); ++lj) {
|
||||
result += cvm::to_str(*lj);
|
||||
result += " ";
|
||||
}
|
||||
result += "} ";
|
||||
}
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
if (subcmd == "getatomids") {
|
||||
std::vector<int>::iterator li = cv->atom_ids.begin();
|
||||
|
||||
for ( ; li != cv->atom_ids.end(); ++li) {
|
||||
result += cvm::to_str(*li);
|
||||
result += " ";
|
||||
}
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
if (subcmd == "getgradients") {
|
||||
std::vector<cvm::rvector>::iterator li = cv->atomic_gradients.begin();
|
||||
|
||||
for ( ; li != cv->atomic_gradients.end(); ++li) {
|
||||
result += "{";
|
||||
int j;
|
||||
for (j = 0; j < 3; ++j) {
|
||||
result += cvm::to_str((*li)[j]);
|
||||
result += " ";
|
||||
}
|
||||
result += "} ";
|
||||
}
|
||||
return COLVARS_OK;
|
||||
}
|
||||
|
||||
if (subcmd == "getappliedforce") {
|
||||
result = (cv->applied_force()).to_simple_string();
|
||||
return COLVARS_OK;
|
||||
@ -410,6 +459,10 @@ int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[])
|
||||
|
||||
int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[]) {
|
||||
|
||||
if (objc < 3) {
|
||||
result = "Missing arguments";
|
||||
return COLVARSCRIPT_ERROR;
|
||||
}
|
||||
std::string const subcmd(obj_to_str(objv[2]));
|
||||
|
||||
if (subcmd == "energy") {
|
||||
|
||||
Reference in New Issue
Block a user