22 #include "core/ActionPilot.h"
23 #include "core/ActionWithArguments.h"
24 #include "core/ActionRegister.h"
25 #include "tools/File.h"
65 static void registerKeywords(
Keywords& keys);
71 PLUMED_REGISTER_ACTION(DumpDerivatives,
"DUMPDERIVATIVES")
74 Action::registerKeywords(keys);
75 ActionPilot::registerKeywords(keys);
76 ActionWithArguments::registerKeywords(keys);
78 keys.add(
"compulsory",
"STRIDE",
"1",
"the frequency with which the derivatives should be output");
79 keys.add(
"compulsory",
"FILE",
"the name of the file on which to output the derivatives");
80 keys.add(
"compulsory",
"FMT",
"%15.10f",
"the format with which the derivatives should be output");
90 if(
file.length()==0 )
error(
"name of output file was not specified");
98 if( nargs==0 )
error(
"no arguments specified");
100 if( npar==0 )
error(
"one or more arguments has no derivatives");
101 for(
unsigned i=1;i<nargs;i++){
102 if( npar!=
getPntrToArgument(i)->getNumberOfDerivatives() )
error(
"the number of derivatives must be the same in all values being dumped");
110 for(
unsigned ipar=0;ipar<npar;ipar++){
Log & log
Reference to the log stream.
This is used to create PLMD::Action objects that are run with some set frequency. ...
void apply()
Apply an Action.
void error(const std::string &msg) const
Crash calculation and print documentation.
unsigned getNumberOfDerivatives() const
Get the number of derivatives that this particular value has.
OFile & fmtField(const std::string &)
Set the format for writing double precision fields.
void checkRead()
Check if Action was properly read.
Value * getPntrToArgument(const unsigned n)
Return a pointer to specific argument.
This is used to create PLMD::Action objects that take the output from some other Action as input...
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
Provides the keyword DUMPDERIVATIVES
This class holds the keywords and their documentation.
This class is used to bring the relevant information to the Action constructor.
OFile & link(OFile &)
Allows linking this OFile to another one.
double getTime() const
Return the present time.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
void calculate()
Calculate an Action.
const std::string & getName() const
Returns the name.
Base class for all the input Actions.
OFile & printField(const std::string &, double)
Set the value of a double precision field.
unsigned getNumberOfArguments() const
Returns the number of arguments.
OFile & open(const std::string &name)
Opens the file using automatic append/backup.