From e9fb3d251011103ac4910dd0aa2e78007aed5166 Mon Sep 17 00:00:00 2001
From: carlocamilloni <carlo.camilloni@gmail.com>
Date: Sun, 28 Jul 2019 14:46:58 +0200
Subject: [PATCH] PIV: cleaned warnings

---
 src/piv/PIV.cpp | 43 ++++++++++++++++---------------------------
 1 file changed, 16 insertions(+), 27 deletions(-)

diff --git a/src/piv/PIV.cpp b/src/piv/PIV.cpp
index 87054d75c..c53cbbc99 100644
--- a/src/piv/PIV.cpp
+++ b/src/piv/PIV.cpp
@@ -20,7 +20,6 @@ along with plumed.  If not, see <http://www.gnu.org/licenses/>.
 #include "core/ActionWithVirtualAtom.h"
 #include "tools/NeighborList.h"
 #include "tools/SwitchingFunction.h"
-//#include "tools/Tools.h"
 #include "tools/PDB.h"
 #include "tools/Pbc.h"
 #include "tools/Stopwatch.h"
@@ -187,14 +186,11 @@ class PIV      : public Colvar
 private:
   bool pbc, serial, timer;
   ForwardDecl<Stopwatch> stopwatch_fwd;
-  /// The stopwatch that times the different parts of the calculation
   Stopwatch& stopwatch=*stopwatch_fwd;
   int updatePIV;
   unsigned Nprec,Natm,Nlist,NLsize;
-  // Fvol: volume scaling factor for distances
   double Fvol,Vol0,m_PIVdistance;
   std::string ref_file;
-  // std:: vector<string> atype;
   NeighborList *nlall;
   std::vector<SwitchingFunction> sfs;
   std::vector<std:: vector<double> > rPIV;
@@ -204,12 +200,11 @@ private:
   std::vector<bool> dosort;
   std::vector<Vector> compos;
   std::vector<string> sw;
-  //std::vector<std:: vector<unsigned> > com2atoms;
   std::vector<NeighborList *> nl;
   std::vector<NeighborList *> nlcom;
   std::vector<Vector> m_deriv;
   Tensor m_virial;
-  bool Svol,Sfac,cross,direct,doneigh,test,CompDer,com;
+  bool Svol,cross,direct,doneigh,test,CompDer,com;
 public:
   static void registerKeywords( Keywords& keys );
   PIV(const ActionOptions&);
@@ -253,36 +248,34 @@ void PIV::registerKeywords( Keywords& keys )
 PIV::PIV(const ActionOptions&ao):
   PLUMED_COLVAR_INIT(ao),
   pbc(true),
-  timer(false),
   serial(false),
+  timer(false),
   updatePIV(1),
-  Svol(false),
-  Sfac(false),
-  cross(true),
-  direct(true),
-  doneigh(false),
-  CompDer(false),
-  com(false),
-  test(false),
   Nprec(1000),
   Natm(1),
-  NLsize(1),
   Nlist(1),
+  NLsize(1),
   Fvol(1.),
   Vol0(0.),
   m_PIVdistance(0.),
-  m_deriv(std:: vector<Vector>(1)),
-  nl(std:: vector<NeighborList *>(Nlist)),
   rPIV(std:: vector<std:: vector<double> >(Nlist)),
   scaling(std:: vector<double>(Nlist)),
   r00(std:: vector<double>(Nlist)),
-  sw(std:: vector<string>(Nlist)),
   nl_skin(std:: vector<double>(Nlist)),
   fmass(std:: vector<double>(Nlist)),
   dosort(std:: vector<bool>(Nlist)),
+  compos(std:: vector<Vector>(NLsize)),
+  sw(std:: vector<string>(Nlist)),
+  nl(std:: vector<NeighborList *>(Nlist)),
   nlcom(std:: vector<NeighborList *>(NLsize)),
-  compos(std:: vector<Vector>(NLsize))
-//com2atoms(std:: vector<std:: vector<unsigned> >(Nlist))
+  m_deriv(std:: vector<Vector>(1)),
+  Svol(false),
+  cross(true),
+  direct(true),
+  doneigh(false),
+  test(false),
+  CompDer(false),
+  com(false)
 {
   log << "Starting PIV Constructor\n";
 
@@ -306,7 +299,6 @@ PIV::PIV(const ActionOptions&ao):
     log << "Serial PIV construction\n";
   } else     {
     log << "Parallel PIV construction\n";
-    unsigned rank=comm.Get_rank();
   }
 
   // Derivatives
@@ -382,7 +374,6 @@ PIV::PIV(const ActionOptions&ao):
   NLsize=mypdb.getAtomNumbers().size();
   // In the following P stands for Point (either an Atom or a COM)
   unsigned resnum=0;
-  unsigned Pnum=0;
   // Presind (array size: number of residues) contains the contains the residue number
   //   this is because the residue numbers may not alwyas be ordered from 1 to resnum
   std:: vector<unsigned> Presind;
@@ -560,8 +551,6 @@ PIV::PIV(const ActionOptions&ao):
   }
   // Calculate COM masses once and for all from lists
   if(com) {
-    unsigned count=0;
-    //log << "Computing COM masses  \n";
     for(unsigned j=0; j<compos.size(); j++) {
       double commass=0.;
       for(unsigned i=0; i<nlcom[j]->getFullAtomList().size(); i++) {
@@ -627,7 +616,7 @@ PIV::PIV(const ActionOptions&ao):
         double r0;
         vector<string> data=Tools::getWords(sw[j]);
         data.erase(data.begin());
-        bool tmp=Tools::parse(data,"R_0",r0);
+        Tools::parse(data,"R_0",r0);
         std::string old_r0; Tools::convert(r0,old_r0);
         r0*=Fvol;
         std::string new_r0; Tools::convert(r0,new_r0);
@@ -773,7 +762,7 @@ void PIV::calculate()
         double r0;
         vector<string> data=Tools::getWords(sw[j]);
         data.erase(data.begin());
-        bool tmp=Tools::parse(data,"R_0",r0);
+        Tools::parse(data,"R_0",r0);
         std::string old_r0; Tools::convert(r0,old_r0);
         r0*=Fvol;
         std::string new_r0; Tools::convert(r0,new_r0);
-- 
GitLab