Small utility class that contains information about units. More...
#include <Units.h>
Public Member Functions | |
Units () | |
Constructor, setting default values (1.0) More... | |
void | setEnergy (const std::string &) |
Set energy units from string. More... | |
void | setTime (const std::string &) |
Set time units from string. More... | |
void | setLength (const std::string &) |
Set lengh units from string. More... | |
void | setEnergy (double) |
Set energy units from double. More... | |
void | setTime (double) |
Set time units from double. More... | |
void | setLength (double) |
Set lenght units from double. More... | |
const double & | getEnergy () const |
Get energy units as double. More... | |
const double & | getLength () const |
Get length units as double. More... | |
const double & | getTime () const |
Get time units as double. More... | |
const std::string & | getEnergyString () const |
Get energy units as string. More... | |
const std::string & | getLengthString () const |
Get length units as string. More... | |
const std::string & | getTimeString () const |
Get time units as string. More... | |
Private Attributes | |
double | energy |
Units for energy, expressed in kj/mol (e.g. 4.184 means kcal/mol) More... | |
std::string | energyString |
double | length |
Units for length, expressed in nm (e.g. 0.1 means A) More... | |
std::string | lengthString |
double | time |
Units for time, expressed in ps (e.g. 0.001 means fs) More... | |
std::string | timeString |
Small utility class that contains information about units.
This class can be used to contain in a single place all the information about units. Units are expressed in terms of standard PLUMED units, i.e. kj/mol, nm, and ps. Units can be set as double or as string. In the latter case, one can also use strings such as kcal/mol.
PLMD::Units::Units | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void PLMD::Units::setEnergy | ( | const std::string & | s | ) |
void PLMD::Units::setEnergy | ( | double | s | ) |
void PLMD::Units::setLength | ( | const std::string & | s | ) |
void PLMD::Units::setLength | ( | double | s | ) |
void PLMD::Units::setTime | ( | const std::string & | s | ) |
void PLMD::Units::setTime | ( | double | s | ) |
|
private |
|
private |
|
private |
Hosted by GitHub
![]() |
![]() |