diff --git a/regtest/mapping/rt39/colvar.reference b/regtest/mapping/rt39/colvar.reference index 9cc657c86ff75b992646c018ffeefb890ab9958d..a3a560c16ec02520514591a00957880f6e038fa6 100644 --- a/regtest/mapping/rt39/colvar.reference +++ b/regtest/mapping/rt39/colvar.reference @@ -1,4 +1,4 @@ -#! FIELDS time p2.sss p2.zzz p3.sss p3.zzz +#! FIELDS time p2.spath p2.zpath p3.sss p3.zzz 0.000000 1.9434 0.0001 1.9434 0.0001 0.250000 1.0090 0.0001 1.0090 0.0001 0.500000 1.0579 0.0001 1.0579 0.0001 diff --git a/regtest/mapping/rt39/deriv.reference b/regtest/mapping/rt39/deriv.reference index 09999da95ca32564763086920e7e9da7cde81aa6..f44fb446f8bc62afac1ee62bd133c8289121d681 100644 --- a/regtest/mapping/rt39/deriv.reference +++ b/regtest/mapping/rt39/deriv.reference @@ -1,4 +1,4 @@ -#! FIELDS time parameter p2.sss p2.zzz p3.sss p3.zzz +#! FIELDS time parameter p2.spath p2.zpath p3.sss p3.zzz 0.000000 0 2.9260 0.0007 2.9260 0.0007 0.000000 1 -3.2521 -0.0011 -3.2521 -0.0011 0.000000 2 4.2465 -0.0003 4.2465 -0.0003 diff --git a/regtest/mapping/rt39/plumed.dat b/regtest/mapping/rt39/plumed.dat index 004bef3835cda13e7012e4a899e933651d47abec..c16953f0a610a51a9f23c9eaafaa1ddd359cc595 100644 --- a/regtest/mapping/rt39/plumed.dat +++ b/regtest/mapping/rt39/plumed.dat @@ -1,4 +1,4 @@ p2: PATH REFERENCE=all.pdb LAMBDA=69087 p3: PATHMSD REFERENCE=all.pdb LAMBDA=69087 NEIGH_SIZE=8 NEIGH_STRIDE=5 -PRINT ARG=p2.sss,p2.zzz,p3.sss,p3.zzz STRIDE=1 FILE=colvar FMT=%8.4f -DUMPDERIVATIVES ARG=p2.sss,p2.zzz,p3.sss,p3.zzz STRIDE=1 FILE=deriv FMT=%8.4f +PRINT ARG=p2.spath,p2.zpath,p3.sss,p3.zzz STRIDE=1 FILE=colvar FMT=%8.4f +DUMPDERIVATIVES ARG=p2.spath,p2.zpath,p3.sss,p3.zzz STRIDE=1 FILE=deriv FMT=%8.4f diff --git a/regtest/mapping/rt40/colvar.reference b/regtest/mapping/rt40/colvar.reference index ef73462540de059b3b2386f27004b324432705a6..4985a2543600b8171ec8b3457096aba2812c4a0f 100644 --- a/regtest/mapping/rt40/colvar.reference +++ b/regtest/mapping/rt40/colvar.reference @@ -1,4 +1,4 @@ -#! FIELDS time p2.X p2.Y p2.zzz p3.X p3.Y p3.zzz +#! FIELDS time p2.X p2.Y p2.zpath p3.X p3.Y p3.zzz 0.000000 1.9434 2.9434 0.0001 1.9434 2.9434 0.0001 0.250000 1.0090 2.0090 0.0001 1.0090 2.0090 0.0001 0.500000 1.0579 2.0579 0.0001 1.0579 2.0579 0.0001 diff --git a/regtest/mapping/rt40/deriv.reference b/regtest/mapping/rt40/deriv.reference index 9e3e75d6c91867f420c9aaef93aad082caadb42e..b8f9d32a22db508a7786f332cebfc8804cd12cb5 100644 --- a/regtest/mapping/rt40/deriv.reference +++ b/regtest/mapping/rt40/deriv.reference @@ -1,4 +1,4 @@ -#! FIELDS time parameter p2.X p2.Y p2.zzz p3.X p3.Y p3.zzz +#! FIELDS time parameter p2.X p2.Y p2.zpath p3.X p3.Y p3.zzz 0.000000 0 2.9260 2.9260 0.0007 2.9260 2.9260 0.0007 0.000000 1 -3.2521 -3.2521 -0.0011 -3.2521 -3.2521 -0.0011 0.000000 2 4.2465 4.2465 -0.0003 4.2465 4.2465 -0.0003 diff --git a/regtest/mapping/rt40/plumed.dat b/regtest/mapping/rt40/plumed.dat index b79c076e45d948e9198973cb4238116259b71829..669e21ee16361afebcb7d029feb0b488b6bf59f4 100644 --- a/regtest/mapping/rt40/plumed.dat +++ b/regtest/mapping/rt40/plumed.dat @@ -1,5 +1,5 @@ p2: GPROPERTYMAP REFERENCE=allv.pdb PROPERTY=X,Y LAMBDA=69087 p3: PROPERTYMAP REFERENCE=allv.pdb PROPERTY=X,Y LAMBDA=69087 NEIGH_SIZE=8 NEIGH_STRIDE=5 -PRINT ARG=p2.X,p2.Y,p2.zzz,p3.X,p3.Y,p3.zzz STRIDE=1 FILE=colvar FMT=%8.4f -DUMPDERIVATIVES ARG=p2.X,p2.Y,p2.zzz,p3.X,p3.Y,p3.zzz STRIDE=1 FILE=deriv FMT=%8.4f +PRINT ARG=p2.X,p2.Y,p2.zpath,p3.X,p3.Y,p3.zzz STRIDE=1 FILE=colvar FMT=%8.4f +DUMPDERIVATIVES ARG=p2.X,p2.Y,p2.zpath,p3.X,p3.Y,p3.zzz STRIDE=1 FILE=deriv FMT=%8.4f diff --git a/src/mapping/Mapping.cpp b/src/mapping/Mapping.cpp index c4af16d7efdf26786a53bcc26f2cd5729e2806fc..906d9ffb413b51d71c6dc970adfab5b155c2a28a 100644 --- a/src/mapping/Mapping.cpp +++ b/src/mapping/Mapping.cpp @@ -65,7 +65,7 @@ ActionWithVessel(ao) mymap->setPropertyNames( property, false ); } else { std::vector<std::string> property(1); - property[0]="sss"; + property[0]="spath"; mymap->setPropertyNames( property, true ); } diff --git a/src/mapping/Path.cpp b/src/mapping/Path.cpp index f3b3a77e6fe320885f8558ec3e3c1fd96fc2bb43..51fa4f81f8b638b06dce0f693c13c4119a66028a 100644 --- a/src/mapping/Path.cpp +++ b/src/mapping/Path.cpp @@ -76,10 +76,10 @@ PathBase(ao) std::string empty; if(!nos){ - if( getPropertyIndex("sss")!=0 || getNumberOfProperties()>1 ){ + if( getPropertyIndex("spath")!=0 || getNumberOfProperties()>1 ){ error("paths only work when there is a single property called sss being calculated"); } - empty="LABEL=sss"; + empty="LABEL=spath"; addVessel("SPATH",empty,0); } readVesselKeywords(); diff --git a/src/mapping/PathBase.cpp b/src/mapping/PathBase.cpp index c959ddcb5196c820ec0bf05782e0c424852d2c46..b30b2a2713544cde70ccdaa6052ba9d769a31062 100644 --- a/src/mapping/PathBase.cpp +++ b/src/mapping/PathBase.cpp @@ -41,7 +41,7 @@ Mapping(ao) // Create the list of tasks for(unsigned i=0;i<getNumberOfReferencePoints();++i) addTaskToList( i ); - std::string empty="LABEL=zzz"; + std::string empty="LABEL=zpath"; if(!noz) addVessel("ZPATH",empty,0); } diff --git a/src/mapping/SpathVessel.cpp b/src/mapping/SpathVessel.cpp index f15cf13d8a06bbd6919104ecbc86a51fd5b3ccce..23c43cabf81d1adfda7e3f501c5558cc8223ddf6 100644 --- a/src/mapping/SpathVessel.cpp +++ b/src/mapping/SpathVessel.cpp @@ -49,7 +49,7 @@ void SpathVessel::registerKeywords( Keywords& keys ){ void SpathVessel::reserveKeyword( Keywords& keys ){ keys.reserveFlag("SPATH",false,"docs should not appear",true); - keys.addOutputComponent("sss","SPATH","the position on the path"); + keys.addOutputComponent("spath","SPATH","the position on the path"); } SpathVessel::SpathVessel( const vesselbase::VesselOptions& da ): diff --git a/src/mapping/ZpathVessel.cpp b/src/mapping/ZpathVessel.cpp index 42e9fd11314ed473ebd53beb01d8708005d4e53d..9807baed33fe192292da398fa1014d8e84d1a7e2 100644 --- a/src/mapping/ZpathVessel.cpp +++ b/src/mapping/ZpathVessel.cpp @@ -46,7 +46,7 @@ void ZpathVessel::registerKeywords( Keywords& keys ){ void ZpathVessel::reserveKeyword( Keywords& keys ){ keys.reserveFlag("ZPATH",false,"calculate the distance from the low dimensionality manifold",true); - keys.addOutputComponent("zzz","ZPATH","the distance from the path"); + keys.addOutputComponent("zpath","ZPATH","the distance from the path"); } ZpathVessel::ZpathVessel( const vesselbase::VesselOptions& da ): diff --git a/src/vesselbase/ActionWithVessel.cpp b/src/vesselbase/ActionWithVessel.cpp index ead4d4312f26fc087bd3625ded569281759ddd9c..1476382990bae01b04cc982e2558dc7ebc15ea32 100644 --- a/src/vesselbase/ActionWithVessel.cpp +++ b/src/vesselbase/ActionWithVessel.cpp @@ -26,6 +26,7 @@ #include "StoreDataVessel.h" #include "VesselRegister.h" #include "BridgeVessel.h" +#include "FunctionVessel.h" using namespace std; namespace PLMD{ @@ -80,7 +81,12 @@ ActionWithVessel::~ActionWithVessel(){ void ActionWithVessel::addVessel( const std::string& name, const std::string& input, const int numlab ){ VesselOptions da(name,"",numlab,input,this); - Vessel* vv=vesselRegister().create(name,da); + Vessel* vv=vesselRegister().create(name,da); + FunctionVessel* fv=dynamic_cast<FunctionVessel*>(vv); + if( fv ){ + std::string mylabel=Vessel::transformName( name ); + plumed_massert( keywords.outputComponentExists(mylabel,false), "a description of the value calculated by vessel " + name + " has not been added to the manual"); + } addVessel(vv); } diff --git a/src/vesselbase/Vessel.cpp b/src/vesselbase/Vessel.cpp index 8fadfc5b5e2e7d45781c4b03d333ac8cc20f5ac0..8aae48d0a10809e316cdbf33c77e64fee24e3f64 100644 --- a/src/vesselbase/Vessel.cpp +++ b/src/vesselbase/Vessel.cpp @@ -55,6 +55,19 @@ void Vessel::registerKeywords( Keywords& keys ){ keys.add("optional","LABEL","the label used to reference this particular quantity"); } +std::string Vessel::transformName( const std::string& name ){ + std::string tlabel=name; + // Convert to lower case + std::transform( tlabel.begin(), tlabel.end(), tlabel.begin(), tolower ); + // Remove any underscore characters (as these are reserved) + for(unsigned i=0;;++i){ + std::size_t num=tlabel.find_first_of("_"); + if( num==std::string::npos ) break; + tlabel.erase( tlabel.begin() + num, tlabel.begin() + num + 1 ); + } + return tlabel; +} + Vessel::Vessel( const VesselOptions& da ): myname(da.myname), numlab(da.numlab), @@ -70,15 +83,7 @@ log((da.action)->log) } else { if( keywords.exists("LABEL") ) parse("LABEL",mylabel); if( mylabel.length()==0 && numlab>=0 ){ - mylabel=myname; std::string nn; - // Convert to lower case - std::transform( mylabel.begin(), mylabel.end(), mylabel.begin(), tolower ); - // Remove any underscore characters (as these are reserved) - for(unsigned i=0;;++i){ - std::size_t num=mylabel.find_first_of("_"); - if( num==std::string::npos ) break; - mylabel.erase( mylabel.begin() + num, mylabel.begin() + num + 1 ); - } + mylabel=transformName( myname ); std::string nn; if(numlab>0){ Tools::convert( numlab, nn ); mylabel = mylabel + "-" + nn; } else { mylabel = mylabel; } } diff --git a/src/vesselbase/Vessel.h b/src/vesselbase/Vessel.h index 29abac6f13dfa5cb745d4795d6f9672c958a6f87..1074f6b93d5bca8ae5a6e762bd7bccd27678e03e 100644 --- a/src/vesselbase/Vessel.h +++ b/src/vesselbase/Vessel.h @@ -129,6 +129,8 @@ public: Log& log; /// Reserve any keywords for this particular vessel static void registerKeywords( Keywords& keys ); +/// Convert the name to the label of the component + static std::string transformName( const std::string& name ); /// The constructor Vessel( const VesselOptions& da ); /// Virtual destructor needed for proper inheritance