git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8433 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2012-06-29 17:52:31 +00:00
parent 6795f0f3af
commit fee52f2fac
13 changed files with 412 additions and 134 deletions

View File

@ -26,6 +26,14 @@ colvarbias::colvarbias (std::string const &conf, char const *key)
get_keyval (conf, "name", name, key_str+cvm::to_str (rank));
for (std::vector<colvarbias *>::iterator bi = cvm::biases.begin();
bi != cvm::biases.end();
bi++) {
if ((*bi)->name == this->name)
cvm::fatal_error ("Error: this bias cannot have the same name, \""+this->name+
"\", of another bias.\n");
}
// lookup the associated colvars
std::vector<std::string> colvars_str;
if (get_keyval (conf, "colvars", colvars_str)) {
@ -78,7 +86,8 @@ void colvarbias::communicate_forces()
colvarbias_harmonic::colvarbias_harmonic (std::string const &conf,
char const *key)
: colvarbias (conf, key),
target_nsteps (0)
target_nsteps (0),
target_nstages (0)
{
get_keyval (conf, "forceConstant", force_k, 1.0);
for (size_t i = 0; i < colvars.size(); i++) {
@ -112,7 +121,6 @@ colvarbias_harmonic::colvarbias_harmonic (std::string const &conf,
if (get_keyval (conf, "targetCenters", target_centers, colvar_centers)) {
b_chg_centers = true;
target_nstages = 0;
for (size_t i = 0; i < target_centers.size(); i++) {
target_centers[i].apply_constraints();
}
@ -134,8 +142,6 @@ colvarbias_harmonic::colvarbias_harmonic (std::string const &conf,
if (lambda_schedule.size()) {
// There is one more lambda-point than stages
target_nstages = lambda_schedule.size() - 1;
} else {
target_nstages = 0;
}
} else {
b_chg_force_k = false;