diff --git a/src/colvar/GyrationShortcut.cpp b/src/colvar/GyrationShortcut.cpp index ddc558b1b8..3eafd619f3 100644 --- a/src/colvar/GyrationShortcut.cpp +++ b/src/colvar/GyrationShortcut.cpp @@ -67,7 +67,7 @@ void GyrationShortcut::registerKeywords( Keywords& keys ) { keys.addFlag("MASS_WEIGHTED",false,"set the masses of all the atoms equal to one"); keys.addFlag("UNORMALIZED",false,"do not divide by the sum of the weights"); keys.addActionNameSuffix("_FAST"); keys.needsAction("CENTER"); keys.needsAction("CONSTANT"); - keys.needsAction("ONES"); keys.needsAction("MASSES"); keys.needsAction("DISTANCE"); + keys.needsAction("ONES"); keys.needsAction("MASS"); keys.needsAction("DISTANCE"); keys.needsAction("COVARIANCE_MATRIX"); keys.needsAction("SELECT_COMPONENTS"); keys.needsAction("SUM"); keys.needsAction("CUSTOM"); keys.needsAction("DIAGONALIZE"); } @@ -105,7 +105,7 @@ GyrationShortcut::GyrationShortcut(const ActionOptions& ao): readInputLine( getShortcutLabel() + "_w: ONES SIZE=" + str_natoms ); } else if( str_weights.size()==1 && str_weights[0]=="@Masses" ) { wflab = getShortcutLabel() + "_m"; - readInputLine( getShortcutLabel() + "_m: MASSES ATOMS=" + atlist ); + readInputLine( getShortcutLabel() + "_m: MASS ATOMS=" + atlist ); } else if( str_weights.size()>1 ) { std::string vals=str_weights[0]; for(unsigned i=1; i( av ); plumed_assert( aa ); for(unsigned i=0; igetNumberOfAtoms(); ++i) { std::pair p = aa->getValueIndices( aa->getAbsoluteIndex(i) ); - if( av->getName()=="MASSES" && !aa->masv[p.first]->isConstant() ) constant=false; - if( av->getName()=="CHARGES" && !aa->chargev[p.first]->isConstant() ) constant=false; + if( av->getName().find("MASS")!=std::string::npos && !aa->masv[p.first]->isConstant() ) constant=false; + if( av->getName().find("CHARGE")!=std::string::npos && !aa->chargev[p.first]->isConstant() ) constant=false; } if( !constant ) av->error("cannot deal with non-constant " + av->getName() + " values"); (av->copyOutput(0))->setConstant();