Apply clang-format to source tree
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / readpull.cpp
index d87bb5c155e4ede5e552ba3d535ebebc083f4471..238aca95ca14c9def421e65878e08372c1316f96 100644 (file)
@@ -68,8 +68,7 @@ static void string2dvec(const char buf[], dvec nums)
     }
 }
 
-static void init_pull_group(t_pull_group *pg,
-                            const char   *wbuf)
+static void init_pull_group(t_pull_group* pg, const char* wbuf)
 {
     double d;
     int    n;
@@ -79,17 +78,17 @@ static void init_pull_group(t_pull_group *pg,
     {
         if (pg->nweight % 100 == 0)
         {
-            srenew(pg->weight, pg->nweight+100);
+            srenew(pg->weight, pg->nweight + 100);
         }
         pg->weight[pg->nweight++] = d;
         wbuf += n;
     }
 }
 
-static void process_pull_dim(char *dim_buf, ivec dim, const t_pull_coord *pcrd)
+static void process_pull_dim(char* dim_buf, ivec dim, const t_pull_coord* pcrd)
 {
-    int           ndim, d, nchar;
-    char         *ptr, pulldim1[STRLEN];
+    int   ndim, d, nchar;
+    char *ptr, pulldim1[STRLEN];
 
     ptr  = dim_buf;
     ndim = 0;
@@ -97,8 +96,7 @@ static void process_pull_dim(char *dim_buf, ivec dim, const t_pull_coord *pcrd)
     {
         if (sscanf(ptr, "%s%n", pulldim1, &nchar) != 1)
         {
-            gmx_fatal(FARGS, "Less than 3 pull dimensions given in pull_dim: '%s'",
-                      dim_buf);
+            gmx_fatal(FARGS, "Less than 3 pull dimensions given in pull_dim: '%s'", dim_buf);
         }
 
         if (gmx::equalCaseInsensitive(pulldim1, "N", 1))
@@ -112,8 +110,7 @@ static void process_pull_dim(char *dim_buf, ivec dim, const t_pull_coord *pcrd)
         }
         else
         {
-            gmx_fatal(FARGS, "Please use Y(ES) or N(O) for pull_dim only (not %s)",
-                      pulldim1);
+            gmx_fatal(FARGS, "Please use Y(ES) or N(O) for pull_dim only (not %s)", pulldim1);
         }
         ptr += nchar;
     }
@@ -125,47 +122,52 @@ static void process_pull_dim(char *dim_buf, ivec dim, const t_pull_coord *pcrd)
     {
         gmx_fatal(FARGS, "Pull geometry dihedral is only useful with pull-dim = Y Y Y");
     }
-    if ((pcrd->eGeom == epullgANGLE || pcrd->eGeom == epullgANGLEAXIS ) && (ndim < 2))
+    if ((pcrd->eGeom == epullgANGLE || pcrd->eGeom == epullgANGLEAXIS) && (ndim < 2))
     {
-        gmx_fatal(FARGS, "Pull geometry %s is only useful with pull-dim = Y for at least 2 dimensions",
+        gmx_fatal(FARGS,
+                  "Pull geometry %s is only useful with pull-dim = Y for at least 2 dimensions",
                   EPULLGEOM(pcrd->eGeom));
     }
 }
 
-static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
-                            char *dim_buf,
-                            const char *origin_buf, const char *vec_buf,
-                            warninp_t wi)
+static void init_pull_coord(t_pull_coord* pcrd,
+                            int           coord_index_for_output,
+                            char*         dim_buf,
+                            const char*   origin_buf,
+                            const char*   vec_buf,
+                            warninp_t     wi)
 {
-    int    m;
-    dvec   origin, vec;
-    char   buf[STRLEN];
+    int  m;
+    dvec origin, vec;
+    char buf[STRLEN];
 
-    if (pcrd->eType == epullCONSTRAINT && (pcrd->eGeom == epullgCYL ||
-                                           pcrd->eGeom == epullgDIRRELATIVE ||
-                                           pcrd->eGeom == epullgANGLE ||
-                                           pcrd->eGeom == epullgANGLEAXIS ||
-                                           pcrd->eGeom == epullgDIHEDRAL))
+    if (pcrd->eType == epullCONSTRAINT
+        && (pcrd->eGeom == epullgCYL || pcrd->eGeom == epullgDIRRELATIVE || pcrd->eGeom == epullgANGLE
+            || pcrd->eGeom == epullgANGLEAXIS || pcrd->eGeom == epullgDIHEDRAL))
     {
-        gmx_fatal(FARGS, "Pulling of type %s can not be combined with geometry %s. Consider using pull type %s.",
-                  epull_names[pcrd->eType],
-                  epullg_names[pcrd->eGeom],
-                  epull_names[epullUMBRELLA]);
+        gmx_fatal(FARGS,
+                  "Pulling of type %s can not be combined with geometry %s. Consider using pull "
+                  "type %s.",
+                  epull_names[pcrd->eType], epullg_names[pcrd->eGeom], epull_names[epullUMBRELLA]);
     }
 
     if (pcrd->eType == epullEXTERNAL)
     {
         if (pcrd->externalPotentialProvider[0] == '\0')
         {
-            sprintf(buf, "The use of pull type '%s' for pull coordinate %d requires that the name of the module providing the potential external is set with the option %s%d%s",
-                    epull_names[pcrd->eType], coord_index_for_output,
-                    "pull-coord", coord_index_for_output, "-potential-provider");
+            sprintf(buf,
+                    "The use of pull type '%s' for pull coordinate %d requires that the name of "
+                    "the module providing the potential external is set with the option %s%d%s",
+                    epull_names[pcrd->eType], coord_index_for_output, "pull-coord",
+                    coord_index_for_output, "-potential-provider");
             warning_error(wi, buf);
         }
 
         if (pcrd->rate != 0)
         {
-            sprintf(buf, "The use of pull type '%s' for pull coordinate %d requires that the pull rate is zero",
+            sprintf(buf,
+                    "The use of pull type '%s' for pull coordinate %d requires that the pull rate "
+                    "is zero",
                     epull_names[pcrd->eType], coord_index_for_output);
             warning_error(wi, buf);
         }
@@ -175,7 +177,10 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
             /* Warn the user of a PBC restriction, caused by the fact that
              * there is no reference value with an external pull potential.
              */
-            sprintf(buf, "With pull type '%s' and geometry '%s', the distance component along the cylinder axis between atoms in the cylinder group and the COM of the pull group should be smaller than half the box length",
+            sprintf(buf,
+                    "With pull type '%s' and geometry '%s', the distance component along the "
+                    "cylinder axis between atoms in the cylinder group and the COM of the pull "
+                    "group should be smaller than half the box length",
                     epull_names[pcrd->eType], epullg_names[pcrd->eGeom]);
             warning_note(wi, buf);
         }
@@ -194,8 +199,11 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
     {
         if (pcrd->bStart && pcrd->init < 0)
         {
-            sprintf(buf, "The initial reference distance set by pull-coord-init is set to a negative value (%g) with geometry %s while distances need to be non-negative. "
-                    "This may work, since you have set pull-coord-start to 'yes' which modifies this value, but only for certain starting distances. "
+            sprintf(buf,
+                    "The initial reference distance set by pull-coord-init is set to a negative "
+                    "value (%g) with geometry %s while distances need to be non-negative. "
+                    "This may work, since you have set pull-coord-start to 'yes' which modifies "
+                    "this value, but only for certain starting distances. "
                     "If this is a mistake you may want to use geometry %s instead.",
                     pcrd->init, EPULLGEOM(pcrd->eGeom), EPULLGEOM(epullgDIR));
             warning(wi, buf);
@@ -206,8 +214,11 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
         if (pcrd->bStart && (pcrd->init < 0 || pcrd->init > 180))
         {
             /* This value of pcrd->init may be ok depending on pcrd->bStart which modifies pcrd->init later on */
-            sprintf(buf, "The initial reference angle set by pull-coord-init (%g) is outside of the allowed range [0, 180] degrees for geometry (%s). "
-                    "This may work, since you have set pull-coord-start to 'yes' which modifies this value, but only for certain starting angles.",
+            sprintf(buf,
+                    "The initial reference angle set by pull-coord-init (%g) is outside of the "
+                    "allowed range [0, 180] degrees for geometry (%s). "
+                    "This may work, since you have set pull-coord-start to 'yes' which modifies "
+                    "this value, but only for certain starting angles.",
                     pcrd->init, EPULLGEOM(pcrd->eGeom));
             warning(wi, buf);
         }
@@ -216,8 +227,11 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
     {
         if (pcrd->bStart && (pcrd->init < -180 || pcrd->init > 180))
         {
-            sprintf(buf, "The initial reference angle set by pull-coord-init (%g) is outside of the allowed range [-180, 180] degrees for geometry (%s). "
-                    "This may work, since you have set pull-coord-start to 'yes' which modifies this value, but only for certain starting angles.",
+            sprintf(buf,
+                    "The initial reference angle set by pull-coord-init (%g) is outside of the "
+                    "allowed range [-180, 180] degrees for geometry (%s). "
+                    "This may work, since you have set pull-coord-start to 'yes' which modifies "
+                    "this value, but only for certain starting angles.",
                     pcrd->init, EPULLGEOM(pcrd->eGeom));
             warning(wi, buf);
         }
@@ -227,7 +241,8 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
     clear_dvec(vec);
     string2dvec(vec_buf, vec);
 
-    if (pcrd->eGeom == epullgDIR || pcrd->eGeom == epullgCYL || pcrd->eGeom == epullgDIRPBC || pcrd->eGeom == epullgANGLEAXIS)
+    if (pcrd->eGeom == epullgDIR || pcrd->eGeom == epullgCYL || pcrd->eGeom == epullgDIRPBC
+        || pcrd->eGeom == epullgANGLEAXIS)
     {
         if (dnorm2(vec) == 0)
         {
@@ -238,18 +253,23 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
         {
             if (vec[d] != 0 && pcrd->dim[d] == 0)
             {
-                gmx_fatal(FARGS, "pull-coord-vec has non-zero %c-component while pull_dim for the %c-dimension is set to N", 'x'+d, 'x'+d);
+                gmx_fatal(FARGS,
+                          "pull-coord-vec has non-zero %c-component while pull_dim for the "
+                          "%c-dimension is set to N",
+                          'x' + d, 'x' + d);
             }
         }
 
         /* Normalize the direction vector */
-        dsvmul(1/dnorm(vec), vec, vec);
+        dsvmul(1 / dnorm(vec), vec, vec);
     }
     else /* This case is for are all the geometries where the pull vector is not used */
     {
         if (dnorm2(vec) > 0)
         {
-            sprintf(buf, "A pull vector is given (%g  %g  %g) but will not be used with geometry %s. If you really want to use this "
+            sprintf(buf,
+                    "A pull vector is given (%g  %g  %g) but will not be used with geometry %s. If "
+                    "you really want to use this "
                     "vector, consider using geometry %s instead.",
                     vec[0], vec[1], vec[2], EPULLGEOM(pcrd->eGeom),
                     pcrd->eGeom == epullgANGLE ? EPULLGEOM(epullgANGLEAXIS) : EPULLGEOM(epullgDIR));
@@ -263,28 +283,26 @@ static void init_pull_coord(t_pull_coord *pcrd, int coord_index_for_output,
     }
 }
 
-char **read_pullparams(std::vector<t_inpfile> *inp,
-                       pull_params_t          *pull,
-                       warninp_t               wi)
+char** read_pullparams(std::vector<t_inpfile>* inp, pull_params_t* pull, warninp_t wi)
 {
-    int                    nscan, idum;
-    char                 **grpbuf;
-    char                   buf[STRLEN];
-    char                   provider[STRLEN], groups[STRLEN], dim_buf[STRLEN];
-    char                   wbuf[STRLEN], origin_buf[STRLEN], vec_buf[STRLEN];
+    int    nscan, idum;
+    char** grpbuf;
+    char   buf[STRLEN];
+    char   provider[STRLEN], groups[STRLEN], dim_buf[STRLEN];
+    char   wbuf[STRLEN], origin_buf[STRLEN], vec_buf[STRLEN];
 
-    t_pull_group          *pgrp;
-    t_pull_coord          *pcrd;
+    t_pull_grouppgrp;
+    t_pull_coordpcrd;
 
     /* read pull parameters */
     printStringNoNewline(inp, "Cylinder radius for dynamic reaction force groups (nm)");
-    pull->cylinder_r              = get_ereal(inp, "pull-cylinder-r", 1.5, wi);
-    pull->constr_tol              = get_ereal(inp, "pull-constr-tol", 1E-6, wi);
-    pull->bPrintCOM               = (get_eeenum(inp, "pull-print-com", yesno_names, wi) != 0);
-    pull->bPrintRefValue          = (get_eeenum(inp, "pull-print-ref-value", yesno_names, wi) != 0);
-    pull->bPrintComp              = (get_eeenum(inp, "pull-print-components", yesno_names, wi) != 0);
-    pull->nstxout                 = get_eint(inp, "pull-nstxout", 50, wi);
-    pull->nstfout                 = get_eint(inp, "pull-nstfout", 50, wi);
+    pull->cylinder_r     = get_ereal(inp, "pull-cylinder-r", 1.5, wi);
+    pull->constr_tol     = get_ereal(inp, "pull-constr-tol", 1E-6, wi);
+    pull->bPrintCOM      = (get_eeenum(inp, "pull-print-com", yesno_names, wi) != 0);
+    pull->bPrintRefValue = (get_eeenum(inp, "pull-print-ref-value", yesno_names, wi) != 0);
+    pull->bPrintComp     = (get_eeenum(inp, "pull-print-components", yesno_names, wi) != 0);
+    pull->nstxout        = get_eint(inp, "pull-nstxout", 50, wi);
+    pull->nstfout        = get_eint(inp, "pull-nstfout", 50, wi);
     pull->bSetPbcRefToPrevStepCOM = (get_eeenum(inp, "pull-pbc-ref-prev-step-com", yesno_names, wi) != 0);
     pull->bXOutAverage            = (get_eeenum(inp, "pull-xout-average", yesno_names, wi) != 0);
     pull->bFOutAverage            = (get_eeenum(inp, "pull-fout-average", yesno_names, wi) != 0);
@@ -346,22 +364,19 @@ char **read_pullparams(std::vector<t_inpfile> *inp,
 
         switch (pcrd->eGeom)
         {
-            case epullgDIHEDRAL:
-                pcrd->ngroup = 6; break;
+            case epullgDIHEDRAL: pcrd->ngroup = 6; break;
             case epullgDIRRELATIVE:
-            case epullgANGLE:
-                pcrd->ngroup = 4; break;
-            default:
-                pcrd->ngroup = 2; break;
+            case epullgANGLE: pcrd->ngroup = 4; break;
+            default: pcrd->ngroup = 2; break;
         }
 
-        nscan = sscanf(groups, "%d %d %d %d %d %d %d",
-                       &pcrd->group[0], &pcrd->group[1], &pcrd->group[2], &pcrd->group[3],
-                       &pcrd->group[4], &pcrd->group[5], &idum);
+        nscan = sscanf(groups, "%d %d %d %d %d %d %d", &pcrd->group[0], &pcrd->group[1],
+                       &pcrd->group[2], &pcrd->group[3], &pcrd->group[4], &pcrd->group[5], &idum);
         if (nscan != pcrd->ngroup)
         {
-            auto message = gmx::formatString("%s should contain %d pull group indices with geometry %s",
-                                             buf, pcrd->ngroup, epullg_names[pcrd->eGeom]);
+            auto message =
+                    gmx::formatString("%s should contain %d pull group indices with geometry %s",
+                                      buf, pcrd->ngroup, epullg_names[pcrd->eGeom]);
             set_warning_line(wi, nullptr, -1);
             warning_error(wi, message);
         }
@@ -370,7 +385,8 @@ char **read_pullparams(std::vector<t_inpfile> *inp,
             if (pcrd->group[g] < 0 || pcrd->group[g] >= pull->ngroup)
             {
                 /* Quit with a fatal error to avoid invalid memory access */
-                gmx_fatal(FARGS, "%s contains an invalid pull group %d, you should have %d <= group <= %d",
+                gmx_fatal(FARGS,
+                          "%s contains an invalid pull group %d, you should have %d <= group <= %d",
                           buf, pcrd->group[g], 0, pull->ngroup - 1);
             }
         }
@@ -399,12 +415,10 @@ char **read_pullparams(std::vector<t_inpfile> *inp,
     return grpbuf;
 }
 
-void make_pull_groups(pull_params_t *pull,
-                      char **pgnames,
-                      const t_blocka *grps, char **gnames)
+void make_pull_groups(pull_params_t* pull, char** pgnames, const t_blocka* grps, char** gnames)
 {
     int           g, ig = -1, i;
-    t_pull_group *pgrp;
+    t_pull_grouppgrp;
 
     /* Absolute reference group (might not be used) is special */
     pgrp                = &pull->group[0];
@@ -423,10 +437,9 @@ void make_pull_groups(pull_params_t *pull,
         }
 
         ig        = search_string(pgnames[g], grps->nr, gnames);
-        pgrp->nat = grps->index[ig+1] - grps->index[ig];
+        pgrp->nat = grps->index[ig + 1] - grps->index[ig];
 
-        fprintf(stderr, "Pull group %d '%s' has %d atoms\n",
-                g, pgnames[g], pgrp->nat);
+        fprintf(stderr, "Pull group %d '%s' has %d atoms\n", g, pgnames[g], pgrp->nat);
 
         if (pgrp->nat == 0)
         {
@@ -436,12 +449,14 @@ void make_pull_groups(pull_params_t *pull,
         snew(pgrp->ind, pgrp->nat);
         for (i = 0; i < pgrp->nat; i++)
         {
-            pgrp->ind[i] = grps->a[grps->index[ig]+i];
+            pgrp->ind[i] = grps->a[grps->index[ig] + i];
         }
 
         if (pgrp->nweight > 0 && pgrp->nweight != pgrp->nat)
         {
-            gmx_fatal(FARGS, "Number of weights (%d) for pull group %d '%s' does not match the number of atoms (%d)",
+            gmx_fatal(FARGS,
+                      "Number of weights (%d) for pull group %d '%s' does not match the number of "
+                      "atoms (%d)",
                       pgrp->nweight, g, pgnames[g], pgrp->nat);
         }
 
@@ -458,7 +473,7 @@ void make_pull_groups(pull_params_t *pull,
             }
             else if (pgrp->pbcatom == 0)
             {
-                pgrp->pbcatom = pgrp->ind[(pgrp->nat-1)/2];
+                pgrp->pbcatom = pgrp->ind[(pgrp->nat - 1) / 2];
             }
             else
             {
@@ -469,51 +484,54 @@ void make_pull_groups(pull_params_t *pull,
     }
 }
 
-void make_pull_coords(pull_params_t *pull)
+void make_pull_coords(pull_params_tpull)
 {
     int           c;
-    t_pull_coord *pcrd;
+    t_pull_coordpcrd;
 
     for (c = 0; c < pull->ncoord; c++)
     {
         pcrd = &pull->coord[c];
 
-        if (pcrd->group[0] < 0 || pcrd->group[0] >= pull->ngroup ||
-            pcrd->group[1] < 0 || pcrd->group[1] >= pull->ngroup)
+        if (pcrd->group[0] < 0 || pcrd->group[0] >= pull->ngroup || pcrd->group[1] < 0
+            || pcrd->group[1] >= pull->ngroup)
         {
-            gmx_fatal(FARGS, "Pull group index in pull-coord%d-groups out of range, should be between %d and %d", c+1, 0, pull->ngroup+1);
+            gmx_fatal(FARGS,
+                      "Pull group index in pull-coord%d-groups out of range, should be between %d "
+                      "and %d",
+                      c + 1, 0, pull->ngroup + 1);
         }
 
         if (pcrd->group[0] == pcrd->group[1])
         {
-            gmx_fatal(FARGS, "Identical pull group indices in pull-coord%d-groups", c+1);
+            gmx_fatal(FARGS, "Identical pull group indices in pull-coord%d-groups", c + 1);
         }
 
         if (pcrd->eGeom == epullgCYL)
         {
             if (pull->group[pcrd->group[0]].nweight > 0)
             {
-                gmx_fatal(FARGS, "Weights are not supported for the reference group with cylinder pulling");
+                gmx_fatal(
+                        FARGS,
+                        "Weights are not supported for the reference group with cylinder pulling");
             }
         }
     }
 }
 
-pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
-                      rvec *x, matrix box, real lambda,
-                      warninp_t wi)
+pull_t* set_pull_init(t_inputrec* ir, const gmx_mtop_t* mtop, rvec* x, matrix box, real lambda, warninp_t wi)
 {
-    pull_params_t *pull;
-    pull_t        *pull_work;
+    pull_params_tpull;
+    pull_t*        pull_work;
     t_pbc          pbc;
     int            c;
     double         t_start;
 
-    pull      = ir->pull;
+    pull = ir->pull;
     gmx::LocalAtomSetManager atomSets;
-    pull_work = init_pull(nullptr, pull, ir, mtop, nullptr, &atomSets, lambda);
-    auto                     mdAtoms = gmx::makeMDAtoms(nullptr, *mtop, *ir, false);
-    auto                     md      = mdAtoms->mdatoms();
+    pull_work    = init_pull(nullptr, pull, ir, mtop, nullptr, &atomSets, lambda);
+    auto mdAtoms = gmx::makeMDAtoms(nullptr, *mtop, *ir, false);
+    auto md      = mdAtoms->mdatoms();
     atoms2md(mtop, ir, -1, nullptr, mtop->natoms, mdAtoms.get());
     if (ir->efep)
     {
@@ -522,7 +540,7 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
 
     set_pbc(&pbc, ir->ePBC, box);
 
-    t_start = ir->init_t + ir->init_step*ir->delta_t;
+    t_start = ir->init_t + ir->init_step * ir->delta_t;
 
     if (pull->bSetPbcRefToPrevStepCOM)
     {
@@ -532,44 +550,48 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
 
     for (int g = 0; g < pull->ngroup; g++)
     {
-        bool groupObeysPbc =
-            pullCheckPbcWithinGroup(*pull_work,
-                                    gmx::arrayRefFromArray(reinterpret_cast<gmx::RVec *>(x),
-                                                           mtop->natoms),
-                                    pbc, g, c_pullGroupSmallGroupThreshold);
+        bool groupObeysPbc = pullCheckPbcWithinGroup(
+                *pull_work, gmx::arrayRefFromArray(reinterpret_cast<gmx::RVec*>(x), mtop->natoms),
+                pbc, g, c_pullGroupSmallGroupThreshold);
         if (!groupObeysPbc)
         {
             char buf[STRLEN];
             if (pull->group[g].pbcatom_input == 0)
             {
-                sprintf(buf, "When the maximum distance from a pull group reference atom to other atoms in the "
+                sprintf(buf,
+                        "When the maximum distance from a pull group reference atom to other atoms "
+                        "in the "
                         "group is larger than %g times half the box size a centrally placed "
-                        "atom should be chosen as pbcatom. Pull group %d is larger than that and does not have "
-                        "a specific atom selected as reference atom.", c_pullGroupSmallGroupThreshold, g);
+                        "atom should be chosen as pbcatom. Pull group %d is larger than that and "
+                        "does not have "
+                        "a specific atom selected as reference atom.",
+                        c_pullGroupSmallGroupThreshold, g);
                 warning_error(wi, buf);
             }
             else if (!pull->bSetPbcRefToPrevStepCOM)
             {
-                sprintf(buf, "The maximum distance from the chosen PBC atom (%d) of pull group %d to other "
+                sprintf(buf,
+                        "The maximum distance from the chosen PBC atom (%d) of pull group %d to "
+                        "other "
                         "atoms in the group is larger than %g times half the box size. "
-                        "Set the pull-pbc-ref-prev-step-com option to yes.", pull->group[g].pbcatom + 1,
-                        g, c_pullGroupSmallGroupThreshold);
+                        "Set the pull-pbc-ref-prev-step-com option to yes.",
+                        pull->group[g].pbcatom + 1, g, c_pullGroupSmallGroupThreshold);
                 warning_error(wi, buf);
             }
         }
         if (groupObeysPbc)
         {
-            groupObeysPbc =
-                pullCheckPbcWithinGroup(*pull_work,
-                                        gmx::arrayRefFromArray(reinterpret_cast<gmx::RVec *>(x),
-                                                               mtop->natoms),
-                                        pbc, g, c_pullGroupPbcMargin);
+            groupObeysPbc = pullCheckPbcWithinGroup(
+                    *pull_work, gmx::arrayRefFromArray(reinterpret_cast<gmx::RVec*>(x), mtop->natoms),
+                    pbc, g, c_pullGroupPbcMargin);
             if (!groupObeysPbc)
             {
                 char buf[STRLEN];
                 sprintf(buf,
-                        "Pull group %d has atoms at a distance larger than %g times half the box size from the PBC atom (%d). "
-                        "If atoms are or will more beyond half the box size from the PBC atom, the COM will be ill defined.",
+                        "Pull group %d has atoms at a distance larger than %g times half the box "
+                        "size from the PBC atom (%d). "
+                        "If atoms are or will more beyond half the box size from the PBC atom, the "
+                        "COM will be ill defined.",
                         g, c_pullGroupPbcMargin, pull->group[g].pbcatom + 1);
                 set_warning_line(wi, nullptr, -1);
                 warning(wi, buf);
@@ -580,19 +602,17 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
     fprintf(stderr, "Pull group  natoms  pbc atom  distance at start  reference at t=0\n");
     for (c = 0; c < pull->ncoord; c++)
     {
-        t_pull_coord *pcrd;
+        t_pull_coordpcrd;
         t_pull_group *pgrp0, *pgrp1;
         double        value;
         real          init = 0;
 
-        pcrd  = &pull->coord[c];
+        pcrd = &pull->coord[c];
 
         pgrp0 = &pull->group[pcrd->group[0]];
         pgrp1 = &pull->group[pcrd->group[1]];
-        fprintf(stderr, "%8d  %8d  %8d\n",
-                pcrd->group[0], pgrp0->nat, pgrp0->pbcatom+1);
-        fprintf(stderr, "%8d  %8d  %8d ",
-                pcrd->group[1], pgrp1->nat, pgrp1->pbcatom+1);
+        fprintf(stderr, "%8d  %8d  %8d\n", pcrd->group[0], pgrp0->nat, pgrp0->pbcatom + 1);
+        fprintf(stderr, "%8d  %8d  %8d ", pcrd->group[1], pgrp1->nat, pgrp1->pbcatom + 1);
 
         if (pcrd->bStart)
         {
@@ -600,7 +620,7 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
             pcrd->init = 0;
         }
 
-        value  = get_pull_coord_value(pull_work, c, &pbc);
+        value = get_pull_coord_value(pull_work, c, &pbc);
 
         value *= pull_conversion_factor_internal2userinput(pcrd);
         fprintf(stderr, " %10.3f %s", value, pull_coordinate_units(pcrd));
@@ -614,7 +634,9 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
         {
             if (pcrd->init < 0)
             {
-                gmx_fatal(FARGS, "The initial pull distance (%g) needs to be non-negative with geometry %s. If you want a signed distance, use geometry %s instead.",
+                gmx_fatal(FARGS,
+                          "The initial pull distance (%g) needs to be non-negative with geometry "
+                          "%s. If you want a signed distance, use geometry %s instead.",
                           pcrd->init, EPULLGEOM(pcrd->eGeom), EPULLGEOM(epullgDIR));
             }
 
@@ -630,14 +652,19 @@ pull_t *set_pull_init(t_inputrec *ir, const gmx_mtop_t *mtop,
         {
             if (pcrd->init < 0 || pcrd->init > 180)
             {
-                gmx_fatal(FARGS,  "The initial pull reference angle (%g) is outside of the allowed range [0, 180] degrees.", pcrd->init);
+                gmx_fatal(FARGS,
+                          "The initial pull reference angle (%g) is outside of the allowed range "
+                          "[0, 180] degrees.",
+                          pcrd->init);
             }
         }
         else if (pcrd->eGeom == epullgDIHEDRAL)
         {
             if (pcrd->init < -180 || pcrd->init > 180)
             {
-                gmx_fatal(FARGS,  "The initial pull reference angle (%g) is outside of the allowed range [-180, 180] degrees.",
+                gmx_fatal(FARGS,
+                          "The initial pull reference angle (%g) is outside of the allowed range "
+                          "[-180, 180] degrees.",
                           pcrd->init);
             }
         }