From 3ef20d24224e4a5842711568a9e2c5419cf7f178 Mon Sep 17 00:00:00 2001 From: Alexey Shvetsov Date: Mon, 10 Sep 2018 11:53:41 +0300 Subject: [PATCH] Uncrustify Signed-off-by: Alexey Shvetsov --- src/sans.cpp | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/src/sans.cpp b/src/sans.cpp index 5c13d80..19c2827 100644 --- a/src/sans.cpp +++ b/src/sans.cpp @@ -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>> gausGrid_; std::vector vdw_radius_; }; @@ -122,28 +122,32 @@ void SANS::initAnalysis(const TrajectoryAnalysisSettings &settings, const TopologyInformation &top) { - nb_.setCutoff(cutoff_); - top_ = ⊤ + gmx_atomprop_t aps = gmx_atomprop_init(); t_atoms *atoms = &(top.topology()->atoms); - real value; - for(int i=0; iatoms.nr;i++) { + real value; + + nb_.setCutoff(cutoff_); + 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" -- 2.22.0