Skip to content

Commit

Permalink
Feature fixes after PR review
Browse files Browse the repository at this point in the history
- move step zero data test from colvarbias.cpp to ABF
- properly test for driven external parameter
  • Loading branch information
jhenin committed Dec 16, 2024
1 parent 5e37f65 commit d6fc186
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/colvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@ std::string const colvar::get_state_params() const
<< " x "
<< std::setprecision(cvm::cv_prec)
<< std::setw(cvm::cv_width);
if (is_enabled(f_cv_external)) {
if (is_enabled(f_cv_external) && is_enabled(f_cv_extended_Lagrangian)) {
// For an external colvar, x is one timestep in the future after integration
// write x at beginning of timestep
os << x_reported << "\n";
Expand Down
5 changes: 0 additions & 5 deletions src/colvarbias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,6 @@ int colvarbias::init(std::string const &conf)
colvar_values[i].type(colvars[i]->value().type());
colvar_forces[i].type(colvar_values[i].type());
previous_colvar_forces[i].type(colvar_values[i].type());
if (!colvars[i]->is_enabled(f_cv_total_force_current_step)) {
// If any colvar does not have current-step total force, then
// we can't do step 0 data
feature_states[f_cvb_step_zero_data].available = false;
}
}

output_prefix = cvm::output_prefix();
Expand Down
6 changes: 6 additions & 0 deletions src/colvarbias_abf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ int colvarbias_abf::init(std::string const &conf)
enable(f_cvb_extended);
}

if (!colvars[i]->is_enabled(f_cv_total_force_current_step)) {
// If any colvar does not have current-step total force, then
// we can't do step 0 data
provide(f_cvb_step_zero_data, false);
}

// Cannot mix and match coarse time steps with ABF because it gives
// wrong total force averages - total force needs to be averaged over
// every time step
Expand Down

0 comments on commit d6fc186

Please sign in to comment.