From 8e9a99c9809df766a2d0a36c509bf63f30639db0 Mon Sep 17 00:00:00 2001 From: Gareth Aneurin Tribello Date: Fri, 17 May 2024 10:21:09 +0100 Subject: [PATCH] Added names of action in value dictionary that is output by driver and used by PlumedToHTML This commit looks more complicated as for actions like DISTANCE_VECTOR I want the name of the action to be displayed as DISTANCE as that is the name the user employs. I achieve this by setting a display name for each action in the keywords file. --- .../basic/rt-parse-only/values.json.reference | 10 ++++++ .../rt-parse-only/values.json.reference | 31 +++++++++++++++++++ .../rt-parse-only/values.json.reference | 27 ++++++++++++++++ .../rt-parse-only/values.json.reference | 19 ++++++++++++ .../wham/rt-parse-only/values.json.reference | 16 ++++++++++ src/adjmat/ContactMatrix.cpp | 2 +- src/bias/LWalls.cpp | 2 +- src/bias/Restraint.cpp | 2 +- src/bias/UWalls.cpp | 2 +- src/cltools/Driver.cpp | 29 ++++++++--------- src/clusters/ClusterDistribution.cpp | 2 +- src/colvar/Angle.cpp | 2 +- src/colvar/DihedralCorrelation.cpp | 2 +- src/colvar/Dipole.cpp | 2 +- src/colvar/Distance.cpp | 2 +- src/colvar/Gyration.cpp | 2 +- src/colvar/MultiColvarTemplate.h | 5 +-- src/colvar/Plane.cpp | 2 +- src/colvar/Position.cpp | 2 +- src/colvar/RMSD.cpp | 2 +- src/colvar/RMSDVector.cpp | 2 +- src/colvar/SelectMassCharge.cpp | 5 +-- src/colvar/Torsion.cpp | 2 +- src/core/ActionShortcut.cpp | 5 +++ src/crystdistrib/Quaternion.cpp | 2 +- src/function/FunctionOfMatrix.h | 9 +++--- src/function/FunctionOfScalar.h | 7 +++-- src/function/FunctionOfVector.h | 11 ++++--- src/function/Highest.cpp | 2 +- src/gridtools/FunctionOfGrid.h | 5 +-- src/tools/Keywords.cpp | 6 +++- src/tools/Keywords.h | 4 ++- src/vatom/Center.cpp | 1 + src/volumes/VolumeAround.cpp | 2 +- src/volumes/VolumeBetweenContours.cpp | 2 +- src/volumes/VolumeCavity.cpp | 2 +- src/volumes/VolumeInCylinder.cpp | 2 +- src/volumes/VolumeInSphere.cpp | 2 +- src/volumes/VolumeTetrapore.cpp | 2 +- 39 files changed, 175 insertions(+), 61 deletions(-) diff --git a/regtest/basic/rt-parse-only/values.json.reference b/regtest/basic/rt-parse-only/values.json.reference index 90eaf9d593..8cd684b214 100644 --- a/regtest/basic/rt-parse-only/values.json.reference +++ b/regtest/basic/rt-parse-only/values.json.reference @@ -1,32 +1,42 @@ { "timestep" : { +"action" : "PUT", "timestep" : { "type": "scalar", "desciption": "" } }, "posx" : { +"action" : "PUT", "posx" : { "type": "vector", "desciption": "" } }, "posy" : { +"action" : "PUT", "posy" : { "type": "vector", "desciption": "" } }, "posz" : { +"action" : "PUT", "posz" : { "type": "vector", "desciption": "" } }, "Masses" : { +"action" : "PUT", "Masses" : { "type": "vector", "desciption": "" } }, "Charges" : { +"action" : "PUT", "Charges" : { "type": "vector", "desciption": "" } }, "Box" : { +"action" : "PBC", "Box" : { "type": "matrix", "desciption": "" } }, "phi" : { +"action" : "TORSION", "phi" : { "type": "scalar", "desciption": "" } }, "r1" : { +"action" : "READ", "r1.X" : { "type": "scalar", "description": "values from the column labelled p2.X in the file named input_colvar" } }, "r2" : { +"action" : "READ", "r2.X" : { "type": "scalar", "description": "values from the column labelled p3.X in the file named input_colvar" }, "r2.Y" : { "type": "scalar", "description": "values from the column labelled p3.Y in the file named input_colvar" }, "r2.zzz" : { "type": "scalar", "description": "values from the column labelled p3.zzz in the file named input_colvar" } diff --git a/regtest/contour/rt-parse-only/values.json.reference b/regtest/contour/rt-parse-only/values.json.reference index db09bb6998..4957528c09 100644 --- a/regtest/contour/rt-parse-only/values.json.reference +++ b/regtest/contour/rt-parse-only/values.json.reference @@ -1,102 +1,133 @@ { "timestep" : { +"action" : "PUT", "timestep" : { "type": "scalar", "desciption": "" } }, "posx" : { +"action" : "PUT", "posx" : { "type": "vector", "desciption": "" } }, "posy" : { +"action" : "PUT", "posy" : { "type": "vector", "desciption": "" } }, "posz" : { +"action" : "PUT", "posz" : { "type": "vector", "desciption": "" } }, "Masses" : { +"action" : "PUT", "Masses" : { "type": "vector", "desciption": "" } }, "Charges" : { +"action" : "PUT", "Charges" : { "type": "vector", "desciption": "" } }, "Box" : { +"action" : "PBC", "Box" : { "type": "matrix", "desciption": "" } }, "fcc_grp" : { +"action" : "GROUP", "fcc_grp" : { "type": "atoms", "desciption": "" } }, "fcc_mat" : { +"action" : "CONTACT_MATRIX", "fcc_mat.w" : { "type": "matrix", "desciption": "" } "fcc_mat.x" : { "type": "matrix", "desciption": "" } "fcc_mat.y" : { "type": "matrix", "desciption": "" } "fcc_mat.z" : { "type": "matrix", "desciption": "" } }, "fcc_vfunc" : { +"action" : "FCCUBIC_FUNC", "fcc_vfunc" : { "type": "matrix", "desciption": "" } }, "fcc_wvfunc" : { +"action" : "CUSTOM", "fcc_wvfunc" : { "type": "matrix", "desciption": "" } }, "fcc_ones" : { +"action" : "CONSTANT", "fcc_ones" : { "type": "vector", "desciption": "" } }, "shortcut_fcc_ones" : { +"action" : "ONES", "fcc_ones" : { "type": "vector", "desciption": "" } }, "fcc" : { +"action" : "MATRIX_VECTOR_PRODUCT", "fcc" : { "type": "vector", "desciption": "" } }, "fcc_denom" : { +"action" : "MATRIX_VECTOR_PRODUCT", "fcc_denom" : { "type": "vector", "desciption": "" } }, "fcc_n" : { +"action" : "CUSTOM", "fcc_n" : { "type": "vector", "desciption": "" } }, "shortcut_fcc" : { +"action" : "FCCUBIC", "fcc" : { "type": "vector", "desciption": "" } }, "dens_dist" : { +"action" : "DISTANCE", "dens_dist.x" : { "type": "vector", "desciption": "" } "dens_dist.y" : { "type": "vector", "desciption": "" } "dens_dist.z" : { "type": "vector", "desciption": "" } }, "shortcut_dens_dist" : { +"action" : "DISTANCES", "dens_dist.x" : { "type": "vector", "desciption": "" } "dens_dist.y" : { "type": "vector", "desciption": "" } "dens_dist.z" : { "type": "vector", "desciption": "" } }, "dens_numer_sigma" : { +"action" : "CONSTANT", "dens_numer_sigma" : { "type": "vector", "desciption": "" } }, "dens_numer_cov" : { +"action" : "CUSTOM", "dens_numer_cov" : { "type": "vector", "desciption": "" } }, "dens_numer_icov" : { +"action" : "CUSTOM", "dens_numer_icov" : { "type": "vector", "desciption": "" } }, "dens_numer" : { +"action" : "KDE", "dens_numer" : { "type": "grid", "desciption": "" } }, "ones" : { +"action" : "CONSTANT", "ones" : { "type": "vector", "desciption": "" } }, "shortcut_ones" : { +"action" : "ONES", "ones" : { "type": "vector", "desciption": "" } }, "dens_denom_sigma" : { +"action" : "CONSTANT", "dens_denom_sigma" : { "type": "vector", "desciption": "" } }, "dens_denom_cov" : { +"action" : "CUSTOM", "dens_denom_cov" : { "type": "vector", "desciption": "" } }, "dens_denom_icov" : { +"action" : "CUSTOM", "dens_denom_icov" : { "type": "vector", "desciption": "" } }, "dens_denom" : { +"action" : "KDE", "dens_denom" : { "type": "grid", "desciption": "" } }, "dens" : { +"action" : "CUSTOM", "dens" : { "type": "grid", "desciption": "" } }, "cont" : { +"action" : "FIND_CONTOUR", "cont.dens_dist.x" : { "type": "vector", "description": "a vector of coordinates for the contour along the dens_dist.x direction" }, "cont.dens_dist.y" : { "type": "vector", "description": "a vector of coordinates for the contour along the dens_dist.y direction" }, "cont.dens_dist.z" : { "type": "vector", "description": "a vector of coordinates for the contour along the dens_dist.z direction" } diff --git a/regtest/multicolvar/rt-parse-only/values.json.reference b/regtest/multicolvar/rt-parse-only/values.json.reference index c1e9fec44e..daa6d2bfe6 100644 --- a/regtest/multicolvar/rt-parse-only/values.json.reference +++ b/regtest/multicolvar/rt-parse-only/values.json.reference @@ -1,88 +1,115 @@ { "timestep" : { +"action" : "PUT", "timestep" : { "type": "scalar", "desciption": "" } }, "posx" : { +"action" : "PUT", "posx" : { "type": "vector", "desciption": "" } }, "posy" : { +"action" : "PUT", "posy" : { "type": "vector", "desciption": "" } }, "posz" : { +"action" : "PUT", "posz" : { "type": "vector", "desciption": "" } }, "Masses" : { +"action" : "PUT", "Masses" : { "type": "vector", "desciption": "" } }, "Charges" : { +"action" : "PUT", "Charges" : { "type": "vector", "desciption": "" } }, "Box" : { +"action" : "PBC", "Box" : { "type": "matrix", "desciption": "" } }, "d1" : { +"action" : "DISTANCE", "d1" : { "type": "scalar", "desciption": "" } }, "d2" : { +"action" : "DISTANCE", "d2" : { "type": "scalar", "desciption": "" } }, "d3" : { +"action" : "DISTANCE", "d3" : { "type": "scalar", "desciption": "" } }, "ss" : { +"action" : "SORT", "ss.1" : { "type": "scalar", "desciption": "1th" } "ss.2" : { "type": "scalar", "desciption": "2th" } "ss.3" : { "type": "scalar", "desciption": "3th" } }, "dall" : { +"action" : "DISTANCE", "dall" : { "type": "vector", "desciption": "" } }, "ssall" : { +"action" : "SORT", "ssall.1" : { "type": "scalar", "desciption": "1th" } "ssall.2" : { "type": "scalar", "desciption": "2th" } "ssall.3" : { "type": "scalar", "desciption": "3th" } }, "dallt" : { +"action" : "DISTANCE", "dallt" : { "type": "vector", "desciption": "" } }, "sfinal" : { +"action" : "SORT", "sfinal.1" : { "type": "scalar", "desciption": "1th" } "sfinal.2" : { "type": "scalar", "desciption": "2th" } }, "dallk_vatom1" : { +"action" : "CENTER_FAST", "dallk_vatom1" : { "type": "atoms", "desciption": "" } }, "dallk_vatom2" : { +"action" : "CENTER_FAST", "dallk_vatom2" : { "type": "atoms", "desciption": "" } }, "dallk_vatom3" : { +"action" : "CENTER_FAST", "dallk_vatom3" : { "type": "atoms", "desciption": "" } }, "dallk_grp" : { +"action" : "GROUP", "dallk_grp" : { "type": "atoms", "desciption": "" } }, "dallk" : { +"action" : "DISTANCE", "dallk" : { "type": "vector", "desciption": "" } }, "dallk_lt1" : { +"action" : "LESS_THAN", "dallk_lt1" : { "type": "vector", "desciption": "" } }, "dallk_lessthan-1" : { +"action" : "SUM", "dallk_lessthan-1" : { "type": "scalar", "desciption": "" } }, "dallk_lt2" : { +"action" : "LESS_THAN", "dallk_lt2" : { "type": "vector", "desciption": "" } }, "dallk_lessthan-2" : { +"action" : "SUM", "dallk_lessthan-2" : { "type": "scalar", "desciption": "" } }, "dallk_lowest" : { +"action" : "LOWEST", "dallk_lowest" : { "type": "scalar", "desciption": "" } }, "dallk_mean" : { +"action" : "MEAN", "dallk_mean" : { "type": "scalar", "desciption": "" } }, "shortcut_dallk" : { +"action" : "DISTANCES", "dallk" : { "type": "vector", "desciption": "" } "dallk_lessthan-1" : { "type": "scalar", "desciption": "" } "dallk_lessthan-2" : { "type": "scalar", "desciption": "" } diff --git a/regtest/symfunc/rt-parse-only/values.json.reference b/regtest/symfunc/rt-parse-only/values.json.reference index aece627457..5b635d2c08 100644 --- a/regtest/symfunc/rt-parse-only/values.json.reference +++ b/regtest/symfunc/rt-parse-only/values.json.reference @@ -1,35 +1,45 @@ { "timestep" : { +"action" : "PUT", "timestep" : { "type": "scalar", "desciption": "" } }, "posx" : { +"action" : "PUT", "posx" : { "type": "vector", "desciption": "" } }, "posy" : { +"action" : "PUT", "posy" : { "type": "vector", "desciption": "" } }, "posz" : { +"action" : "PUT", "posz" : { "type": "vector", "desciption": "" } }, "Masses" : { +"action" : "PUT", "Masses" : { "type": "vector", "desciption": "" } }, "Charges" : { +"action" : "PUT", "Charges" : { "type": "vector", "desciption": "" } }, "Box" : { +"action" : "PBC", "Box" : { "type": "matrix", "desciption": "" } }, "q1_grp" : { +"action" : "GROUP", "q1_grp" : { "type": "atoms", "desciption": "" } }, "q1_mat" : { +"action" : "CONTACT_MATRIX", "q1_mat.w" : { "type": "matrix", "desciption": "" } "q1_mat.x" : { "type": "matrix", "desciption": "" } "q1_mat.y" : { "type": "matrix", "desciption": "" } "q1_mat.z" : { "type": "matrix", "desciption": "" } }, "q1_sh" : { +"action" : "SPHERICAL_HARMONIC", "q1_sh.rm-n1" : { "type": "matrix", "desciption": "" } "q1_sh.rm-0" : { "type": "matrix", "desciption": "" } "q1_sh.rm-p1" : { "type": "matrix", "desciption": "" } @@ -38,15 +48,19 @@ "q1_sh.im-p1" : { "type": "matrix", "desciption": "" } }, "q1_denom_ones" : { +"action" : "CONSTANT", "q1_denom_ones" : { "type": "vector", "desciption": "" } }, "shortcut_q1_denom_ones" : { +"action" : "ONES", "q1_denom_ones" : { "type": "vector", "desciption": "" } }, "q1_denom" : { +"action" : "MATRIX_VECTOR_PRODUCT", "q1_denom" : { "type": "vector", "desciption": "" } }, "q1_sp" : { +"action" : "MATRIX_VECTOR_PRODUCT", "q1_sp.rm-n1" : { "type": "vector", "description": "the product of the matrix q1_sh.rm-n1 and the vector q1_denom_ones" }, "q1_sp.rm-0" : { "type": "vector", "description": "the product of the matrix q1_sh.rm-0 and the vector q1_denom_ones" }, "q1_sp.rm-p1" : { "type": "vector", "description": "the product of the matrix q1_sh.rm-p1 and the vector q1_denom_ones" }, @@ -55,18 +69,23 @@ "q1_sp.im-p1" : { "type": "vector", "description": "the product of the matrix q1_sh.im-p1 and the vector q1_denom_ones" } }, "q1_norm2" : { +"action" : "COMBINE", "q1_norm2" : { "type": "vector", "desciption": "" } }, "q1_norm" : { +"action" : "CUSTOM", "q1_norm" : { "type": "vector", "desciption": "" } }, "q1" : { +"action" : "CUSTOM", "q1" : { "type": "vector", "desciption": "" } }, "shortcut_q1" : { +"action" : "Q1", "q1" : { "type": "vector", "desciption": "" } }, "gg" : { +"action" : "GSYMFUNC_THREEBODY", "gg.g6" : { "type": "vector", "description": "the function defined by the FUNCTION1 keyword" }, "gg.g7" : { "type": "vector", "description": "the function defined by the FUNCTION2 keyword" } } diff --git a/regtest/wham/rt-parse-only/values.json.reference b/regtest/wham/rt-parse-only/values.json.reference index 199991f136..10d232be35 100644 --- a/regtest/wham/rt-parse-only/values.json.reference +++ b/regtest/wham/rt-parse-only/values.json.reference @@ -1,51 +1,67 @@ { "timestep" : { +"action" : "PUT", "timestep" : { "type": "scalar", "desciption": "" } }, "posx" : { +"action" : "PUT", "posx" : { "type": "vector", "desciption": "" } }, "posy" : { +"action" : "PUT", "posy" : { "type": "vector", "desciption": "" } }, "posz" : { +"action" : "PUT", "posz" : { "type": "vector", "desciption": "" } }, "Masses" : { +"action" : "PUT", "Masses" : { "type": "vector", "desciption": "" } }, "Charges" : { +"action" : "PUT", "Charges" : { "type": "vector", "desciption": "" } }, "Box" : { +"action" : "PBC", "Box" : { "type": "matrix", "desciption": "" } }, "phi" : { +"action" : "TORSION", "phi" : { "type": "scalar", "desciption": "" } }, "rp" : { +"action" : "RESTRAINT", "rp.bias" : { "type": "scalar", "desciption": "" } "rp.force2" : { "type": "scalar", "desciption": "" } }, "hh_gather" : { +"action" : "GATHER_REPLICAS", "hh_gather.rep-1" : { "type": "scalar", "desciption": "" } }, "hh_gatherv" : { +"action" : "CONCATENATE", "hh_gatherv" : { "type": "vector", "desciption": "" } }, "hh_collect" : { +"action" : "COLLECT", "hh_collect" : { "type": "vector", "desciption": "" } }, "hh_wham" : { +"action" : "WHAM", "hh_wham" : { "type": "vector", "desciption": "" } }, "hh_data_phi" : { +"action" : "COLLECT", "hh_data_phi" : { "type": "vector", "desciption": "" } }, "hh" : { +"action" : "KDE", "hh" : { "type": "grid", "desciption": "" } }, "shortcut_hh" : { +"action" : "WHAM_HISTOGRAM", "hh" : { "type": "grid", "desciption": "" } } } diff --git a/src/adjmat/ContactMatrix.cpp b/src/adjmat/ContactMatrix.cpp index c084e9f2d5..81d7871280 100644 --- a/src/adjmat/ContactMatrix.cpp +++ b/src/adjmat/ContactMatrix.cpp @@ -78,7 +78,7 @@ class ContactMatrix : public AdjacencyMatrixBase { PLUMED_REGISTER_ACTION(ContactMatrix,"CONTACT_MATRIX_PROPER") void ContactMatrix::registerKeywords( Keywords& keys ) { - AdjacencyMatrixBase::registerKeywords( keys ); + AdjacencyMatrixBase::registerKeywords( keys ); keys.setDisplayName("CONTACT_MATRIX"); keys.add("compulsory","NN","6","The n parameter of the switching function "); keys.add("compulsory","MM","0","The m parameter of the switching function; 0 implies 2*NN"); keys.add("compulsory","D_0","0.0","The d_0 parameter of the switching function"); diff --git a/src/bias/LWalls.cpp b/src/bias/LWalls.cpp index 0f49a6650c..d6553a3d86 100644 --- a/src/bias/LWalls.cpp +++ b/src/bias/LWalls.cpp @@ -86,7 +86,7 @@ class LWalls : public Bias { PLUMED_REGISTER_ACTION(LWalls,"LOWER_WALLS_SCALAR") void LWalls::registerKeywords(Keywords& keys) { - Bias::registerKeywords(keys); + Bias::registerKeywords(keys); keys.setDisplayName("LOWER_WALLS"); keys.use("ARG"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); keys.add("compulsory","AT","the positions of the wall. The a_i in the expression for a wall."); keys.add("compulsory","KAPPA","the force constant for the wall. The k_i in the expression for a wall."); diff --git a/src/bias/Restraint.cpp b/src/bias/Restraint.cpp index 0f519269a3..481d07a93f 100644 --- a/src/bias/Restraint.cpp +++ b/src/bias/Restraint.cpp @@ -80,7 +80,7 @@ PLUMED_REGISTER_ACTION(Restraint,"RESTRAINT_SCALAR") void Restraint::registerKeywords(Keywords& keys) { Bias::registerKeywords(keys); - keys.use("ARG"); + keys.use("ARG"); keys.setDisplayName("RESTRAINT"); keys.add("compulsory","SLOPE","0.0","specifies that the restraint is linear and what the values of the force constants on each of the variables are"); keys.add("compulsory","KAPPA","0.0","specifies that the restraint is harmonic and what the values of the force constants on each of the variables are"); keys.add("compulsory","AT","the position of the restraint"); diff --git a/src/bias/UWalls.cpp b/src/bias/UWalls.cpp index 0e808b875c..9bcb4b3ae0 100644 --- a/src/bias/UWalls.cpp +++ b/src/bias/UWalls.cpp @@ -85,7 +85,7 @@ class UWalls : public Bias { PLUMED_REGISTER_ACTION(UWalls,"UPPER_WALLS_SCALAR") void UWalls::registerKeywords(Keywords& keys) { - Bias::registerKeywords(keys); + Bias::registerKeywords(keys); keys.setDisplayName("UPPER_WALLS"); keys.use("ARG"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); keys.add("compulsory","AT","the positions of the wall. The a_i in the expression for a wall."); keys.add("compulsory","KAPPA","the force constant for the wall. The k_i in the expression for a wall."); diff --git a/src/cltools/Driver.cpp b/src/cltools/Driver.cpp index 1644b4690d..5bd840348e 100644 --- a/src/cltools/Driver.cpp +++ b/src/cltools/Driver.cpp @@ -780,25 +780,24 @@ int Driver::main(FILE* in,FILE*out,Communicator& pc) { ActionWithVirtualAtom* avv=dynamic_cast(pp.get()); if( avv || pp.get()->getName()=="GROUP" || pp.get()->getName()=="DENSITY" ) { Action* p(pp.get()); - if( firsta ) { valuefile.printf(" \"%s\" : {\n", p->getLabel().c_str() ); firsta=false; } - else valuefile.printf(",\n \"%s\" : {\n", p->getLabel().c_str() ); - if( avv ) valuefile.printf(" \"%s\" : { \"type\": \"atoms\", \"description\": \"virtual atom calculated by %s action\" }", avv->getLabel().c_str(), avv->getName().c_str() ); - else valuefile.printf(" \"%s\" : { \"type\": \"atoms\", \"description\": \"indices of atoms specified in GROUP\" }", p->getLabel().c_str() ); + if( firsta ) { valuefile.printf(" \"%s\" : {\n \"action\" : \"%s\"", p->getLabel().c_str(), p->getName().c_str() ); firsta=false; } + else valuefile.printf(",\n \"%s\" : {\n \"action\" : \"%s\"", p->getLabel().c_str(), p->getName().c_str() ); + if( avv ) valuefile.printf(",\n \"%s\" : { \"type\": \"atoms\", \"description\": \"virtual atom calculated by %s action\" }", avv->getLabel().c_str(), avv->getName().c_str() ); + else valuefile.printf(",\n \"%s\" : { \"type\": \"atoms\", \"description\": \"indices of atoms specified in GROUP\" }", p->getLabel().c_str() ); valuefile.printf("\n }"); continue; } ActionWithValue* av=dynamic_cast(pp.get()); if( av && av->getNumberOfComponents()>0 ) { - if( firsta ) { valuefile.printf(" \"%s\" : {\n", av->getLabel().c_str() ); firsta=false; } - else valuefile.printf(",\n \"%s\" : {\n", av->getLabel().c_str() ); - bool firstv=true; Keywords keys; actionRegister().getKeywords( av->getName(), keys ); + Keywords keys; actionRegister().getKeywords( av->getName(), keys ); + if( firsta ) { valuefile.printf(" \"%s\" : {\n \"action\" : \"%s\"", av->getLabel().c_str(), keys.getDisplayName().c_str() ); firsta=false; } + else valuefile.printf(",\n \"%s\" : {\n \"action\" : \"%s\"", av->getLabel().c_str(), keys.getDisplayName().c_str() ); for(unsigned i=0; igetNumberOfComponents(); ++i) { Value* myval = av->copyOutput(i); std::string compname = myval->getName(), description; std::size_t dot=compname.find("."); if( dot!=std::string::npos ) { std::string cname = compname.substr(dot+1); description = av->getOutputComponentDescription( cname, keys ); } else description = keys.getOutputComponentDescription(".#!value"); if( description.find("\\")!=std::string::npos ) error("found invalid backslash character in documentation for component " + compname + " in action " + av->getName() + " with label " + av->getLabel() ); - if( firstv ) { valuefile.printf(" \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); firstv=false; } - else valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); + valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); } valuefile.printf("\n }"); } @@ -807,9 +806,9 @@ int Driver::main(FILE* in,FILE*out,Communicator& pc) { std::vector cnames( as->getSavedOutputs() ); if( cnames.size()==0 ) continue ; - if( firsta ) { valuefile.printf(" \"shortcut_%s\" : {\n", as->getShortcutLabel().c_str() ); firsta=false; } - else valuefile.printf(",\n \"shortcut_%s\" : {\n", as->getShortcutLabel().c_str() ); - bool firstv=true; Keywords keys; actionRegister().getKeywords( as->getName(), keys ); + if( firsta ) { valuefile.printf(" \"shortcut_%s\" : {\n \"action\" : \"%s\"", as->getShortcutLabel().c_str(), as->getName().c_str() ); firsta=false; } + else valuefile.printf(",\n \"shortcut_%s\" : {\n \"action\" : \"%s\"", as->getShortcutLabel().c_str(), as->getName().c_str() ); + Keywords keys; actionRegister().getKeywords( as->getName(), keys ); for(unsigned i=0; i( cnames[i] ); if( !av2 ) plumed_merror("could not find value created by shortcut with name " + cnames[i] ); @@ -818,8 +817,7 @@ int Driver::main(FILE* in,FILE*out,Communicator& pc) { if( compname==as->getShortcutLabel() ) description = keys.getOutputComponentDescription(".#!value"); else { std::size_t pp=compname.find(as->getShortcutLabel()); description = keys.getOutputComponentDescription( compname.substr(pp+as->getShortcutLabel().length()+1) ); } if( description.find("\\")!=std::string::npos ) error("found invalid backslash character in documentation for component " + compname + " in action " + as->getName() + " with label " + as->getLabel() ); - if( firstv ) { valuefile.printf(" \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); firstv=false; } - else valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); + valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); } else { for(unsigned j=0; jgetNumberOfComponents(); ++j) { Value* myval = av2->copyOutput(j); std::string compname = myval->getName(), description; std::size_t dot=compname.find("."); @@ -827,8 +825,7 @@ int Driver::main(FILE* in,FILE*out,Communicator& pc) { std::string cname = compname.substr(dot+1); description = av2->getOutputComponentDescription( cname, keys ); } else plumed_merror("should not be outputting description of value from action when using shortcuts"); if( description.find("\\")!=std::string::npos ) error("found invalid backslash character in documentation for component " + compname + " in action " + av2->getName() + " with label " + av2->getLabel() ); - if( firstv ) { valuefile.printf(" \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); firstv=false; } - else valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); + valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() ); } } } diff --git a/src/clusters/ClusterDistribution.cpp b/src/clusters/ClusterDistribution.cpp index 949e15aa42..7a38671a1c 100644 --- a/src/clusters/ClusterDistribution.cpp +++ b/src/clusters/ClusterDistribution.cpp @@ -99,7 +99,7 @@ void ClusterDistribution::registerKeywords( Keywords& keys ) { Action::registerKeywords( keys ); ActionWithArguments::registerKeywords( keys ); ActionWithValue::registerKeywords( keys ); keys.remove("NUMERICAL_DERIVATIVES"); - keys.add("compulsory","CLUSTERS","the label of the action that does the clustering"); + keys.add("compulsory","CLUSTERS","the label of the action that does the clustering"); keys.setDisplayName("CLUSTER_DISTRIBUTION"); keys.add("optional","WEIGHTS","use the vector of values calculated by this action as weights rather than giving each atom a unit weight"); keys.setValueDescription("a vector containing the sum of a atomic-cv that is calculated for each of the identified clusters"); } diff --git a/src/colvar/Angle.cpp b/src/colvar/Angle.cpp index af6e904e6e..846e0432f7 100644 --- a/src/colvar/Angle.cpp +++ b/src/colvar/Angle.cpp @@ -122,7 +122,7 @@ typedef MultiColvarTemplate AngleMulti; PLUMED_REGISTER_ACTION(AngleMulti,"ANGLE_VECTOR") void Angle::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords(keys); + Colvar::registerKeywords(keys); keys.setDisplayName("ANGLE"); keys.add("atoms","ATOMS","the list of atoms involved in this collective variable (either 3 or 4 atoms)"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); keys.setValueDescription("the ANGLE involving these atoms"); diff --git a/src/colvar/DihedralCorrelation.cpp b/src/colvar/DihedralCorrelation.cpp index 334d869a3d..19e08feb1b 100644 --- a/src/colvar/DihedralCorrelation.cpp +++ b/src/colvar/DihedralCorrelation.cpp @@ -85,7 +85,7 @@ typedef MultiColvarTemplate DihedralCorrelationMulti; PLUMED_REGISTER_ACTION(DihedralCorrelationMulti,"DIHEDRAL_CORRELATION_VECTOR") void DihedralCorrelation::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("DIHEDRAL_CORRELATION"); keys.add("atoms","ATOMS","the set of 8 atoms that are being used to calculate this quantity"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); keys.setValueDescription("the DIHEDRAL_CORRELATION for these atoms"); diff --git a/src/colvar/Dipole.cpp b/src/colvar/Dipole.cpp index 0b0199c375..e0a9212455 100644 --- a/src/colvar/Dipole.cpp +++ b/src/colvar/Dipole.cpp @@ -106,7 +106,7 @@ typedef MultiColvarTemplate DipoleMulti; PLUMED_REGISTER_ACTION(DipoleMulti,"DIPOLE_VECTOR") void Dipole::registerKeywords(Keywords& keys) { - Colvar::registerKeywords(keys); + Colvar::registerKeywords(keys); keys.setDisplayName("DIPOLE"); keys.add("atoms","GROUP","the group of atoms we are calculating the dipole moment for"); keys.addFlag("COMPONENTS",false,"calculate the x, y and z components of the dipole separately and store them as label.x, label.y and label.z"); keys.addOutputComponent("x","COMPONENTS","the x-component of the dipole"); diff --git a/src/colvar/Distance.cpp b/src/colvar/Distance.cpp index c3108ed6ae..b2d75a27fe 100644 --- a/src/colvar/Distance.cpp +++ b/src/colvar/Distance.cpp @@ -150,7 +150,7 @@ typedef MultiColvarTemplate DistanceMulti; PLUMED_REGISTER_ACTION(DistanceMulti,"DISTANCE_VECTOR") void Distance::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("DISTANCE"); keys.add("atoms","ATOMS","the pair of atom that we are calculating the distance between"); keys.addFlag("COMPONENTS",false,"calculate the x, y and z components of the distance separately and store them as label.x, label.y and label.z"); keys.addFlag("SCALED_COMPONENTS",false,"calculate the a, b and c scaled components of the distance separately and store them as label.a, label.b and label.c"); diff --git a/src/colvar/Gyration.cpp b/src/colvar/Gyration.cpp index 629a10d850..c9ad222fc1 100644 --- a/src/colvar/Gyration.cpp +++ b/src/colvar/Gyration.cpp @@ -93,7 +93,7 @@ class Gyration : public Colvar { PLUMED_REGISTER_ACTION(Gyration,"GYRATION_FAST") void Gyration::registerKeywords(Keywords& keys) { - Colvar::registerKeywords(keys); + Colvar::registerKeywords(keys); keys.setDisplayName("GYRATION"); keys.add("atoms","ATOMS","the group of atoms that you are calculating the Gyration Tensor for"); keys.add("compulsory","TYPE","RADIUS","The type of calculation relative to the Gyration Tensor you want to perform"); keys.addFlag("MASS_WEIGHTED",false,"set the masses of all the atoms equal to one"); diff --git a/src/colvar/MultiColvarTemplate.h b/src/colvar/MultiColvarTemplate.h index b521f39900..3c15e05bec 100644 --- a/src/colvar/MultiColvarTemplate.h +++ b/src/colvar/MultiColvarTemplate.h @@ -56,10 +56,7 @@ void MultiColvarTemplate::registerKeywords(Keywords& keys ) { for(unsigned i=0; i diff --git a/src/colvar/Plane.cpp b/src/colvar/Plane.cpp index 035e91216c..9d57a1832d 100644 --- a/src/colvar/Plane.cpp +++ b/src/colvar/Plane.cpp @@ -84,7 +84,7 @@ typedef MultiColvarTemplate PlaneMulti; PLUMED_REGISTER_ACTION(PlaneMulti,"PLANE_VECTOR") void Plane::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("PLANE"); keys.add("atoms","ATOMS","the three or four atoms whose plane we are computing"); keys.addOutputComponent("x","default","the x-component of the vector that is normal to the plane containing the atoms"); keys.addOutputComponent("y","default","the y-component of the vector that is normal to the plane containing the atoms"); diff --git a/src/colvar/Position.cpp b/src/colvar/Position.cpp index 4019442eae..20bdc8f234 100644 --- a/src/colvar/Position.cpp +++ b/src/colvar/Position.cpp @@ -115,7 +115,7 @@ typedef MultiColvarTemplate PositionMulti; PLUMED_REGISTER_ACTION(PositionMulti,"POSITION_VECTOR") void Position::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("POSITION"); keys.add("atoms","ATOM","the atom number"); keys.add("atoms","ATOMS","the atom numbers that you would like to use the positions of"); keys.addFlag("WHOLEMOLECULES",false,"if this is a vector of positions do you want to make the positions into a whole before"); diff --git a/src/colvar/RMSD.cpp b/src/colvar/RMSD.cpp index 72fe18837a..55ad012ebc 100644 --- a/src/colvar/RMSD.cpp +++ b/src/colvar/RMSD.cpp @@ -167,7 +167,7 @@ END PLUMED_REGISTER_ACTION(RMSD,"RMSD_SCALAR") void RMSD::registerKeywords(Keywords& keys) { - Colvar::registerKeywords(keys); + Colvar::registerKeywords(keys); keys.setDisplayName("RMSD"); keys.add("compulsory","REFERENCE","a file in pdb format containing the reference structure and the atoms involved in the CV."); keys.add("compulsory","TYPE","SIMPLE","the manner in which RMSD alignment is performed. Should be OPTIMAL or SIMPLE."); keys.addFlag("SQUARED",false," This should be set if you want mean squared displacement instead of RMSD "); diff --git a/src/colvar/RMSDVector.cpp b/src/colvar/RMSDVector.cpp index 5fe21bbd5f..b183dd5e1e 100644 --- a/src/colvar/RMSDVector.cpp +++ b/src/colvar/RMSDVector.cpp @@ -40,7 +40,7 @@ namespace colvar { PLUMED_REGISTER_ACTION(RMSDVector,"RMSD_VECTOR") void RMSDVector::registerKeywords(Keywords& keys) { - ActionWithVector::registerKeywords(keys); keys.use("ARG"); + ActionWithVector::registerKeywords(keys); keys.use("ARG"); keys.setDisplayName("RMSD"); keys.add("compulsory","TYPE","SIMPLE","the manner in which RMSD alignment is performed. Should be OPTIMAL or SIMPLE."); keys.add("compulsory","ALIGN","1.0","the weights to use when aligning to the reference structure"); keys.add("compulsory","DISPLACE","1.0","the weights to use when calculating the displacement from the reference structure"); diff --git a/src/colvar/SelectMassCharge.cpp b/src/colvar/SelectMassCharge.cpp index df15ef3dfc..4d5a4855ea 100644 --- a/src/colvar/SelectMassCharge.cpp +++ b/src/colvar/SelectMassCharge.cpp @@ -109,8 +109,9 @@ void SelectMassCharge::registerKeywords( Keywords& keys ) { keys.add("atoms","ATOM","the atom number"); keys.add("atoms","ATOMS","the atom numbers that you would like to store the masses and charges of"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); - std::string acname = keys.getActionName(); std::size_t und = acname.find("_SCALAR"); - keys.setValueDescription("the " + acname.substr(0,und) + " of the atom"); + std::string acname = keys.getDisplayName(); std::size_t und = acname.find("_SCALAR"); + if( und==std::string::npos ) und = acname.find("_VECTOR"); + keys.setDisplayName( acname.substr(0,und) ); keys.setValueDescription("the " + keys.getDisplayName() + " of the atom"); } SelectMassCharge::SelectMassCharge(const ActionOptions&ao): diff --git a/src/colvar/Torsion.cpp b/src/colvar/Torsion.cpp index 9ed2c61e64..710b1359eb 100644 --- a/src/colvar/Torsion.cpp +++ b/src/colvar/Torsion.cpp @@ -132,7 +132,7 @@ typedef MultiColvarTemplate TorsionMulti; PLUMED_REGISTER_ACTION(TorsionMulti,"TORSION_VECTOR") void Torsion::registerKeywords(Keywords& keys) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("TORSION"); keys.add("atoms-1","ATOMS","the four atoms involved in the torsional angle"); keys.add("atoms-2","AXIS","two atoms that define an axis. You can use this to find the angle in the plane perpendicular to the axis between the vectors specified using the VECTORA and VECTORB keywords."); keys.add("atoms-2","VECTORA","two atoms that define a vector. You can use this in combination with VECTOR2 and AXIS"); diff --git a/src/core/ActionShortcut.cpp b/src/core/ActionShortcut.cpp index 600ee9df9e..ea0118d13a 100644 --- a/src/core/ActionShortcut.cpp +++ b/src/core/ActionShortcut.cpp @@ -104,6 +104,11 @@ void ActionShortcut::readInputLine( const std::string& input ) { } } } + } else { + ActionWithValue* av = plumed.getActionSet()[plumed.getActionSet().size()-1]->castToActionWithValue(); + if( !av ) error("shortcut is using suffix but action created is not ActionWithValue"); + Keywords thiskeys; actionRegister().getKeywords( av->getName(), thiskeys ); + if( thiskeys.getDisplayName()!=getName() ) error("mismatch between display name of hidden action " + thiskeys.getDisplayName() + " and shortcut that creates it " + getName() ); } } else error("requirement for action " + words[0] + " should be registered in registerKeywords function for shortcut action using keys.useAction"); } diff --git a/src/crystdistrib/Quaternion.cpp b/src/crystdistrib/Quaternion.cpp index f6cbc4d46b..700b04d016 100644 --- a/src/crystdistrib/Quaternion.cpp +++ b/src/crystdistrib/Quaternion.cpp @@ -119,7 +119,7 @@ typedef colvar::MultiColvarTemplate QuaternionMulti; PLUMED_REGISTER_ACTION(QuaternionMulti,"QUATERNION_VECTOR") void Quaternion::registerKeywords( Keywords& keys ) { - Colvar::registerKeywords( keys ); + Colvar::registerKeywords( keys ); keys.setDisplayName("QUATERNION"); keys.add("atoms","ATOMS","the three atom that we are using to calculate the quaternion"); keys.addOutputComponent("w","default","the real component of quaternion"); keys.addOutputComponent("i","default","the i component of the quaternion"); diff --git a/src/function/FunctionOfMatrix.h b/src/function/FunctionOfMatrix.h index 5e45eff195..067e83c4b8 100644 --- a/src/function/FunctionOfMatrix.h +++ b/src/function/FunctionOfMatrix.h @@ -75,15 +75,16 @@ class FunctionOfMatrix : public ActionWithMatrix { template void FunctionOfMatrix::registerKeywords(Keywords& keys ) { - ActionWithMatrix::registerKeywords(keys); keys.use("ARG"); + ActionWithMatrix::registerKeywords(keys); keys.use("ARG"); std::string name = keys.getDisplayName(); + std::size_t und=name.find("_MATRIX"); keys.setDisplayName( name.substr(0,und) ); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); keys.reserve("compulsory","PERIODIC","if the output of your function is periodic then you should specify the periodicity of the function. If the output is not periodic you must state this using PERIODIC=NO"); T tfunc; tfunc.registerKeywords( keys ); - if( keys.getActionName()=="SUM_MATRIX" ) { + if( keys.getDisplayName()=="SUM" ) { keys.setValueDescription("the sum of all the elements in the input matrix"); - } else if( keys.getActionName()=="HIGHEST_MATRIX" ) { + } else if( keys.getDisplayName()=="HIGHEST" ) { keys.setValueDescription("the largest element of the input matrix"); - } else if( keys.getActionName()=="LOWEST_MATRIX" ) { + } else if( keys.getDisplayName()=="LOWEST" ) { keys.setValueDescription("the smallest element in the input matrix"); } else if( keys.outputComponentExists(".#!value") ) { keys.setValueDescription("the matrix obtained by doing an element-wise application of " + keys.getOutputComponentDescription(".#!value") + " to the input matrix"); diff --git a/src/function/FunctionOfScalar.h b/src/function/FunctionOfScalar.h index 5694093e62..00ab91197e 100644 --- a/src/function/FunctionOfScalar.h +++ b/src/function/FunctionOfScalar.h @@ -54,11 +54,12 @@ class FunctionOfScalar : public Function { template void FunctionOfScalar::registerKeywords(Keywords& keys) { - Function::registerKeywords(keys); keys.use("ARG"); + Function::registerKeywords(keys); keys.use("ARG"); std::string name = keys.getDisplayName(); + std::size_t und=name.find("_SCALAR"); keys.setDisplayName( name.substr(0,und) ); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); T tfunc; tfunc.registerKeywords( keys ); - if( keys.getActionName()=="SUM_SCALAR" ) keys.setValueDescription("the sum of all the input arguments"); - else if( keys.getActionName()=="MEAN_SCALAR" ) keys.setValueDescription("the mean of all the input arguments"); + if( keys.getDisplayName()=="SUM" ) keys.setValueDescription("the sum of all the input arguments"); + else if( keys.getDisplayName()=="MEAN" ) keys.setValueDescription("the mean of all the input arguments"); } template diff --git a/src/function/FunctionOfVector.h b/src/function/FunctionOfVector.h index 69412ed2a5..bb962cf924 100644 --- a/src/function/FunctionOfVector.h +++ b/src/function/FunctionOfVector.h @@ -75,18 +75,19 @@ class FunctionOfVector : public ActionWithVector { template void FunctionOfVector::registerKeywords(Keywords& keys ) { Action::registerKeywords(keys); ActionWithValue::registerKeywords(keys); ActionWithArguments::registerKeywords(keys); keys.use("ARG"); + std::string name = keys.getDisplayName(); std::size_t und=name.find("_VECTOR"); keys.setDisplayName( name.substr(0,und) ); keys.reserve("compulsory","PERIODIC","if the output of your function is periodic then you should specify the periodicity of the function. If the output is not periodic you must state this using PERIODIC=NO"); keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); T tfunc; tfunc.registerKeywords( keys ); - if( keys.getActionName()=="SUM_VECTOR" ) { + if( keys.getDisplayName()=="SUM" ) { keys.setValueDescription("the sum of all the elements in the input vector"); - } else if( keys.getActionName()=="MEAN_VECTOR" ) { + } else if( keys.getDisplayName()=="MEAN" ) { keys.setValueDescription("the mean of all the elements in the input vector"); - } else if( keys.getActionName()=="HIGHEST_VECTOR" ) { + } else if( keys.getDisplayName()=="HIGHEST" ) { keys.setValueDescription("the largest element of the input vector"); - } else if( keys.getActionName()=="LOWEST_VECTOR" ) { + } else if( keys.getDisplayName()=="LOWEST" ) { keys.setValueDescription("the smallest element in the input vector"); - } else if( keys.getActionName()=="SORT_VECTOR" ) { + } else if( keys.getDisplayName()=="SORT" ) { keys.setValueDescription("a vector that has been sorted into ascending order"); } else if( keys.outputComponentExists(".#!value") ) { keys.setValueDescription("the vector obtained by doing an element-wise application of " + keys.getOutputComponentDescription(".#!value") + " to the input vectors"); diff --git a/src/function/Highest.cpp b/src/function/Highest.cpp index ab7a68f538..c66ddfa6b7 100644 --- a/src/function/Highest.cpp +++ b/src/function/Highest.cpp @@ -104,7 +104,7 @@ PLUMED_REGISTER_ACTION(VectorHighest,"HIGHEST_VECTOR") PLUMED_REGISTER_ACTION(VectorHighest,"LOWEST_VECTOR") void Highest::registerKeywords( Keywords& keys ) { - if( keys.getActionName().find("LOWEST") ) keys.setValueDescription("the lowest of the input values"); + if( keys.getDisplayName().find("LOWEST") ) keys.setValueDescription("the lowest of the input values"); else keys.setValueDescription("the highest of the input values"); } diff --git a/src/gridtools/FunctionOfGrid.h b/src/gridtools/FunctionOfGrid.h index 164c119b03..aec8cae75d 100644 --- a/src/gridtools/FunctionOfGrid.h +++ b/src/gridtools/FunctionOfGrid.h @@ -58,10 +58,11 @@ class FunctionOfGrid : public ActionWithGrid { template void FunctionOfGrid::registerKeywords(Keywords& keys ) { - ActionWithGrid::registerKeywords(keys); keys.use("ARG"); + ActionWithGrid::registerKeywords(keys); keys.use("ARG"); std::string name = keys.getDisplayName(); + std::size_t und=name.find("_GRID"); keys.setDisplayName( name.substr(0,und) ); keys.reserve("compulsory","PERIODIC","if the output of your function is periodic then you should specify the periodicity of the function. If the output is not periodic you must state this using PERIODIC=NO"); T tfunc; tfunc.registerKeywords( keys ); if( typeid(tfunc)==typeid(function::Custom()) ) keys.add("hidden","NO_ACTION_LOG","suppresses printing from action on the log"); - if( keys.getActionName()=="INTEGRATE_GRID") { + if( keys.getDisplayName()=="INTEGRATE") { keys.setValueDescription("the numerical integral of the input function over its whole domain"); } else if( keys.outputComponentExists(".#!value") ) { keys.setValueDescription("the grid obtained by doing an element-wise application of " + keys.getOutputComponentDescription(".#!value") + " to the input grid"); diff --git a/src/tools/Keywords.cpp b/src/tools/Keywords.cpp index 5f696df2be..1b68bf4cb4 100644 --- a/src/tools/Keywords.cpp +++ b/src/tools/Keywords.cpp @@ -708,7 +708,11 @@ void Keywords::addActionNameSuffix( const std::string& suffix ) { actionNameSuffixes.push_back( suffix ); } -std::string Keywords::getActionName() const { +void Keywords::setDisplayName( const std::string& name ) { + thisactname = name; +} + +std::string Keywords::getDisplayName() const { return thisactname; } diff --git a/src/tools/Keywords.h b/src/tools/Keywords.h index 49078bbb5a..16c0cc60fd 100644 --- a/src/tools/Keywords.h +++ b/src/tools/Keywords.h @@ -196,7 +196,9 @@ class Keywords { /// Get the list of keywords that are needed by this action const std::vector& getNeededKeywords() const ; /// Return the name of the action that has this set of keywords - std::string getActionName() const ; + std::string getDisplayName() const ; +/// Set the display name + void setDisplayName( const std::string& name ); }; } diff --git a/src/vatom/Center.cpp b/src/vatom/Center.cpp index 07418d41c8..10ce5169f8 100644 --- a/src/vatom/Center.cpp +++ b/src/vatom/Center.cpp @@ -149,6 +149,7 @@ PLUMED_REGISTER_ACTION(Center,"COM") void Center::registerKeywords(Keywords& keys) { ActionWithVirtualAtom::registerKeywords(keys); + if( keys.getDisplayName()!="COM" ) keys.setDisplayName("CENTER"); keys.add("optional","WEIGHTS","Center is computed as a weighted average."); keys.add("optional","SET_CHARGE","Set the charge of the virtual atom to a given value."); keys.add("optional","SET_MASS","Set the mass of the virtual atom to a given value."); diff --git a/src/volumes/VolumeAround.cpp b/src/volumes/VolumeAround.cpp index 3123433cce..84758adadc 100644 --- a/src/volumes/VolumeAround.cpp +++ b/src/volumes/VolumeAround.cpp @@ -96,7 +96,7 @@ typedef VolumeShortcut VolumeAroundShortcut; PLUMED_REGISTER_ACTION(VolumeAroundShortcut,"AROUND") void VolumeAround::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.setDisplayName("AROUND"); keys.add("atoms","ORIGIN","the atom whose vicinity we are interested in examining"); keys.add("atoms-2","ATOM","an alternative to ORIGIN"); keys.add("compulsory","XLOWER","0.0","the lower boundary in x relative to the x coordinate of the atom (0 indicates use full extent of box)."); diff --git a/src/volumes/VolumeBetweenContours.cpp b/src/volumes/VolumeBetweenContours.cpp index 73ab5c3c4b..ac3f249a78 100644 --- a/src/volumes/VolumeBetweenContours.cpp +++ b/src/volumes/VolumeBetweenContours.cpp @@ -92,7 +92,7 @@ typedef VolumeShortcut VolumeInEnvelopeShortcut; PLUMED_REGISTER_ACTION(VolumeInEnvelopeShortcut,"INENVELOPE") void VolumeInEnvelope::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); keys.remove("SIGMA"); + ActionVolume::registerKeywords( keys ); keys.remove("SIGMA"); keys.setDisplayName("INENVELOPE"); keys.add("atoms","FIELD_ATOMS","the atom whose positions we are constructing a field from"); keys.add("compulsory","BANDWIDTH","the bandwidths for kernel density esimtation"); keys.add("compulsory","CONTOUR","a switching funciton that tells PLUMED how large the density should be"); diff --git a/src/volumes/VolumeCavity.cpp b/src/volumes/VolumeCavity.cpp index e481f7b5c2..fb53c8775a 100644 --- a/src/volumes/VolumeCavity.cpp +++ b/src/volumes/VolumeCavity.cpp @@ -139,7 +139,7 @@ typedef VolumeShortcut VolumeCavityShortcut; PLUMED_REGISTER_ACTION(VolumeCavityShortcut,"CAVITY") void VolumeCavity::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.setDisplayName("CAVITY"); keys.add("atoms","BOX","the positions of four atoms that define spatial extent of the cavity"); keys.addFlag("PRINT_BOX",false,"write out the positions of the corners of the box to an xyz file"); keys.add("optional","FILE","the file on which to write out the box coordinates"); diff --git a/src/volumes/VolumeInCylinder.cpp b/src/volumes/VolumeInCylinder.cpp index 4860c8fdcb..1253007546 100644 --- a/src/volumes/VolumeInCylinder.cpp +++ b/src/volumes/VolumeInCylinder.cpp @@ -100,7 +100,7 @@ typedef VolumeShortcut VolumeInCylinderShortcut; PLUMED_REGISTER_ACTION(VolumeInCylinderShortcut,"INCYLINDER") void VolumeInCylinder::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.setDisplayName("INCYLINDER"); keys.add("atoms","CENTER","the atom whose vicinity we are interested in examining"); keys.add("compulsory","DIRECTION","the direction of the long axis of the cylinder. Must be x, y or z"); keys.add("compulsory","RADIUS","a switching function that gives the extent of the cylinder in the plane perpendicular to the direction"); diff --git a/src/volumes/VolumeInSphere.cpp b/src/volumes/VolumeInSphere.cpp index eac05f681b..141ad4fbe7 100644 --- a/src/volumes/VolumeInSphere.cpp +++ b/src/volumes/VolumeInSphere.cpp @@ -96,7 +96,7 @@ typedef VolumeShortcut VolumeInSphereShortcut; PLUMED_REGISTER_ACTION(VolumeInSphereShortcut,"INSPHERE") void VolumeInSphere::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.setDisplayName("INSPHERE"); keys.add("atoms","CENTER","the atom whose vicinity we are interested in examining"); keys.add("atoms-2","ATOM","the atom whose vicinity we are interested in examining"); keys.add("compulsory","RADIUS","the switching function that tells us the extent of the sphereical region of interest"); diff --git a/src/volumes/VolumeTetrapore.cpp b/src/volumes/VolumeTetrapore.cpp index e7adc98353..9037331722 100644 --- a/src/volumes/VolumeTetrapore.cpp +++ b/src/volumes/VolumeTetrapore.cpp @@ -147,7 +147,7 @@ typedef VolumeShortcut VolumeTetraporeShortcut; PLUMED_REGISTER_ACTION(VolumeTetraporeShortcut,"TETRAHEDRALPORE") void VolumeTetrapore::registerKeywords( Keywords& keys ) { - ActionVolume::registerKeywords( keys ); + ActionVolume::registerKeywords( keys ); keys.setDisplayName("TETRAHEDRALPORE"); keys.add("atoms","BOX","the positions of four atoms that define spatial extent of the cavity"); keys.addFlag("PRINT_BOX",false,"write out the positions of the corners of the box to an xyz file"); keys.add("optional","FILE","the file on which to write out the box coordinates");