Skip to content

Commit

Permalink
Changed name of READ_MASS_CHARGE to READMASSCHARGE to be consistent w…
Browse files Browse the repository at this point in the history
…ith DUMPMASSCHARGE
  • Loading branch information
Gareth Aneurin Tribello authored and Gareth Aneurin Tribello committed Jun 14, 2024
1 parent 24fe95a commit 765d075
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion regtest/basic/rt-readmasscharge/plumed.dat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
mq: READ_MASS_CHARGE FILE=test.pdb
mq: READMASSCHARGE FILE=test.pdb
DUMPMASSCHARGE FILE=mc

2 changes: 1 addition & 1 deletion src/core/ActionAtomistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ActionAtomistic::ActionAtomistic(const ActionOptions&ao):
void ActionAtomistic::getAtomValuesFromPlumedObject( const PlumedMain& plumed, std::vector<Value*>& xpos, std::vector<Value*>& ypos, std::vector<Value*>& zpos, std::vector<Value*>& masv, std::vector<Value*>& chargev ) {
std::vector<ActionShortcut*> shortcuts = plumed.getActionSet().select<ActionShortcut*>(); bool foundpdb=false;
for(const auto & ss : shortcuts ) {
if( ss->getName()=="READ_MASS_CHARGE" ) {
if( ss->getName()=="READMASSCHARGE" ) {
foundpdb=true;
ActionWithValue* mv = plumed.getActionSet().selectWithLabel<ActionWithValue*>( ss->getShortcutLabel() + "_mass");
plumed_assert( mv ); masv.push_back( mv->copyOutput(0) );
Expand Down
9 changes: 5 additions & 4 deletions src/generic/MassChargeInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace PLMD {
namespace generic {

//+PLUMEDOC COLVAR READ_MASS_CHARGE
//+PLUMEDOC COLVAR READMASSCHARGE
/*
Set the masses and charges from an input PDB file.
Expand All @@ -46,11 +46,12 @@ class MassChargeInput : public ActionShortcut {
explicit MassChargeInput(const ActionOptions&);
};

PLUMED_REGISTER_ACTION(MassChargeInput,"READ_MASS_CHARGE")
PLUMED_REGISTER_ACTION(MassChargeInput,"READMASSCHARGE")

void MassChargeInput::registerKeywords(Keywords& keys) {
ActionShortcut::registerKeywords( keys );
keys.add("compulsory","FILE","a pdb file that contains the masses and charges of the atoms in the beta and occupancy columns");
keys.add("optional","FILE","input file that contains the masses and charges that should be used");
keys.add("compulsory","PDBFILE","a pdb file that contains the masses and charges of the atoms in the beta and occupancy columns");
keys.addOutputComponent("mass","default","the masses of the atoms in the system");
keys.addOutputComponent("charges","default","the masses of the atoms in the system");
keys.needsAction("CONSTANT");
Expand All @@ -65,7 +66,7 @@ MassChargeInput::MassChargeInput(const ActionOptions& ao):
// check that all the preceding actions are ActionSetup
if( !dynamic_cast<ActionSetup*>(p.get()) && !dynamic_cast<ActionForInterface*>(p.get()) && !dynamic_cast<ActionAnyorder*>(p.get()) ) {
error("Action " + getLabel() + " is a setup action, and should be only preceded by other setup actions or by actions that can be used in any order.");
} else if( (p.get())->getName()=="READ_MASS_CHARGE" ) error("should only be one READ_MASS_CHARGE action in the input file");
} else if( (p.get())->getName()=="READMASSCHARGE" ) error("should only be one READMASSCHARGE action in the input file");
}
std::string input; parse("FILE",input); PDB pdb;
if( !pdb.read(input, false, 1.0 ) ) error("error reading pdb file containing masses and charges");
Expand Down

0 comments on commit 765d075

Please sign in to comment.