From 1bc0c0b0b5c6d041a1b80d815796e2a9e0e41894 Mon Sep 17 00:00:00 2001 From: Gareth Tribello <gareth.tribello@gmail.com> Date: Fri, 16 Nov 2012 16:15:03 +0100 Subject: [PATCH] Renamed Volume class ActionVolume to make it clear that this is not calculating a volume --- src/{Volume.cpp => ActionVolume.cpp} | 6 +++--- src/{Volume.h => ActionVolume.h} | 12 ++++++------ src/VesselCVdens.cpp | 6 +++--- src/VolumeSubcell.cpp | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) rename src/{Volume.cpp => ActionVolume.cpp} (89%) rename src/{Volume.h => ActionVolume.h} (89%) diff --git a/src/Volume.cpp b/src/ActionVolume.cpp similarity index 89% rename from src/Volume.cpp rename to src/ActionVolume.cpp index bef867870..1b78a7ba8 100644 --- a/src/Volume.cpp +++ b/src/ActionVolume.cpp @@ -19,16 +19,16 @@ 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 "Volume.h" +#include "ActionVolume.h" namespace PLMD { -void Volume::registerKeywords( Keywords& keys ){ +void ActionVolume::registerKeywords( Keywords& keys ){ Action::registerKeywords( keys ); ActionAtomistic::registerKeywords( keys ); } -Volume::Volume(const ActionOptions&ao): +ActionVolume::ActionVolume(const ActionOptions&ao): Action(ao), ActionAtomistic(ao) { diff --git a/src/Volume.h b/src/ActionVolume.h similarity index 89% rename from src/Volume.h rename to src/ActionVolume.h index abfcfab0d..065b9f442 100644 --- a/src/Volume.h +++ b/src/ActionVolume.h @@ -19,8 +19,8 @@ You should have received a copy of the GNU Lesser General Public License along with plumed. If not, see <http://www.gnu.org/licenses/>. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ -#ifndef __PLUMED_Volume_h -#define __PLUMED_Volume_h +#ifndef __PLUMED_ActionVolume_h +#define __PLUMED_ActionVolume_h #include "ActionAtomistic.h" #include "HistogramBead.h" @@ -34,7 +34,7 @@ box. You can use this to calculate the number of atoms inside that part or the a coordination number inside that part of the cell. */ -class Volume : +class ActionVolume : public ActionAtomistic { friend class VesselCVDens; @@ -45,18 +45,18 @@ protected: double getSigma() const ; public: static void registerKeywords( Keywords& keys ); - Volume(const ActionOptions&); + ActionVolume(const ActionOptions&); virtual void calculateNumberInside( const std::vector<Value>& cpos, HistogramBead& bead, Value& weight )=0; void apply(){}; }; inline -void Volume::setSigma( const double& sig ){ +void ActionVolume::setSigma( const double& sig ){ sigma=sig; } inline -double Volume::getSigma() const { +double ActionVolume::getSigma() const { return sigma; } diff --git a/src/VesselCVdens.cpp b/src/VesselCVdens.cpp index 63d27ad70..5bdbbf05e 100644 --- a/src/VesselCVdens.cpp +++ b/src/VesselCVdens.cpp @@ -23,7 +23,7 @@ #include "FunctionVessel.h" #include "PlumedMain.h" #include "ActionSet.h" -#include "Volume.h" +#include "ActionVolume.h" #include "MultiColvar.h" #include "HistogramBead.h" @@ -90,7 +90,7 @@ class VesselCVDens : public NormedSumVessel { private: bool isDensity; Value tmpval, tmpweight; - Volume* myvol; + ActionVolume* myvol; MultiColvar* mycolv; std::vector<Value> catom_pos; bool not_in; @@ -125,7 +125,7 @@ not_in(false) std::string name; bool found_element=Tools::parse(data,"VOLUME",name); if(!found_element){ error("No volume element specified in ccall to REGION"); return; } if( name.substr(0,1)=="!" ){ name=name.substr(1); not_in=true; } - myvol = (mycolv->plumed).getActionSet().selectWithLabel<Volume*>(name); + myvol = (mycolv->plumed).getActionSet().selectWithLabel<ActionVolume*>(name); if(!myvol){ error( "in REGION " + name + " is not a valid volume element"); return; } mycolv->addDependency( myvol ); diff --git a/src/VolumeSubcell.cpp b/src/VolumeSubcell.cpp index 7ff346a3b..443c38241 100644 --- a/src/VolumeSubcell.cpp +++ b/src/VolumeSubcell.cpp @@ -20,7 +20,7 @@ along with plumed. If not, see <http://www.gnu.org/licenses/>. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ #include "ActionRegister.h" -#include "Volume.h" +#include "ActionVolume.h" //+PLUMEDOC GENERIC SUBCELL /* @@ -41,7 +41,7 @@ COORDINATIONNUMBER SPECIES=1-100 R_0=1.0 REGION={SIGMA=0.1 VOLUME=r1} namespace PLMD { -class VolumeSubcell : public Volume { +class VolumeSubcell : public ActionVolume { private: Tensor cellbox; bool dox, doy, doz; @@ -58,7 +58,7 @@ public: PLUMED_REGISTER_ACTION(VolumeSubcell,"SUBCELL") void VolumeSubcell::registerKeywords( Keywords& keys ){ - Volume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.add("compulsory","XLOWER","0.0","the lower boundary in x of the subcell in fractional coordinates."); keys.add("compulsory","XUPPER","1.0","the upper boundary in x of the subcell in fractional coordinates."); keys.add("compulsory","YLOWER","0.0","the lower boundary in y of the subcell in fractional coordinates."); @@ -69,7 +69,7 @@ void VolumeSubcell::registerKeywords( Keywords& keys ){ VolumeSubcell::VolumeSubcell(const ActionOptions& ao): Action(ao), -Volume(ao) +ActionVolume(ao) { dox=true; parse("XLOWER",xlow); parse("XUPPER",xhigh); -- GitLab