Refactored pull data structures
[alexxy/gromacs.git] / src / gromacs / mdlib / sim_util.cpp
index fd4074dde3c7673e0bbe692ac9b196093a680b94..08bc5071d31d1557ee774831d27cda14ecd7328f 100644 (file)
@@ -332,7 +332,7 @@ static void pull_potential_wrapper(t_commrec *cr,
     set_pbc(&pbc, ir->ePBC, box);
     dvdl                     = 0;
     enerd->term[F_COM_PULL] +=
-        pull_potential(ir->pull, mdatoms, &pbc,
+        pull_potential(ir->pull_work, mdatoms, &pbc,
                        cr, t, lambda[efptRESTRAINT], x, f, vir_force, &dvdl);
     enerd->dvdl_lin[efptRESTRAINT] += dvdl;
     wallcycle_stop(wcycle, ewcPULLPOT);
@@ -1155,9 +1155,9 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         clear_rvec(fr->vir_diag_posres);
     }
 
-    if (inputrec->bPull && inputrec->pull->bConstraint)
+    if (inputrec->bPull && pull_have_constraint(inputrec->pull_work))
     {
-        clear_pull_forces(inputrec->pull);
+        clear_pull_forces(inputrec->pull_work);
     }
 
     /* We calculate the non-bonded forces, when done on the CPU, here.
@@ -1455,7 +1455,7 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
     }
 
-    if (inputrec->bPull && inputrec->pull->bPotential)
+    if (inputrec->bPull && pull_have_potential(inputrec->pull_work))
     {
         /* Since the COM pulling is always done mass-weighted, no forces are
          * applied to vsites and this call can be done after vsite spreading.
@@ -1798,9 +1798,9 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 
         clear_rvec(fr->vir_diag_posres);
     }
-    if (inputrec->bPull && inputrec->pull->bConstraint)
+    if (inputrec->bPull && pull_have_constraint(inputrec->pull_work))
     {
-        clear_pull_forces(inputrec->pull);
+        clear_pull_forces(inputrec->pull_work);
     }
 
     /* update QMMMrec, if necessary */
@@ -1919,7 +1919,7 @@ void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         }
     }
 
-    if (inputrec->bPull && inputrec->pull->bPotential)
+    if (inputrec->bPull && pull_have_potential(inputrec->pull_work))
     {
         pull_potential_wrapper(cr, inputrec, box, x,
                                f, vir_force, mdatoms, enerd, lambda, t,