Public Member Functions | Private Attributes | List of all members
PLMD::Units Class Reference


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 setCharge (const std::string &)
 Set charge units from string. More...
 
void setMass (const std::string &)
 Set mass 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...
 
void setCharge (double)
 Set charge units from double. More...
 
void setMass (double)
 Set mass 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 double & getCharge () const
 Get charge units as double. More...
 
const double & getMass () const
 Get mass 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...
 
const std::string & getChargeString () const
 Get charge units as string. More...
 
const std::string & getMassString () const
 Get mass 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
 
double charge
 Units for charges, expressed in proton charge (e.g. 1./18.2223 are sqrt(kcal/mol*A), as used in Amber) More...
 
std::string chargeString
 
double mass
 Units for masses, expressed in amu. More...
 
std::string massString
 

Detailed Description


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.

Constructor & Destructor Documentation

◆ Units()

PLMD::Units::Units ( )

Constructor, setting default values (1.0)

Member Function Documentation

◆ getCharge()

const double & PLMD::Units::getCharge ( ) const
inline

Get charge units as double.

◆ getChargeString()

const std::string & PLMD::Units::getChargeString ( ) const
inline

Get charge units as string.

◆ getEnergy()

const double & PLMD::Units::getEnergy ( ) const
inline

Get energy units as double.

◆ getEnergyString()

const std::string & PLMD::Units::getEnergyString ( ) const
inline

Get energy units as string.

◆ getLength()

const double & PLMD::Units::getLength ( ) const
inline

Get length units as double.

◆ getLengthString()

const std::string & PLMD::Units::getLengthString ( ) const
inline

Get length units as string.

◆ getMass()

const double & PLMD::Units::getMass ( ) const
inline

Get mass units as double.

◆ getMassString()

const std::string & PLMD::Units::getMassString ( ) const
inline

Get mass units as string.

◆ getTime()

const double & PLMD::Units::getTime ( ) const
inline

Get time units as double.

◆ getTimeString()

const std::string & PLMD::Units::getTimeString ( ) const
inline

Get time units as string.

◆ setCharge() [1/2]

void PLMD::Units::setCharge ( const std::string &  s)

Set charge units from string.

◆ setCharge() [2/2]

void PLMD::Units::setCharge ( double  s)

Set charge units from double.

Should be specified in units of proton charge.

◆ setEnergy() [1/2]

void PLMD::Units::setEnergy ( const std::string &  s)

Set energy units from string.

Also understands the following strings: kj/mol, kcal/mol, j/mol, and eV.

◆ setEnergy() [2/2]

void PLMD::Units::setEnergy ( double  s)

Set energy units from double.

Should be specified in units of kj/mol (e.g. 4.184 means kcal/mol)

◆ setLength() [1/2]

void PLMD::Units::setLength ( const std::string &  s)

Set lengh units from string.

Also understands the following strings: nm, A, um.

◆ setLength() [2/2]

void PLMD::Units::setLength ( double  s)

Set lenght units from double.

Should be specified in units of nm (e.g. 0.1 means A)

◆ setMass() [1/2]

void PLMD::Units::setMass ( const std::string &  s)

Set mass units from string.

◆ setMass() [2/2]

void PLMD::Units::setMass ( double  s)

Set mass units from double.

Should be specified in units of amu.

◆ setTime() [1/2]

void PLMD::Units::setTime ( const std::string &  s)

Set time units from string.

Also understands the following strings: ps, ns, fs.

◆ setTime() [2/2]

void PLMD::Units::setTime ( double  s)

Set time units from double.

Should be specified in units of ps (e.g. 0.001 means fs)

Member Data Documentation

◆ charge

double PLMD::Units::charge
private

Units for charges, expressed in proton charge (e.g. 1./18.2223 are sqrt(kcal/mol*A), as used in Amber)

◆ chargeString

std::string PLMD::Units::chargeString
private

◆ energy

double PLMD::Units::energy
private

Units for energy, expressed in kj/mol (e.g. 4.184 means kcal/mol)

◆ energyString

std::string PLMD::Units::energyString
private

◆ length

double PLMD::Units::length
private

Units for length, expressed in nm (e.g. 0.1 means A)

◆ lengthString

std::string PLMD::Units::lengthString
private

◆ mass

double PLMD::Units::mass
private

Units for masses, expressed in amu.

◆ massString

std::string PLMD::Units::massString
private

◆ time

double PLMD::Units::time
private

Units for time, expressed in ps (e.g. 0.001 means fs)

◆ timeString

std::string PLMD::Units::timeString
private

The documentation for this class was generated from the following files: