| version 1.31 | version 1.32 |
|---|
| |
| lower_wall.type(value()); | lower_wall.type(value()); |
| get_keyval(conf, "lowerWall", lower_wall, lower_boundary); | get_keyval(conf, "lowerWall", lower_wall, lower_boundary); |
| lw_conf = std::string("\n\ | lw_conf = std::string("\n\ |
| harmonicWalls {\n\ | lowerWallConstant "+cvm::to_str(lower_wall_k*width*width)+"\n\ |
| name "+this->name+"lw\n\ | lowerWalls "+cvm::to_str(lower_wall)+"\n"); |
| colvars "+this->name+"\n\ | |
| forceConstant "+cvm::to_str(lower_wall_k*width*width)+"\n\ | |
| lowerWalls "+cvm::to_str(lower_wall)+"\n\ | |
| }\n"); | |
| cv->append_new_config(lw_conf); | |
| } | } |
| | |
| if (get_keyval(conf, "upperBoundary", upper_boundary, upper_boundary)) { | if (get_keyval(conf, "upperBoundary", upper_boundary, upper_boundary)) { |
| |
| upper_wall.type(value()); | upper_wall.type(value()); |
| get_keyval(conf, "upperWall", upper_wall, upper_boundary); | get_keyval(conf, "upperWall", upper_wall, upper_boundary); |
| uw_conf = std::string("\n\ | uw_conf = std::string("\n\ |
| harmonicWalls {\n\ | upperWallConstant "+cvm::to_str(upper_wall_k*width*width)+"\n\ |
| name "+this->name+"uw\n\ | upperWalls "+cvm::to_str(upper_wall)+"\n"); |
| colvars "+this->name+"\n\ | |
| forceConstant "+cvm::to_str(upper_wall_k*width*width)+"\n\ | |
| upperWalls "+cvm::to_str(upper_wall)+"\n\ | |
| }\n"); | |
| cv->append_new_config(uw_conf); | |
| } | } |
| | |
| if (lw_conf.size() && uw_conf.size()) { | if (lw_conf.size() && uw_conf.size()) { |
| |
| return INPUT_ERROR; | return INPUT_ERROR; |
| } | } |
| } | } |
| | |
| | if (lw_conf.size() || uw_conf.size()) { |
| | cvm::log("Generating a new harmonicWalls bias for compatibility purposes.\n"); |
| | std::string const walls_conf("\n\ |
| | harmonicWalls {\n\ |
| | name "+this->name+"w\n\ |
| | colvars "+this->name+"\n"+lw_conf+uw_conf+ |
| | "}\n"); |
| | cv->append_new_config(walls_conf); |
| | } |
| } | } |
| | |
| if (is_enabled(f_cv_lower_boundary)) { | if (is_enabled(f_cv_lower_boundary)) { |
| |
| cvm::to_str(x, cvm::cv_width, cvm::cv_prec)+".\n"); | cvm::to_str(x, cvm::cv_width, cvm::cv_prec)+".\n"); |
| | |
| if (after_restart) { | if (after_restart) { |
| after_restart = false; | |
| if (cvm::proxy->simulation_running()) { | if (cvm::proxy->simulation_running()) { |
| cvm::real const jump2 = dist2(x, x_restart) / (width*width); | cvm::real const jump2 = dist2(x, x_restart) / (width*width); |
| if (jump2 > 0.25) { | if (jump2 > 0.25) { |
| |
| | |
| // initialize the restraint center in the first step to the value | // initialize the restraint center in the first step to the value |
| // just calculated from the cvcs | // just calculated from the cvcs |
| // TODO: put it in the restart information | if (cvm::step_relative() == 0 && !after_restart) { |
| if (cvm::step_relative() == 0) { | |
| xr = x; | xr = x; |
| vr.reset(); // (already 0; added for clarity) | vr.reset(); // (already 0; added for clarity) |
| } | } |
| |
| ft_reported = ft; | ft_reported = ft; |
| } | } |
| | |
| | // At the end of the first update after a restart, we can reset the flag |
| | after_restart = false; |
| return COLVARS_OK; | return COLVARS_OK; |
| } | } |
| | |
| |
| if (is_enabled(f_cv_extended_Lagrangian)) { | if (is_enabled(f_cv_extended_Lagrangian)) { |
| | |
| if (cvm::debug()) { | if (cvm::debug()) { |
| cvm::log("Updating extended-Lagrangian degrees of freedom.\n"); | cvm::log("Updating extended-Lagrangian degree of freedom.\n"); |
| } | } |
| | |
| cvm::real dt = cvm::dt(); | cvm::real dt = cvm::dt(); |
| colvarvalue f_ext(fr.type()); | colvarvalue f_ext(fr.type()); // force acting on the extended variable |
| f_ext.reset(); | f_ext.reset(); |
| | |
| // the total force is applied to the fictitious mass, while the | // the total force is applied to the fictitious mass, while the |