Skip to content

Commit

Permalink
Fix for cases where folks are using custom components but they have n…
Browse files Browse the repository at this point in the history
…ot overridden the function to get the component names
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed May 22, 2024
1 parent f9b0bd9 commit 29babd0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/ActionWithValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ void ActionWithValue::addComponentWithDerivatives( const std::string& name, cons
}

std::string ActionWithValue::getOutputComponentDescription( const std::string& cname, const Keywords& keys ) const {
if( keys.outputComponentExists(".#!custom") ) return "a quantity calculated by the action " + getName() + " with label " + getLabel();
std::size_t und=cname.find_last_of("_"); std::size_t hyph=cname.find_first_of("-");
if( und!=std::string::npos ) return keys.getOutputComponentDescription(cname.substr(und)) + " This particular component measures this quantity for the input CV named " + cname.substr(0,und);
if( hyph!=std::string::npos ) return keys.getOutputComponentDescription(cname.substr(0,hyph)) + " This is the " + cname.substr(hyph+1) + "th of these quantities";
Expand Down

0 comments on commit 29babd0

Please sign in to comment.