Apply re-formatting to C++ in src/ tree.
[alexxy/gromacs.git] / src / gromacs / gmxana / gmx_awh.cpp
index f68beb07e9f36e335e460503f39f25b2049a7acb..00b0b9a542e972e411ddcc0d688445015e25f8ad 100644 (file)
@@ -250,10 +250,12 @@ std::vector<std::string> makeLegend(const AwhBiasParams* awhBiasParams,
                                     OutputFileType       outputFileType,
                                     size_t               numLegend)
 {
-    const std::array<std::string, maxAwhGraphs> legendBase = {
-        { "PMF", "Coord bias", "Coord distr", "Ref value distr", "Target ref value distr",
-          "Friction metric" }
-    };
+    const std::array<std::string, maxAwhGraphs> legendBase = { { "PMF",
+                                                                 "Coord bias",
+                                                                 "Coord distr",
+                                                                 "Ref value distr",
+                                                                 "Target ref value distr",
+                                                                 "Friction metric" } };
 
     std::vector<std::string> legend;
     /* Give legends to dimensions higher than the first */
@@ -344,8 +346,8 @@ void OutputFile::initializeAwhOutputFile(int                  subblockStart,
     yLabel_ = useKTForEnergy_ ? "(k\\sB\\NT)" : "(kJ/mol)";
     if (graphSelection == AwhGraphSelection::All)
     {
-        yLabel_ += gmx::formatString(", (nm\\S-%d\\N or rad\\S-%d\\N), (-)", awhBiasParams->ndim,
-                                     awhBiasParams->ndim);
+        yLabel_ += gmx::formatString(
+                ", (nm\\S-%d\\N or rad\\S-%d\\N), (-)", awhBiasParams->ndim, awhBiasParams->ndim);
     }
 }
 
@@ -420,8 +422,8 @@ AwhReader::AwhReader(const AwhParams*  awhParams,
         std::unique_ptr<OutputFile> awhOutputFile(new OutputFile(
                 opt2fn("-o", numFileOptions, filenames), "AWH", awhParams->numBias, k));
 
-        awhOutputFile->initializeAwhOutputFile(subblockStart, numSubBlocks, awhBiasParams,
-                                               awhGraphSelection, energyUnit, kT);
+        awhOutputFile->initializeAwhOutputFile(
+                subblockStart, numSubBlocks, awhBiasParams, awhGraphSelection, energyUnit, kT);
 
         std::unique_ptr<OutputFile> frictionOutputFile;
         if (outputFriction)
@@ -429,12 +431,12 @@ AwhReader::AwhReader(const AwhParams*  awhParams,
             frictionOutputFile = std::make_unique<OutputFile>(
                     opt2fn("-fric", numFileOptions, filenames), "Friction tensor", awhParams->numBias, k);
 
-            frictionOutputFile->initializeFrictionOutputFile(subblockStart, numSubBlocks,
-                                                             awhBiasParams, energyUnit, kT);
+            frictionOutputFile->initializeFrictionOutputFile(
+                    subblockStart, numSubBlocks, awhBiasParams, energyUnit, kT);
         }
 
-        biasOutputSetups_.emplace_back(BiasOutputSetup(subblockStart, std::move(awhOutputFile),
-                                                       std::move(frictionOutputFile)));
+        biasOutputSetups_.emplace_back(BiasOutputSetup(
+                subblockStart, std::move(awhOutputFile), std::move(frictionOutputFile)));
 
         subblockStart += numSubBlocks;
     }
@@ -487,8 +489,10 @@ void AwhReader::processAwhFrame(const t_enxblock& block, double time, const gmx_
             FILE* fpAwh = awhOutputFile.openBiasOutputFile(time, oenv);
 
             /* Now do the actual printing. Metadata in first subblock is treated separately. */
-            fprintf(fpAwh, "# AWH metadata: target error = %.2f kT = %.2f kJ/mol\n",
-                    block.sub[subStart].fval[1], block.sub[subStart].fval[1] * kT_);
+            fprintf(fpAwh,
+                    "# AWH metadata: target error = %.2f kT = %.2f kJ/mol\n",
+                    block.sub[subStart].fval[1],
+                    block.sub[subStart].fval[1] * kT_);
 
             fprintf(fpAwh, "# AWH metadata: log sample weight = %4.2f\n", block.sub[subStart].fval[2]);
 
@@ -548,8 +552,18 @@ int gmx_awh(int argc, char* argv[])
                        { efXVG, "-o", "awh", ffWRITE },
                        { efXVG, "-fric", "friction", ffOPTWR } };
     const int nfile = asize(fnm);
-    if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END, nfile, fnm,
-                           asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
+    if (!parse_common_args(&argc,
+                           argv,
+                           PCA_CAN_VIEW | PCA_CAN_BEGIN | PCA_CAN_END,
+                           nfile,
+                           fnm,
+                           asize(pa),
+                           pa,
+                           asize(desc),
+                           desc,
+                           0,
+                           nullptr,
+                           &oenv))
     {
         return 0;
     }
@@ -616,8 +630,8 @@ int gmx_awh(int argc, char* argv[])
                 AwhGraphSelection awhGraphSelection =
                         (moreGraphs ? AwhGraphSelection::All : AwhGraphSelection::Pmf);
                 EnergyUnit energyUnit = (kTUnit ? EnergyUnit::KT : EnergyUnit::KJPerMol);
-                awhReader = std::make_unique<AwhReader>(ir.awhParams, nfile, fnm, awhGraphSelection,
-                                                        energyUnit, BOLTZ * ir.opts.ref_t[0], block);
+                awhReader             = std::make_unique<AwhReader>(
+                        ir.awhParams, nfile, fnm, awhGraphSelection, energyUnit, BOLTZ * ir.opts.ref_t[0], block);
             }
 
             awhReader->processAwhFrame(*block, frame->t, oenv);