Apply re-formatting to C++ in src/ tree.
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_densorder.cpp
index 0942cda75c196793ee994a10f7347ede56e58994..f512024c4d9b62e726cad0ee9cd6622cff6cb567 100644 (file)
@@ -184,8 +184,13 @@ static void density_in_time(const char*             fn,
             *yslices = 1;
         }
     }
-    fprintf(stderr, "\nDividing the box in %5d x %5d x %5d slices with binw %f along axis %d\n",
-            *xslices, *yslices, *zslices, bw, axis);
+    fprintf(stderr,
+            "\nDividing the box in %5d x %5d x %5d slices with binw %f along axis %d\n",
+            *xslices,
+            *yslices,
+            *zslices,
+            bw,
+            axis);
 
 
     /****Start trajectory processing***/
@@ -501,8 +506,8 @@ static void interfaces_txy(real****                Densmap,
 
         if (debug)
         {
-            xvg = xvgropen("DensprofileonZ.xvg", "Averaged Densityprofile on Z", "z[nm]",
-                           "Density[kg/m^3]", oenv);
+            xvg = xvgropen(
+                    "DensprofileonZ.xvg", "Averaged Densityprofile on Z", "z[nm]", "Density[kg/m^3]", oenv);
             for (k = 0; k < zslices; k++)
             {
                 fprintf(xvg, "%4f.3   %8f.4\n", k * binwidth, zDensavg[k]);
@@ -513,11 +518,9 @@ static void interfaces_txy(real****                Densmap,
         /*Fit average density in z over whole trajectory to obtain tentative fit-parameters in fit1 and fit2*/
 
         /*Fit 1st half of box*/
-        do_lmfit(zslices, zDensavg, sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE,
-                 effnERF, beginfit1, 8, nullptr);
+        do_lmfit(zslices, zDensavg, sigma1, binwidth, nullptr, startpoint, splitpoint, oenv, FALSE, effnERF, beginfit1, 8, nullptr);
         /*Fit 2nd half of box*/
-        do_lmfit(zslices, zDensavg, sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE,
-                 effnERF, beginfit2, 8, nullptr);
+        do_lmfit(zslices, zDensavg, sigma2, binwidth, nullptr, splitpoint, endpoint, oenv, FALSE, effnERF, beginfit2, 8, nullptr);
 
         /*Initialise the const arrays for storing the average fit parameters*/
         avgfit1 = beginfit1;
@@ -540,12 +543,34 @@ static void interfaces_txy(real****                Densmap,
                         fit2[k] = avgfit2[k];
                     }
                     /*Now fit and store in structures in row-major order int[n][i][j]*/
-                    do_lmfit(zslices, Densmap[n][i][j], sigma1, binwidth, nullptr, startpoint,
-                             splitpoint, oenv, FALSE, effnERF, fit1, 0, nullptr);
+                    do_lmfit(zslices,
+                             Densmap[n][i][j],
+                             sigma1,
+                             binwidth,
+                             nullptr,
+                             startpoint,
+                             splitpoint,
+                             oenv,
+                             FALSE,
+                             effnERF,
+                             fit1,
+                             0,
+                             nullptr);
                     int1[n][j + (yslices * i)]->Z = fit1[2];
                     int1[n][j + (yslices * i)]->t = fit1[3];
-                    do_lmfit(zslices, Densmap[n][i][j], sigma2, binwidth, nullptr, splitpoint,
-                             endpoint, oenv, FALSE, effnERF, fit2, 0, nullptr);
+                    do_lmfit(zslices,
+                             Densmap[n][i][j],
+                             sigma2,
+                             binwidth,
+                             nullptr,
+                             splitpoint,
+                             endpoint,
+                             oenv,
+                             FALSE,
+                             effnERF,
+                             fit2,
+                             0,
+                             nullptr);
                     int2[n][j + (yslices * i)]->Z = fit2[2];
                     int2[n][j + (yslices * i)]->t = fit2[3];
                 }
@@ -631,10 +656,8 @@ static void writesurftoxpms(t_interf***                      surf1,
             }
         }
 
-        write_xpm(xpmfile1, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks,
-                  profile1, min1, max1, lo, hi, &maplevels);
-        write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks,
-                  profile2, min2, max2, lo, hi, &maplevels);
+        write_xpm(xpmfile1, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile1, min1, max1, lo, hi, &maplevels);
+        write_xpm(xpmfile2, 3, numbuf, "Height", "x[nm]", "y[nm]", xbins, ybins, xticks, yticks, profile2, min2, max2, lo, hi, &maplevels);
     }
 
     gmx_ffclose(xpmfile1);
@@ -679,9 +702,17 @@ static void writeraw(t_interf***                      int1,
         {
             for (j = 0; j < ybins; j++)
             {
-                fprintf(raw1, "%i  %i  %8.5f  %6.4f\n", i, j, (int1[n][j + ybins * i])->Z,
+                fprintf(raw1,
+                        "%i  %i  %8.5f  %6.4f\n",
+                        i,
+                        j,
+                        (int1[n][j + ybins * i])->Z,
                         (int1[n][j + ybins * i])->t);
-                fprintf(raw2, "%i  %i  %8.5f  %6.4f\n", i, j, (int2[n][j + ybins * i])->Z,
+                fprintf(raw2,
+                        "%i  %i  %8.5f  %6.4f\n",
+                        i,
+                        j,
+                        (int2[n][j + ybins * i])->Z,
                         (int2[n][j + ybins * i])->t);
             }
         }
@@ -765,12 +796,9 @@ int gmx_densorder(int argc, char* argv[])
         { efTPR, "-s", nullptr, ffREAD }, /* this is for the topology */
         { efTRX, "-f", nullptr, ffREAD }, /* and this for the trajectory */
         { efNDX, "-n", nullptr, ffREAD }, /* this is to select groups */
-        { efDAT, "-o", "Density4D",
-          ffOPTWR }, /* This is for outputting the entire 4D densityfield in binary format */
-        { efOUT, "-or", nullptr,
-          ffOPTWRMULT }, /* This is for writing out the entire information in the t_interf arrays */
-        { efXPM, "-og", "interface",
-          ffOPTWRMULT }, /* This is for writing out the interface meshes - one xpm-file per tblock*/
+        { efDAT, "-o", "Density4D", ffOPTWR }, /* This is for outputting the entire 4D densityfield in binary format */
+        { efOUT, "-or", nullptr, ffOPTWRMULT }, /* This is for writing out the entire information in the t_interf arrays */
+        { efXPM, "-og", "interface", ffOPTWRMULT }, /* This is for writing out the interface meshes - one xpm-file per tblock*/
         { efOUT, "-Spect", "intfspect", ffOPTWRMULT }, /* This is for the trajectory averaged Fourier-spectra*/
     };
 
@@ -778,8 +806,8 @@ int gmx_densorder(int argc, char* argv[])
 
     /* This is the routine responsible for adding default options,
      * calling the X/motif interface, etc. */
-    if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW, NFILE, fnm, asize(pa), pa,
-                           asize(desc), desc, 0, nullptr, &oenv))
+    if (!parse_common_args(
+                &argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW, NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
     {
         return 0;
     }
@@ -800,8 +828,23 @@ int gmx_densorder(int argc, char* argv[])
 
     get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, ngx, index, grpname);
 
-    density_in_time(ftp2fn(efTRX, NFILE, fnm), index, ngx, binw, binwz, nsttblock, &Densmap,
-                    &xslices, &yslices, &zslices, &tblock, top, pbcType, axis, bCenter, b1d, oenv);
+    density_in_time(ftp2fn(efTRX, NFILE, fnm),
+                    index,
+                    ngx,
+                    binw,
+                    binwz,
+                    nsttblock,
+                    &Densmap,
+                    &xslices,
+                    &yslices,
+                    &zslices,
+                    &tblock,
+                    top,
+                    pbcType,
+                    axis,
+                    bCenter,
+                    b1d,
+                    oenv);
 
     if (ftorder > 0)
     {
@@ -813,8 +856,8 @@ int gmx_densorder(int argc, char* argv[])
         outputfield(opt2fn("-o", NFILE, fnm), Densmap, xslices, yslices, zslices, tblock);
     }
 
-    interfaces_txy(Densmap, xslices, yslices, zslices, tblock, binwz, eMeth, dens1, dens2, &surf1,
-                   &surf2, oenv);
+    interfaces_txy(
+            Densmap, xslices, yslices, zslices, tblock, binwz, eMeth, dens1, dens2, &surf1, &surf2, oenv);
 
     if (bGraph)
     {