From 154a849587d5b32b5f2245310e8c89b1512d10ba Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Thu, 19 Jul 2012 10:52:37 +0200 Subject: [PATCH] Fixed several inconsistent file/class names --- src/CLToolDriver.cpp | 5 ++--- src/{ContactMap.cpp => ColvarContactMap.cpp} | 16 ++++++++-------- src/{ColvarTarget.cpp => FunctionTarget.cpp} | 12 ++++++------ src/GenericWholeMolecules.cpp | 4 ++-- src/MultiColvar.cpp | 4 ++-- src/{MolInfo.cpp => SetupMolInfo.cpp} | 12 ++++++------ src/{MolInfo.h => SetupMolInfo.h} | 4 ++-- 7 files changed, 28 insertions(+), 29 deletions(-) rename src/{ContactMap.cpp => ColvarContactMap.cpp} (94%) rename src/{ColvarTarget.cpp => FunctionTarget.cpp} (90%) rename src/{MolInfo.cpp => SetupMolInfo.cpp} (94%) rename src/{MolInfo.h => SetupMolInfo.h} (96%) diff --git a/src/CLToolDriver.cpp b/src/CLToolDriver.cpp index 8eac390d5..284c663ee 100644 --- a/src/CLToolDriver.cpp +++ b/src/CLToolDriver.cpp @@ -315,10 +315,9 @@ int CLToolDriver<real>::main(int argc,char**argv,FILE*in,FILE*out,PlumedCommunic return 0; } -typedef CLToolDriver<double> Driver; -typedef CLToolDriver<float> DriverSp; +typedef CLToolDriver<double> CLToolDriverDouble; -PLUMED_REGISTER_CLTOOL(Driver,"driver") +PLUMED_REGISTER_CLTOOL(CLToolDriverDouble,"driver") diff --git a/src/ContactMap.cpp b/src/ColvarContactMap.cpp similarity index 94% rename from src/ContactMap.cpp rename to src/ColvarContactMap.cpp index 4fc37998b..e6d96ba61 100644 --- a/src/ContactMap.cpp +++ b/src/ColvarContactMap.cpp @@ -51,7 +51,7 @@ PRINT ARG=f1.* FILE=colvar */ //+ENDPLUMEDOC -class ContactMap : public Colvar { +class ColvarContactMap : public Colvar { private: bool pbc, dosum; NeighborList *nl; @@ -59,16 +59,16 @@ private: bool reduceListAtNextStep; public: static void registerKeywords( Keywords& keys ); - ContactMap(const ActionOptions&); - ~ContactMap(); + ColvarContactMap(const ActionOptions&); + ~ColvarContactMap(); // active methods: virtual void calculate(); void checkFieldsAllowed(){}; }; -PLUMED_REGISTER_ACTION(ContactMap,"CONTACTMAP") +PLUMED_REGISTER_ACTION(ColvarContactMap,"CONTACTMAP") -void ContactMap::registerKeywords( Keywords& keys ){ +void ColvarContactMap::registerKeywords( Keywords& keys ){ Colvar::registerKeywords( keys ); keys.add("numbered","ATOMS","the atoms involved in each of the contacts you wish to calculate. " "Keywords like ATOMS1, ATOMS2, ATOMS3,... should be listed and one contact will be " @@ -78,7 +78,7 @@ void ContactMap::registerKeywords( Keywords& keys ){ keys.addFlag("SUM",false,"calculate the sum of all the contacts in the input"); } -ContactMap::ContactMap(const ActionOptions&ao): +ColvarContactMap::ColvarContactMap(const ActionOptions&ao): PLUMED_COLVAR_INIT(ao), pbc(true), dosum(false), @@ -143,11 +143,11 @@ reduceListAtNextStep(false) checkRead(); } -ContactMap::~ContactMap(){ +ColvarContactMap::~ColvarContactMap(){ delete nl; } -void ContactMap::calculate(){ +void ColvarContactMap::calculate(){ double ncoord=0., coord; Tensor virial; diff --git a/src/ColvarTarget.cpp b/src/FunctionTarget.cpp similarity index 90% rename from src/ColvarTarget.cpp rename to src/FunctionTarget.cpp index 7155ac0a0..b4cc1821c 100644 --- a/src/ColvarTarget.cpp +++ b/src/FunctionTarget.cpp @@ -41,26 +41,26 @@ set of collective variables. */ //+ENDPLUMEDOC -class TargetFrame : public Function { +class FunctionTarget : public Function { private: TargetDist target; std::vector<double> derivs; public: - TargetFrame(const ActionOptions&); + FunctionTarget(const ActionOptions&); virtual void calculate(); static void registerKeywords(Keywords& keys ); }; -PLUMED_REGISTER_ACTION(TargetFrame,"TARGET") +PLUMED_REGISTER_ACTION(FunctionTarget,"TARGET") -void TargetFrame::registerKeywords(Keywords& keys){ +void FunctionTarget::registerKeywords(Keywords& keys){ Function::registerKeywords(keys); keys.use("ARG"); keys.add("compulsory","REFERENCE","a file in pdb format containing the reference structure. " + PDB::documentation() ); keys.add("optional","REFERENCE_VEC","the vector of values for the CVs at the reference point (if you use this you don't need REFERENCE)"); } -TargetFrame::TargetFrame(const ActionOptions&ao): +FunctionTarget::FunctionTarget(const ActionOptions&ao): Action(ao), Function(ao), target(log) @@ -82,7 +82,7 @@ target(log) addValueWithDerivatives(); setNotPeriodic(); } -void TargetFrame::calculate(){ +void FunctionTarget::calculate(){ double r=target.calculate( derivs ); setValue(r); for(unsigned i=0;i<derivs.size();i++) setDerivative(i,derivs[i]); diff --git a/src/GenericWholeMolecules.cpp b/src/GenericWholeMolecules.cpp index 5fd6c7e47..844acece3 100644 --- a/src/GenericWholeMolecules.cpp +++ b/src/GenericWholeMolecules.cpp @@ -28,7 +28,7 @@ #include "Atoms.h" #include "PlumedMain.h" #include "ActionSet.h" -#include "MolInfo.h" +#include "SetupMolInfo.h" #include <vector> #include <string> @@ -131,7 +131,7 @@ ActionAtomistic(ao) if( resstrings.size()>0 ){ vector<string> backnames; parseVector("RES_ATOMS",backnames); if(backnames.size()==0) error("Found RESIDUES keyword without any specification of the atoms that should be in a residue - use RES_ATOMS"); - std::vector<MolInfo*> moldat=plumed.getActionSet().select<MolInfo*>(); + std::vector<SetupMolInfo*> moldat=plumed.getActionSet().select<SetupMolInfo*>(); if( moldat.size()==0 ) error("Unable to find MOLINFO in input"); std::vector< std::vector<AtomNumber> > backatoms; moldat[0]->getBackbone( resstrings, backnames, backatoms ); diff --git a/src/MultiColvar.cpp b/src/MultiColvar.cpp index ca312450c..50239b4f7 100644 --- a/src/MultiColvar.cpp +++ b/src/MultiColvar.cpp @@ -23,7 +23,7 @@ #include "PlumedMain.h" #include "DistributionFunctions.h" #include "ActionSet.h" -#include "MolInfo.h" +#include "SetupMolInfo.h" #include <vector> #include <string> @@ -237,7 +237,7 @@ void MultiColvar::readBackboneAtoms( const std::vector<std::string>& backnames, plumed_massert( keywords.exists("RESIDUES"), "To read in the backbone atoms the keyword RESIDUES must be registered"); readatoms=true; - std::vector<MolInfo*> moldat=plumed.getActionSet().select<MolInfo*>(); + std::vector<SetupMolInfo*> moldat=plumed.getActionSet().select<SetupMolInfo*>(); if( moldat.size()==0 ) error("Unable to find MOLINFO in input"); std::vector<std::string> resstrings; parseVector( "RESIDUES", resstrings ); diff --git a/src/MolInfo.cpp b/src/SetupMolInfo.cpp similarity index 94% rename from src/MolInfo.cpp rename to src/SetupMolInfo.cpp index 63447f69e..8ffdab74c 100644 --- a/src/MolInfo.cpp +++ b/src/SetupMolInfo.cpp @@ -19,7 +19,7 @@ You should have received a copy of the GNU Lesser General Public License along with PLUMED. If not, see <http://www.gnu.org/licenses/>. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ -#include "MolInfo.h" +#include "SetupMolInfo.h" #include "Atoms.h" #include "ActionRegister.h" #include "ActionSet.h" @@ -59,21 +59,21 @@ ALPHARMSD BACKBONE=all TYPE=DRMSD LESS_THAN=(RATIONAL R_0=0.08 NN=8 MM=12) LABEL //+ENDPLUMEDOC -PLUMED_REGISTER_ACTION(MolInfo,"MOLINFO") +PLUMED_REGISTER_ACTION(SetupMolInfo,"MOLINFO") -void MolInfo::registerKeywords( Keywords& keys ){ +void SetupMolInfo::registerKeywords( Keywords& keys ){ ActionSetup::registerKeywords(keys); keys.add("compulsory","STRUCTURE","a file in pdb format containing a reference structure. " "This is used to defines the atoms in the various residues, chains, etc . " + PDB::documentation() ); keys.add("atoms","CHAIN","(for masochists ( a.k.a. Davide Branduardi ) ) The atoms involved in each of the chains of interest in the structure."); } -MolInfo::MolInfo( const ActionOptions&ao ): +SetupMolInfo::SetupMolInfo( const ActionOptions&ao ): Action(ao), ActionSetup(ao), ActionAtomistic(ao) { - std::vector<MolInfo*> moldat=plumed.getActionSet().select<MolInfo*>(); + std::vector<SetupMolInfo*> moldat=plumed.getActionSet().select<SetupMolInfo*>(); if( moldat.size()!=0 ) error("cannot use more than one MOLINFO action in input"); std::vector<AtomNumber> backbone; @@ -106,7 +106,7 @@ ActionAtomistic(ao) pdb.renameAtoms("HA1","CB"); // This is a hack to make this work with GLY residues } -void MolInfo::getBackbone( std::vector<std::string>& restrings, const std::vector<std::string>& atnames, std::vector< std::vector<AtomNumber> >& backbone ){ +void SetupMolInfo::getBackbone( std::vector<std::string>& restrings, const std::vector<std::string>& atnames, std::vector< std::vector<AtomNumber> >& backbone ){ if( read_backbone.size()!=0 ){ if( restrings.size()!=1 ) error("cannot interpret anything other than all for residues when using CHAIN keywords"); if( restrings[0]!="all" ) error("cannot interpret anything other than all for residues when using CHAIN keywords"); diff --git a/src/MolInfo.h b/src/SetupMolInfo.h similarity index 96% rename from src/MolInfo.h rename to src/SetupMolInfo.h index 0378506c2..57712c1f3 100644 --- a/src/MolInfo.h +++ b/src/SetupMolInfo.h @@ -30,7 +30,7 @@ namespace PLMD { -class MolInfo : +class SetupMolInfo : public ActionSetup, public ActionAtomistic { private: @@ -38,7 +38,7 @@ private: std::vector< std::vector<AtomNumber> > read_backbone; public: static void registerKeywords( Keywords& keys ); - MolInfo(const ActionOptions&ao); + SetupMolInfo(const ActionOptions&ao); void getBackbone( std::vector<std::string>& resstrings, const std::vector<std::string>& atnames, std::vector< std::vector<AtomNumber> >& backbone ); }; -- GitLab