added Verlet scheme and NxN non-bonded functionality
[alexxy/gromacs.git] / src / tools / gmx_pme_error.c
index 66fb961f03a2562ae2626eb13894c9efd641c426..1e7c59082fa909b2e7d95abb6bac2f4b09b4483a 100644 (file)
@@ -788,8 +788,9 @@ static void create_info(t_inputinfo *info)
  */
 static int prepare_x_q(real *q[], rvec *x[], gmx_mtop_t *mtop, rvec x_orig[], t_commrec *cr)
 {
-    int i,anr_global;
+    int i;
     int nq; /* number of charged particles */
+    gmx_mtop_atomloop_all_t aloop;
     t_atom *atom;
     
     
@@ -798,10 +799,11 @@ static int prepare_x_q(real *q[], rvec *x[], gmx_mtop_t *mtop, rvec x_orig[], t_
         snew(*q, mtop->natoms);
         snew(*x, mtop->natoms);
         nq=0;
-        for (i=0; i<mtop->natoms; i++)
+
+        aloop = gmx_mtop_atomloop_all_init(mtop);
+
+        while (gmx_mtop_atomloop_all_next(aloop,&i,&atom))
         {
-            anr_global = i;
-            gmx_mtop_atomnr_to_atom(mtop,anr_global,&atom);
             if (is_charge(atom->q))
             {
                 (*q)[nq] = atom->q;