Search Results
Documentation
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:
Public Member Functions | |
UnitFactory (std::string system) | |
~UnitFactory () | |
const std::string & system () const | |
std::shared_ptr< const detail::FundamentalConstants< double > > constants () const | |
const char * description () const | |
Unit make_unit (const std::string &unit_str) const | |
Static Public Member Functions | |
static std::shared_ptr< const UnitFactory > get_default () | |
static void set_default (const std::string &system) | |
Constructor & Destructor Documentation
◆ 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()
|
inline |
Member Function Documentation
◆ constants()
|
inline |
- Returns
- a shared_ptr to the fundamental constants system object
◆ description()
|
inline |
- Returns
- the description of the fundamental constants system
◆ 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
-
unit_str the string specification of the desired Unit. See The Units Library section.
- Returns
- the Unit object
◆ set_default()
|
static |
sets the singleton UnitFactory object
- Parameters
-
system specifies the fundamental constants system, must be acceptable as the input to UnitFactory::UnitFactory() ctor
◆ system()
|
inline |
- Returns
- the name of the fundamental constants system
The documentation for this class was generated from the following files: