24 #include "tools/PDB.h"
25 #include "core/TargetDist.h"
26 #include "core/Atoms.h"
27 #include "core/PlumedMain.h"
51 virtual void calculate();
52 static void registerKeywords(
Keywords& keys );
55 PLUMED_REGISTER_ACTION(
Target,
"TARGET")
58 Function::registerKeywords(keys);
60 keys.add(
"compulsory",
"REFERENCE",
"a file in pdb format containing the reference structure. In the PDB file the atomic "
61 "coordinates and box lengths should be in Angstroms unless you are working with natural units. "
62 "If you are working with natural units then the coordinates should be in your natural length unit. "
63 "The charges and masses of the atoms (if required) should be inserted in the beta and occupancy "
64 "columns respectively. For more details on the PDB file format visit http://www.wwpdb.org/docs.html");
65 keys.add(
"optional",
"REFERENCE_VEC",
"the vector of values for the CVs at the reference point (if you use this you don't need REFERENCE)");
73 std::vector<double> targ;
79 parse(
"REFERENCE",reference);
81 if( !pdb.
read(reference,
plumed.getAtoms().usingNaturalUnits(),0.1/
plumed.getAtoms().getUnits().getLength()) )
82 error(
"missing input file " + reference);
83 printf(
"Read pdb file with %d atoms inside\n",pdb.
size());
bool read(const std::string &file, bool naturalUnits, double scale)
Read the pdb from a file, scaling positions by a factor scale.
void read(const PDB &pdb, std::vector< Value * > args)
void setNotPeriodic()
Set your default value to have no periodicity.
void error(const std::string &msg) const
Crash calculation and print documentation.
void checkRead()
Check if Action was properly read.
double calculate(std::vector< double > &derivs)
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
Provides the keyword TARGET
This class is used to bring the relevant information to the Action constructor.
std::vector< Value * > & getArguments()
Returns an array of pointers to the arguments.
Base class for all the input Actions.
void parseVector(const std::string &key, std::vector< T > &t)
Parse one keyword as std::vector.
void setValue(const double &d)
Set the default value (the one without name)
void addValueWithDerivatives()
std::vector< double > derivs
This is the abstract base class to use for implementing new CV function, within it there is informati...
unsigned size() const
Returns the number of atoms.
unsigned getNumberOfArguments() const
Returns the number of arguments.
void setDerivative(int, double)
virtual void calculate()
Calculate an Action.