Skip to content

Commit

Permalink
updating the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Iximiel committed Jan 23, 2025
1 parent 257cdc1 commit 33101da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/tools/Keywords.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,9 @@ void Keywords::use(std::string_view k ) {

void Keywords::reset_style( const std::string & k, const std::string & style ) {
plumed_massert( exists(k) || reserved(k), "no " + k + " keyword" );
keywords.at(k).atomtag="";
//Adding this feels correct, but breacks some actions where a numbered keyword is changed to compulsory
//Adding this two feels correct, but breaks some actions where a numbered keyword is changed to compulsory
//So also the atomtag is removed
//keywords.at(k).atomtag="";
//keywords.at(k).allowmultiple=false;
if( style=="numbered" ) {
keywords.at(k).allowmultiple=true;
Expand Down
21 changes: 20 additions & 1 deletion src/tools/Keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,26 @@ class Keywords {
void print_vim() const ;
/// Print the template version for the documentation
void print_template( const std::string& actionname, bool include_optional) const ;
/// Change the style of a keyword
/// Change part of the style of a keyword
///
/// The standard usecase for this method is creating a compulsory or an atom(s) numbered keyword.
/// For example:
/// @code{.cpp}
/// 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 "
/// "calculated for each ATOM keyword you specify.");
/// keys.reset_style("ATOMS","atoms");
/// keys.add("numbered","SWITCH","The switching functions to use for each of the contacts in your map. "
/// "You can either specify a global switching function using SWITCH or one "
/// "switching function for each contact. Details of the various switching "
/// "functions you can use are provided on \\ref switchingfunction.");
/// keys.reset_style("SWITCH","compulsory");
/// @endcode
/// @note Note that some option of the selected keyword may not change. In particular:
/// - A numbered keyword will change the style but the keyInfo::allowmultiple
/// will remain set to `true`
/// - An eventual keyInfo::atomtag will not be changed unless the style is set to
/// an atomlist
void reset_style( const std::string & k, const std::string & style );
/// Clear everything from the keywords object.
/// Not actually needed if your Keywords object is going out of scope.
Expand Down

0 comments on commit 33101da

Please sign in to comment.