@@ -1455,7 +1455,7 @@ int colvar::collect_cvc_data()
14551455
14561456 int error_code = COLVARS_OK;
14571457
1458- if (cvm::main ()-> proxy -> total_forces_valid () && ( !is_enabled (f_cv_total_force_current_step) )) {
1458+ if (!is_enabled (f_cv_total_force_current_step)) {
14591459 // Total force depends on Jacobian derivative from previous timestep
14601460 // collect_cvc_total_forces() uses the previous value of jd
14611461 error_code |= collect_cvc_total_forces ();
@@ -1469,11 +1469,6 @@ int colvar::collect_cvc_data()
14691469 }
14701470 error_code |= calc_colvar_properties ();
14711471
1472- if (!cvm::main ()->proxy ->total_forces_valid ()) {
1473- // Zero out the colvar total force when atomic total forces are not available
1474- reset_total_force ();
1475- }
1476-
14771472 if (cvm::debug ())
14781473 cvm::log (" Done calculating colvar \" " +this ->name +" \" 's properties.\n " );
14791474
@@ -1688,24 +1683,26 @@ int colvar::collect_cvc_total_forces()
16881683
16891684 ft.reset ();
16901685
1691- for (size_t i = 0 ; i < cvcs.size (); i++) {
1692- if (!cvcs[i]->is_enabled ()) continue ;
1693- if (cvm::debug ())
1694- cvm::log (" Colvar component no. " +cvm::to_str (i+1 )+
1695- " within colvar \" " +this ->name +" \" has total force " +
1696- cvm::to_str ((cvcs[i])->total_force (),
1697- cvm::cv_width, cvm::cv_prec)+" .\n " );
1698- // linear combination is assumed
1699- ft += (cvcs[i])->total_force () * (cvcs[i])->sup_coeff / active_cvc_square_norm;
1700- }
1686+ if (cvm::main ()->proxy ->total_forces_valid ()) {
1687+ for (size_t i = 0 ; i < cvcs.size (); i++) {
1688+ if (!cvcs[i]->is_enabled ()) continue ;
1689+ if (cvm::debug ())
1690+ cvm::log (" Colvar component no. " +cvm::to_str (i+1 )+
1691+ " within colvar \" " +this ->name +" \" has total force " +
1692+ cvm::to_str ((cvcs[i])->total_force (),
1693+ cvm::cv_width, cvm::cv_prec)+" .\n " );
1694+ // linear combination is assumed
1695+ ft += (cvcs[i])->total_force () * (cvcs[i])->sup_coeff / active_cvc_square_norm;
1696+ }
17011697
1702- if (!(is_enabled (f_cv_hide_Jacobian) && is_enabled (f_cv_subtract_applied_force))) {
1703- // This is by far the most common case
1704- // Add the Jacobian force to the total force, and don't apply any silent
1705- // correction internally: biases such as colvarbias_abf will handle it
1706- // If f_cv_hide_Jacobian is enabled, a force of -fj is present in ft due to the
1707- // Jacobian-compensating force
1708- ft += fj;
1698+ if (!(is_enabled (f_cv_hide_Jacobian) && is_enabled (f_cv_subtract_applied_force))) {
1699+ // This is by far the most common case
1700+ // Add the Jacobian force to the total force, and don't apply any silent
1701+ // correction internally: biases such as colvarbias_abf will handle it
1702+ // If f_cv_hide_Jacobian is enabled, a force of -fj is present in ft due to the
1703+ // Jacobian-compensating force
1704+ ft += fj;
1705+ }
17091706 }
17101707 }
17111708
0 commit comments