22 #include "core/ActionSetup.h"
23 #include "core/ActionRegister.h"
24 #include "core/PlumedMain.h"
25 #include "core/Atoms.h"
26 #include "tools/Exception.h"
65 static void registerKeywords(
Keywords& keys );
69 PLUMED_REGISTER_ACTION(
Units,
"UNITS")
72 ActionSetup::registerKeywords(keys);
73 keys.add(
"optional",
"LENGTH",
"the units of lengths. Either specify a conversion factor from the default, nm, or A (for angstroms) or um");
74 keys.add(
"optional",
"ENERGY",
"the units of energy. Either specify a conversion factor from the default, kj/mol, or use j/mol or kcal/mol");
75 keys.add(
"optional",
"TIME",
"the units of time. Either specify a conversion factor from the default, ps, or use ns or fs");
76 keys.addFlag(
"NATURAL",
false,
"use natural units");
107 plumed.getAtoms().setNaturalUnits(natural);
111 plumed.getAtoms().setUnits(u);
117 log.
printf(
" inside PLUMED, Boltzmann constant is %f\n",
plumed.getAtoms().getKBoltzmann());
void setTime(const std::string &)
Set time units from string.
void parseFlag(const std::string &key, bool &t)
Parse one keyword as boolean flag.
const std::string & getTimeString() const
Get time units as string.
Log & log
Reference to the log stream.
const std::string & getLengthString() const
Get length units as string.
void setLength(const std::string &)
Set lengh units from string.
void checkRead()
Check if Action was properly read.
Provides the keyword UNITS
Action used to create a PLMD::Action that do something during setup only e.g.
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
Small utility class that contains information about units.
const std::string & getEnergyString() const
Get energy units as string.
This class is used to bring the relevant information to the Action constructor.
void setEnergy(const std::string &)
Set energy units from string.
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
const double & getEnergy() const
Get energy units as double.
const double & getTime() const
Get time units as double.
Base class for all the input Actions.
const double & getLength() const
Get length units as double.