Evaluate enforced rotation potenial with Verlet, fixes #1155
authorCarsten Kutzner <ckutzne@gwdg.de>
Thu, 14 Mar 2013 10:37:36 +0000 (11:37 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 29 Apr 2013 18:59:42 +0000 (20:59 +0200)
Change-Id: I6231a9a6cd9cd4004d53b721922e5d9298af76a2

src/mdlib/sim_util.c

index 72251d78bbe2b7a4ac85f39245c8bb637c3bd3ee..e0797cdc0026302c5b77b8c3e11d4e6ece1c73f3 100644 (file)
@@ -1115,6 +1115,16 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
     }
 
+    if (inputrec->bRot)
+    {
+        /* Enforced rotation has its own cycle counter that starts after the collective
+         * coordinates have been communicated. It is added to ddCyclF to allow
+         * for proper load-balancing */
+        wallcycle_start(wcycle, ewcROT);
+        do_rotation(cr, inputrec, box, x, t, step, wcycle, bNS);
+        wallcycle_stop(wcycle, ewcROT);
+    }
+
     /* Start the force cycle counter.
      * This counter is stopped in do_forcelow_level.
      * No parallel communication should occur while this counter is running,
@@ -1423,6 +1433,14 @@ void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                                f, vir_force, mdatoms, enerd, lambda, t);
     }
 
+    /* Add the forces from enforced rotation potentials (if any) */
+    if (inputrec->bRot)
+    {
+        wallcycle_start(wcycle, ewcROTadd);
+        enerd->term[F_COM_PULL] += add_rot_forces(inputrec->rot, f, cr, step, t);
+        wallcycle_stop(wcycle, ewcROTadd);
+    }
+
     if (PAR(cr) && !(cr->duty & DUTY_PME))
     {
         /* In case of node-splitting, the PP nodes receive the long-range