Skip to content

Commit 30d66a3

Browse files
committed
Feature fixes after PR review
- move step zero data test from colvarbias.cpp to ABF - properly test for driven external parameter
1 parent 31c5c7d commit 30d66a3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/colvar.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2560,7 +2560,7 @@ std::string const colvar::get_state_params() const
25602560
<< " x "
25612561
<< std::setprecision(cvm::cv_prec)
25622562
<< std::setw(cvm::cv_width);
2563-
if (is_enabled(f_cv_external)) {
2563+
if (is_enabled(f_cv_external) && is_enabled(f_cv_extended_Lagrangian)) {
25642564
// For an external colvar, x is one timestep in the future after integration
25652565
// write x at beginning of timestep
25662566
os << x_reported << "\n";

src/colvarbias.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ int colvarbias::init(std::string const &conf)
100100
colvar_values[i].type(colvars[i]->value().type());
101101
colvar_forces[i].type(colvar_values[i].type());
102102
previous_colvar_forces[i].type(colvar_values[i].type());
103-
if (!colvars[i]->is_enabled(f_cv_total_force_current_step)) {
104-
// If any colvar does not have current-step total force, then
105-
// we can't do step 0 data
106-
feature_states[f_cvb_step_zero_data].available = false;
107-
}
108103
}
109104

110105
output_prefix = cvm::output_prefix();

src/colvarbias_abf.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ int colvarbias_abf::init(std::string const &conf)
136136
enable(f_cvb_extended);
137137
}
138138

139+
if (!colvars[i]->is_enabled(f_cv_total_force_current_step)) {
140+
// If any colvar does not have current-step total force, then
141+
// we can't do step 0 data
142+
provide(f_cvb_step_zero_data, false);
143+
}
144+
139145
// Cannot mix and match coarse time steps with ABF because it gives
140146
// wrong total force averages - total force needs to be averaged over
141147
// every time step

0 commit comments

Comments
 (0)