JDFTx  1.2.0
Units.h
Go to the documentation of this file.
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 
25 
26 #include <cmath>
27 
28 //Energy, temperature units in Hartrees:
29 const double eV = 1/27.21138505;
30 const double Joule = 1/4.35974434e-18;
31 const double KJoule = 1000*Joule;
32 const double Kcal = KJoule * 4.184;
33 const double Kelvin = 1.3806488e-23*Joule;
34 const double invcm = 1./219474.6313705;
35 
36 //Length units in bohrs:
37 const double Angstrom = 1/0.5291772;
38 const double meter = 1e10*Angstrom;
39 const double liter = 1e-3*pow(meter,3);
40 
41 //Mass units in electron masses:
42 const double amu = 1822.88839;
43 const double kg = 1./9.10938291e-31;
44 
45 //Dimensionless:
46 const double mol = 6.0221367e23;
47 
48 //Commonly used derived units:
49 const double Newton = Joule/meter;
50 const double Pascal = Newton/(meter*meter);
51 const double KPascal = 1000*Pascal;
52 const double Bar = 100*KPascal;
53 const double mmHg = 133.322387415*Pascal;
54 
55 //Time
56 const double sec = sqrt((kg*meter)/Newton);
57 const double fs = sec*1.0e-15;
58 
59 #endif //JDFTX_CORE_UNITS_H
ScalarField pow(const ScalarField &, double alpha)
Elementwise power (preserve input)
ScalarField sqrt(const ScalarField &)
Elementwise square root (preserve input)
const double eV
Definition: Units.h:29
const double sec
Definition: Units.h:56
const double Joule
Definition: Units.h:30
const double Kcal
Definition: Units.h:32
const double kg
Definition: Units.h:43
const double mmHg
Definition: Units.h:53
const double Newton
Definition: Units.h:49
const double Kelvin
Definition: Units.h:33
const double invcm
Definition: Units.h:34
const double meter
Definition: Units.h:38
const double fs
Definition: Units.h:57
const double KPascal
Definition: Units.h:51
const double amu
Definition: Units.h:42
const double Angstrom
Definition: Units.h:37
const double KJoule
Definition: Units.h:31
const double mol
(= Avogadro number)
Definition: Units.h:46
const double liter
Definition: Units.h:39
const double Bar
Definition: Units.h:52
const double Pascal
Definition: Units.h:50