1 /*-------------------------------------------------------------------
2 Copyright 2011 Ravishankar Sundararaman
3 
4 This file is part of JDFTx.
5 
6 JDFTx is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 JDFTx is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with JDFTx.  If not, see <http://www.gnu.org/licenses/>.
18 -------------------------------------------------------------------*/
19 
20 #ifndef JDFTX_CORE_UNITS_H
21 #define JDFTX_CORE_UNITS_H
22 
23 //! @addtogroup Utilities
24 //! @{
25 
26 //! @file Units.h Commonly used measurement units in terms of atomic units
27 
28 #include <cmath>
29 
30 //Energy, temperature units in Hartrees:
31 const double eV = 1/27.21138505; //!< eV in Hartrees
32 const double Ryd = 0.5; //!< Rydberg in Hartrees
33 const double Joule = 1/4.35974434e-18; //!< Joule in Hartrees
34 const double KJoule = 1000*Joule; //!< KJoule in Hartrees
35 const double Kcal = KJoule * 4.184; //!< Kcal in Hartrees
36 const double Kelvin = 1.3806488e-23*Joule; //!< Kelvin in Hartrees
37 const double invcm = 1./219474.6313705; //!< Inverse cm in Hartrees
38 
39 //Length units in bohrs:
40 const double Angstrom = 1/0.5291772; //!< Angstrom in bohrs
41 const double meter = 1e10*Angstrom; //!< meter in bohrs
42 const double liter = 1e-3*pow(meter,3);  //!< liter in cubic bohrs
43 
44 //Mass units in electron masses:
45 const double amu = 1822.88839; //!< atomic mass unit in electron masses
46 const double kg = 1./9.10938291e-31; //!< kilogram in electron masses
47 
48 //Dimensionless:
49 const double mol = 6.0221367e23; //!< mole in number (i.e. Avogadro number)
50 
51 //Commonly used derived units:
52 const double Newton = Joule/meter;  //!< Newton in Hartree/bohr
53 const double Pascal = Newton/(meter*meter); //!< Pascal in Hartree/bohr^3
54 const double KPascal = 1000*Pascal;  //!< KPa in Hartree/bohr^3
55 const double Bar = 100*KPascal;   //!< bar in Hartree/bohr^3
56 const double mmHg = 133.322387415*Pascal;  //!< mm Hg in Hartree/bohr^3
57 
58 //Time
59 const double sec = sqrt((kg*meter)/Newton); //!< second in inverse Hartrees
60 const double invSec = 1./sec; //!< inverse second in Hartrees
61 const double fs = sec*1.0e-15; //!< femtosecond in inverse Hartrees
62 
63 //Electrical:
64 const double Coul = Joule/eV; //!< Coulomb in electrons
65 const double Volt = Joule/Coul; //!< Volt in Hartrees
66 const double Ampere = Coul/sec; //!< Ampere in electrons/inverse Hartree
67 const double Ohm = Volt/Ampere; //!< Ohm in inverse conductance quanta
68 
69 //! @}
70 #endif //JDFTX_CORE_UNITS_H
71