UnitFactory produces Unit objects that refer to a particular system of fundamental constants. UnitFactory is a helper class to ensure that all unit conversions are consistent, i.e. refer to the same system of fundamental constants. Since fundamental constants are updated every few years, it is mandatory to use UnitFactory to produce Unit objects, rather than create them directly. Since typically only 1 UnitFactory needs to be used in the entire program, the UnitFactory should be used as a singleton:
◆ UnitFactory()
mpqc::UnitFactory::UnitFactory |
( |
std::string |
system | ) |
|
Creates a UnitFactory object corresponding to the given fundamental constants system.
- Parameters
-
system | specifies the fundamental constants system, the allowed values are:
- "2018CODATA" : the 2018 revision of the fundamental constants
- "2014CODATA" : the 2014 revision of the fundamental constants (see DOI 10.1103/RevModPhys.88.035009 )
- "2010CODATA" : the 2010 revision of the fundamental constants (see DOI 10.1103/RevModPhys.84.1527 )
- "2006CODATA" : the 2006 revision of the fundamental constants (see DOI 10.1103/RevModPhys.80.633 ) (the default of Gaussian09)
- "MPQC2" : the values of constants used by MPQC version 2.3
|
The default is currently "2018CODATA", and may be revised in the future.
◆ ~UnitFactory()
mpqc::UnitFactory::~UnitFactory |
( |
| ) |
|
|
inline |
◆ constants()
- Returns
- a shared_ptr to the fundamental constants system object
◆ description()
const char* mpqc::UnitFactory::description |
( |
| ) |
const |
|
inline |
- Returns
- the description of the fundamental constants system
◆ get_default()
std::shared_ptr< const UnitFactory > mpqc::UnitFactory::get_default |
( |
| ) |
|
|
static |
- Returns
- the singleton UnitFactory object (default initialized with 2018CODATA fundamental constants)
◆ make_unit()
Unit mpqc::UnitFactory::make_unit |
( |
const std::string & |
unit_str | ) |
const |
makes a Unit object from a given string specification, using the system of fundamental constants specified by this factory.
- Parameters
-
- Returns
- the Unit object
◆ set_default()
void mpqc::UnitFactory::set_default |
( |
const std::string & |
system | ) |
|
|
static |
◆ system()
const std::string& mpqc::UnitFactory::system |
( |
| ) |
const |
|
inline |
- Returns
- the name of the fundamental constants system
The documentation for this class was generated from the following files: