diff --git a/src/mapping/Mapping.cpp b/src/mapping/Mapping.cpp index df771be102e33d691bfc9fec8bd486af5650a135..0e83e34072ab483af12b07fae6176b655089b76e 100644 --- a/src/mapping/Mapping.cpp +++ b/src/mapping/Mapping.cpp @@ -103,8 +103,10 @@ Mapping::Mapping(const ActionOptions&ao): // Get the arguments and atoms that are required std::vector<AtomNumber> atoms; std::vector<std::string> args; mymap->getAtomAndArgumentRequirements( atoms, args ); - requestAtoms( atoms ); std::vector<Value*> req_args; - interpretArgumentList( args, req_args ); requestArguments( req_args ); + std::vector<Value*> req_args; interpretArgumentList( args, req_args ); + if( req_args.size()>0 && atoms.size()>0 ) error("cannot mix atoms and arguments"); + if( req_args.size()>0 ) requestArguments( req_args ); + if( atoms.size()>0 ) requestAtoms( atoms ); // Duplicate all frames (duplicates are used by sketch-map) mymap->duplicateFrameList(); // fframes.resize( 2*nfram, 0.0 ); dfframes.resize( 2*nfram, 0.0 ); @@ -128,26 +130,6 @@ Mapping::~Mapping() { delete mymap; } -void Mapping::prepare() { - if( mymap->mappingNeedsSetup() ) { - // Get the arguments and atoms that are required - std::vector<AtomNumber> atoms; std::vector<std::string> args; - mymap->getAtomAndArgumentRequirements( atoms, args ); - requestAtoms( atoms ); std::vector<Value*> req_args; - interpretArgumentList( args, req_args ); requestArguments( req_args ); - // Duplicate all frames (duplicates are used by sketch-map) - mymap->duplicateFrameList(); - // Get the number of frames in the path - // unsigned nfram=getNumberOfReferencePoints(); - // fframes.resize( 2*nfram, 0.0 ); dfframes.resize( 2*nfram, 0.0 ); - plumed_assert( !mymap->mappingNeedsSetup() ); - // Resize all derivative arrays - // mymap->setNumberOfAtomsAndArguments( atoms.size(), args.size() ); - // Resize forces array - forcesToApply.resize( 3*getNumberOfAtoms() + 9 + getNumberOfArguments() ); - } -} - unsigned Mapping::getPropertyIndex( const std::string& name ) const { return mymap->getPropertyIndex( name ); } diff --git a/src/mapping/Mapping.h b/src/mapping/Mapping.h index 83b7eec991dc9ef753c99ceb741cc4a2e9ec2df2..02670d7a5ee4dd73431f209215949897420f24c4 100644 --- a/src/mapping/Mapping.h +++ b/src/mapping/Mapping.h @@ -90,8 +90,6 @@ public: std::string getArgumentName( unsigned& iarg ); /// Get the value of the ith property for the current frame double getPropertyValue( const unsigned& current, const unsigned& iprop ) const ; -/// Stuff to do before we do the calculation - void prepare(); /// Apply the forces void apply(); };