Fixed shells with particle decomposition
[alexxy/gromacs.git] / src / mdlib / shellfc.c
index 0acd97530215a7272ad0a650b4fdbf98fef04497..c5cb07e29092e62b7d7b1d6044bf172d0b34e962 100644 (file)
@@ -1013,8 +1013,15 @@ int relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         }
         else
         {
-            cg0 = 0;
-            cg1 = top->cgs.nr;
+            if (PARTDECOMP(cr))
+            {
+                pd_cg_range(cr, &cg0, &cg1);
+            }
+            else
+            {
+                cg0 = 0;
+                cg1 = top->cgs.nr;
+            }
             put_charge_groups_in_box(fplog, cg0, cg1, fr->ePBC, state->box,
                                      &(top->cgs), state->x, fr->cg_cm);
         }