Uncrustify
authorAlexey Shvetsov <alexxy@gentoo.org>
Mon, 10 Sep 2018 08:53:41 +0000 (11:53 +0300)
committerAlexey Shvetsov <alexxy@gentoo.org>
Mon, 10 Sep 2018 08:53:41 +0000 (11:53 +0300)
Signed-off-by: Alexey Shvetsov <alexxy@gentoo.org>
src/sans.cpp

index 5c13d802c3843c21ee659dbc5f6dbc1451ffb0fc..19c282788f52c8e7cedae664b988eb144f9866ae 100644 (file)
@@ -77,8 +77,8 @@ class SANS : public TrajectoryAnalysisModule
         IVec gridPoints_;
         RVec gridSpacing_;
 
-        AnalysisNeighborhood             nb_;
-        const TopologyInformation       *top_;
+        AnalysisNeighborhood              nb_;
+        const TopologyInformation        *top_;
         std::vector < std::vector < std::vector<double>>> gausGrid_;
         std::vector<double>               vdw_radius_;
 };
@@ -122,28 +122,32 @@ void
 SANS::initAnalysis(const TrajectoryAnalysisSettings  &settings,
                    const TopologyInformation         &top)
 {
-    nb_.setCutoff(cutoff_);
-    top_ = &top;
+
     gmx_atomprop_t aps    = gmx_atomprop_init();
     t_atoms       *atoms  = &(top.topology()->atoms);
-    real value;
-    for(int i=0; i<top.topology()->atoms.nr;i++) {
+    real           value;
+
+    nb_.setCutoff(cutoff_);
+    top_ = &top;
+
+    for (int i = 0; i < top.topology()->atoms.nr; i++)
+    {
         // Lookup the Van der Waals radius of this atom
         int resnr = atoms->atom[i].resind;
         if (gmx_atomprop_query(aps, epropVDW,
                                *(atoms->resinfo[resnr].name),
                                *(atoms->atomname[i]),
                                &value))
-            {
-                vdw_radius_.push_back(value);
-            }
-            else
-            {
-                fprintf(stderr, "Could not determine VDW radius for %s-%s. Set to zero.\n",
-                                *(atoms->resinfo[resnr].name),
-                                *(atoms->atomname[i]));
-                    vdw_radius_.push_back(0.0);
-            }
+        {
+            vdw_radius_.push_back(value);
+        }
+        else
+        {
+            fprintf(stderr, "Could not determine VDW radius for %s-%s. Set to zero.\n",
+                    *(atoms->resinfo[resnr].name),
+                    *(atoms->atomname[i]));
+            vdw_radius_.push_back(0.0);
+        }
 
     }
 
@@ -225,7 +229,7 @@ SANS::writeOutput()
 {
     FILE *fo;
     // Construct opendx grid
-    fo = fopen("data.dx","w");
+    fo = fopen("data.dx", "w");
     //object 1 class gridpositions counts  140 140 140
     //origin 0.000000 0.000000 0.000000
     //delta  0.500000 0.000000 0.000000
@@ -233,12 +237,12 @@ SANS::writeOutput()
     //delta  0.000000 0.000000 0.500000
     //object 2 class gridconnections counts  140 140 140
     //object 3 class array type "double" rank 0 items 2744000 data follows
-    fprintf(fo, "object 1 class gridpositions counts %d %d %d\n", gridPoints_[XX],gridPoints_[YY],gridPoints_[ZZ]);
+    fprintf(fo, "object 1 class gridpositions counts %d %d %d\n", gridPoints_[XX], gridPoints_[YY], gridPoints_[ZZ]);
     fprintf(fo, "origin 0.000000 0.000000 0.000000\n");
     fprintf(fo, "delta %3.6f %3.6f %3.6f\n", gridSpacing_[XX]*NM2A, 0.0, 0.0);
     fprintf(fo, "delta %3.6f %3.6f %3.6f\n", 0.0, gridSpacing_[YY]*NM2A, 0.0);
     fprintf(fo, "delta %3.6f %3.6f %3.6f\n", 0.0, 0.0, gridSpacing_[ZZ]*NM2A);
-    fprintf(fo, "object 2 class gridconnections counts  %d %d %d\n", gridPoints_[XX],gridPoints_[YY],gridPoints_[ZZ]);
+    fprintf(fo, "object 2 class gridconnections counts  %d %d %d\n", gridPoints_[XX], gridPoints_[YY], gridPoints_[ZZ]);
     fprintf(fo, "object 3 class array type \"double\" rank 0 items %d data follows\n", gridPoints_[XX]*gridPoints_[YY]*gridPoints_[ZZ]);
     // now dump data in ordered mode
     //    u(0,0,0) u(0,0,1) u(0,0,2)
@@ -252,7 +256,7 @@ SANS::writeOutput()
     //    u(1,0,0) u(1,0,1) u(1,0,2)
     //    ...
     int NR = 3;
-    int n = 0;
+    int n  = 0;
     for (int i = 0; i < gridPoints_[XX]; i++)
     {
         for (int j = 0; j < gridPoints_[YY]; j++)
@@ -261,14 +265,16 @@ SANS::writeOutput()
             {
                 fprintf(fo, "%3.8f ", gausGrid_[i][j][k]);
                 n++;
-                if (n == NR) {
+                if (n == NR)
+                {
                     fprintf(fo, "\n");
                     n = 0;
                 }
             }
         }
     }
-    if (n != NR) {
+    if (n != NR)
+    {
         fprintf(fo, "\n");
     }
     //attribute "dep" string "positions"