eOn client
Long-timescale dynamics: aKMC, NEB, parallel replica
☾
Toggle main menu visibility
Loading...
Searching...
No Matches
units.hpp
Go to the documentation of this file.
1
/*
2
** This file is part of eOn.
3
**
4
** SPDX-License-Identifier: BSD-3-Clause
5
**
6
** Copyright (c) 2010--present, eOn Development Team
7
** All rights reserved.
8
**
9
** Repo:
10
** https://github.com/TheochemUI/eOn
11
*/
12
#pragma once
82
84
#define FORCEFIELDS_UNIT_SYSTEM_SI_MKSA 0
86
#define FORCEFIELDS_UNIT_SYSTEM_METRE_KILOGRAMME_PER_MOL_SECOND_AMPERE_PER_MOL 1
88
#define FORCEFIELDS_UNIT_SYSTEM_ANGSTROM_KILOGRAMME_PER_MOL_FEMTOSECOND_AMPERE_PER_MOL \
89
2
90
91
#define FORCEFIELDS_UNIT_SYSTEM_ANGSTROM_GRAMME_PER_MOL_FEMTOSECOND_ECHARGE 3
93
#define FORCEFIELDS_UNIT_SYSTEM_ELECTRONVOLT_ANGSTROM_FEMTOSECOND_ECHARGE 4
95
#define FORCEFIELDS_UNIT_SYSTEM_KILOCALORY_PER_MOL_ANGSTROM_FEMTOSECOND_ECHARGE \
96
5
97
99
#undef FORCEFIELDS_UNIT_SYSTEM_HPP
100
#define FORCEFIELDS_UNIT_SYSTEM_HPP \
101
FORCEFIELDS_UNIT_SYSTEM_ELECTRONVOLT_ANGSTROM_FEMTOSECOND_ECHARGE
102
namespace
forcefields
{
104
namespace
unit_system {
105
// Some physical constants expressed in SI unit. Source for constants:
106
// http://physics.nist.gov/cuu/Constants/index.html
107
const
double
R_gas
= 8.314472;
// J/mol/K
108
const
double
k_boltzmann
= 1.3806505e-23;
// J/K
109
const
double
Na_avogadro
= 6.0221415e23;
// mol^-1
110
const
double
/* 1 */
calory
= 4.1868;
// J
111
const
double
e_charge
= 1.60217653e-19;
// C
112
const
double
/* 1 */
debye
=
113
3.33564e-30;
// C m
115
const
double
one_over_4_pi_epsilon0
=
116
8.98755178495272255e+09;
// SI
119
const
double
sqrt_one_over_4_pi_epsilon0
= 9.48026992492973368e+04;
// SI
120
121
// System independent units
122
const
double
pi
= 3.14159265358979312;
123
const
double
MOL
=
Na_avogadro
;
124
const
double
DEGREE
=
pi
/ 180;
// rad
125
126
#if FORCEFIELDS_UNIT_SYSTEM_HPP == FORCEFIELDS_UNIT_SYSTEM_SI_MKSA
127
const
char
LENGTH
[] =
"m"
;
128
const
char
MASS
[] =
"kg"
;
129
const
char
TIME
[] =
"s"
;
130
const
char
CURRENT
[] =
"A"
;
// Ampere
131
const
char
VELOCITY
[] =
"m/s"
;
132
const
char
ACCELERATION
[] =
"m s^-2"
;
133
const
char
FORCE
[] =
"N"
;
134
const
char
ENERGY
[] =
"J"
;
135
const
char
PRESSURE
[] =
"Pa"
;
136
const
char
CHARGE
[] =
"C"
;
137
138
// Main SI units Converters
139
const
double
/* 1 */
METRE
= 1.0;
// m
140
const
double
/* 1 */
KG
= 1.0;
// kg
141
const
double
/* 1 */
SECOND
= 1.0;
// s
142
const
double
/* 1 */
AMPERE
= 1.0;
// A
143
#elif FORCEFIELDS_UNIT_SYSTEM_HPP == \
144
FORCEFIELDS_UNIT_SYSTEM_METRE_KILOGRAMME_PER_MOL_SECOND_AMPERE_PER_MOL
145
const
char
LENGTH
[] =
"m"
;
146
const
char
MASS
[] =
"kg/mol"
;
147
const
char
TIME
[] =
"s"
;
148
const
char
CURRENT
[] =
"A/mol"
;
149
const
char
VELOCITY
[] =
"m/s"
;
150
const
char
ACCELERATION
[] =
"m s^-2"
;
151
const
char
FORCE
[] =
"N/mol"
;
152
const
char
ENERGY
[] =
"J/mol"
;
153
const
char
PRESSURE
[] =
"Pa/mol"
;
154
const
char
CHARGE
[] =
"C/mol"
;
155
156
// Main SI units Converters
157
const
double
/* 1 */
METRE
= 1.0;
// m
158
const
double
/* 1 */
KG
=
MOL
;
// kg/mol
159
const
double
/* 1 */
SECOND
= 1.0;
// s
160
const
double
/* 1 */
AMPERE
=
MOL
;
// A/mol
161
#elif FORCEFIELDS_UNIT_SYSTEM_HPP == \
162
FORCEFIELDS_UNIT_SYSTEM_ANGSTROM_KILOGRAMME_PER_MOL_FEMTOSECOND_AMPERE_PER_MOL
163
const
char
LENGTH
[] =
"Angstrom"
;
164
const
char
MASS
[] =
"kg/mol"
;
165
const
char
TIME
[] =
"fs"
;
166
const
char
CURRENT
[] =
"A/mol"
;
167
const
char
VELOCITY
[] =
"Angstrom/fs"
;
168
const
char
ACCELERATION
[] =
"Angstrom fs^-2"
;
169
const
char
FORCE
[] =
"1e30 N/mol"
;
170
const
char
ENERGY
[] =
"1e20 J/mol"
;
171
const
char
PRESSURE
[] =
"1e50 Pa/mol"
;
172
const
char
CHARGE
[] =
"C/mol"
;
173
174
// Main SI units Converters
175
const
double
/* 1 */
METRE
= 1e10;
// m
176
const
double
/* 1 */
KG
=
MOL
;
// kg/mol
177
const
double
/* 1 */
SECOND
= 1e15;
// s
178
const
double
/* 1 */
AMPERE
=
MOL
;
// A/mol
179
#elif FORCEFIELDS_UNIT_SYSTEM_HPP == \
180
FORCEFIELDS_UNIT_SYSTEM_ANGSTROM_GRAMME_PER_MOL_FEMTOSECOND_ECHARGE
181
const
char
LENGTH
[] =
"Angstrom"
;
182
const
char
MASS
[] =
"g/mol"
;
183
const
char
TIME
[] =
"fs"
;
184
const
char
CURRENT
[] =
"e/fs"
;
185
const
char
VELOCITY
[] =
"Angstrom/fs"
;
186
const
char
ACCELERATION
[] =
"Angstrom fs^-2"
;
187
const
char
FORCE
[] =
"1e17 J / Angstrom"
;
188
const
char
ENERGY
[] =
"1e17 J"
;
189
const
char
PRESSURE
[] =
"1e17 J Angstrom^-3"
;
190
const
char
CHARGE
[] =
"e"
;
191
192
// Main SI units Converters
193
const
double
/* 1 */
METRE
= 1e10;
// Angstrom
194
const
double
/* 1 */
KG
= 1000 *
MOL
;
// g/mol
195
const
double
/* 1 */
SECOND
=
196
1e15;
// fs
197
// 1 e/fs= e_charge C / 1e-15 s=e_charge*1e15 A
198
const
double
/* 1 */
AMPERE
= 1e-15 /
e_charge
;
// e/fs
199
#elif FORCEFIELDS_UNIT_SYSTEM_HPP == \
200
FORCEFIELDS_UNIT_SYSTEM_ELECTRONVOLT_ANGSTROM_FEMTOSECOND_ECHARGE
201
const
char
LENGTH
[] =
"A"
;
// Angstrom
202
const
char
TIME
[] =
"fs"
;
// second
203
const
char
MASS
[] =
"eV A^-2 fs^2"
;
204
const
char
CURRENT
[] =
"e/fs"
;
205
const
char
VELOCITY
[] =
"A fs^-1"
;
206
const
char
ACCELERATION
[] =
"A fs^-2"
;
207
const
char
FORCE
[] =
"eV/A"
;
208
const
char
ENERGY
[] =
"eV"
;
// electron volt
209
const
char
PRESSURE
[] =
"eV A^-3"
;
210
const
char
CHARGE
[] =
"(eV A)^(-1/2)"
;
211
212
// Main SI units Converters
213
const
double
/* 1 */
METRE
= 1e10;
// Angstrom
214
// 1 J = 1 kg m^2 s^-2
215
// e_charge C V = e_charge J = 1 eV
216
const
double
/* 1 */
KG
= 1e10 /
e_charge
;
// eV Angstrom^-2 fs^2
217
const
double
/* 1 */
SECOND
= 1e15;
// fs
218
const
double
/* 1 */
AMPERE
= 1e-15 /
e_charge
;
// e/fs
219
#elif FORCEFIELDS_UNIT_SYSTEM_HPP == \
220
FORCEFIELDS_UNIT_SYSTEM_KILOCALORY_PER_MOL_ANGSTROM_FEMTOSECOND_ECHARGE
221
const
char
LENGTH
[] =
"A"
;
// Angstrom
222
const
char
TIME
[] =
"fs"
;
// second
223
const
char
MASS
[] =
"kcal/mol A^-2 fs^2"
;
224
const
char
CURRENT
[] =
"e/fs"
;
225
const
char
VELOCITY
[] =
"A fs^-1"
;
226
const
char
ACCELERATION
[] =
"A fs^-2"
;
227
const
char
FORCE
[] =
"kcal mol A^-1"
;
228
const
char
ENERGY
[] =
"kcal/mol"
;
// electron volt
229
const
char
PRESSURE
[] =
"kcal/mol A^-3"
;
230
const
char
CHARGE
[] =
"(kcal/mol A)^(-1/2)"
;
231
232
// Main SI units Converters
233
const
double
/* 1 */
METRE
= 1e10;
// Angstrom
234
// 1 J = 1 kg m^2 s^-2
235
// e_charge C V = e_charge J = 1 eV
236
const
double
/* 1 */
KG
=
237
Na_avogadro
* 1e7 /
calory
;
// kcal/mol Angstrom^-2 fs^2
238
const
double
/* 1 */
SECOND
= 1e15;
// fs
239
const
double
/* 1 */
AMPERE
= 1e-15 /
e_charge
;
// e/fs
240
#endif
241
const
char
*
const
TEMPERATURE
=
ENERGY
;
242
// SI Units
243
const
double
METRE_PER_SECOND
=
METRE
/
SECOND
;
244
const
double
METRE_PER_SECOND2
=
METRE_PER_SECOND
/
SECOND
;
245
const
double
/* 1 */
NEWTON
=
KG
*
METRE_PER_SECOND2
;
246
const
double
/* 1 */
JOULE
=
NEWTON
*
METRE
;
247
const
double
/* 1 */
COULOMB
=
AMPERE
*
SECOND
;
248
const
double
WATT
=
JOULE
/
SECOND
;
249
const
double
VOLT
=
WATT
/
AMPERE
;
250
const
double
/* 1 */
KELVIN
=
k_boltzmann
*
JOULE
;
251
// SI Prefix
252
const
double
/* 1 */
KILO
= 1e3;
253
const
double
NANO
= 1e-9;
254
const
double
FEMTO
= 1e-15;
255
// Derived SI units
256
const
double
NM
=
NANO
*
METRE
;
257
const
double
GRAM
=
KG
/
KILO
;
258
const
double
/* 1 */
GRAM_PER_MOL
=
GRAM
/
MOL
;
259
const
double
/* 1 */
G_PER_MOL
=
GRAM_PER_MOL
;
260
const
double
/* 1 */
KJ_PER_MOL
=
KILO
*
JOULE
/
MOL
;
261
const
double
/* 1 */
KJ
=
KILO
*
JOULE
;
262
const
double
FS
=
FEMTO
*
SECOND
;
263
// Common non SI Units
264
const
double
/* 1 */
ANGSTROM
= 1e-10 *
METRE
;
265
const
double
/* 1 */
ANGSTROM2
=
ANGSTROM
*
ANGSTROM
;
266
const
double
/* 1 */
ANGSTROM3
=
ANGSTROM
*
ANGSTROM
*
ANGSTROM
;
267
const
double
ECHARGE
=
e_charge
*
COULOMB
;
268
const
double
EV
=
ECHARGE
*
VOLT
;
269
// Deprecated units
270
const
double
/* 1 */
CALORY
=
calory
*
JOULE
;
271
const
double
/* 1 */
KCAL_PER_MOL
=
KILO
*
CALORY
/
MOL
;
272
// Atomic Units
273
const
double
BOHR
= 5.291772108e-11 *
METRE
;
274
const
double
HARTREE
= 4.35974417e-18 *
JOULE
;
275
// CGS units
276
const
double
ERGS
= 1e-7 *
JOULE
;
277
// Constants
278
const
double
ONE_OVER_4_PI_EPSILON0
=
279
one_over_4_pi_epsilon0
*
METRE
*
JOULE
/
COULOMB
/
COULOMB
;
280
}
// namespace unit_system
281
}
// namespace forcefields
HARTREE
const double HARTREE
Definition
tip4p_unit_system.hpp:275
BOHR
const double BOHR
Definition
tip4p_unit_system.hpp:274
forcefields::unit_system::ECHARGE
const double ECHARGE
Definition
tip4p_unit_system.hpp:268
forcefields::unit_system::VOLT
const double VOLT
Definition
tip4p_unit_system.hpp:250
forcefields::unit_system::e_charge
const double e_charge
Definition
tip4p_unit_system.hpp:112
forcefields::unit_system::LENGTH
const char LENGTH[]
Definition
tip4p_unit_system.hpp:202
forcefields::unit_system::KJ_PER_MOL
const double KJ_PER_MOL
Definition
tip4p_unit_system.hpp:261
forcefields::unit_system::GRAM_PER_MOL
const double GRAM_PER_MOL
Definition
tip4p_unit_system.hpp:259
forcefields::unit_system::DEGREE
const double DEGREE
Definition
tip4p_unit_system.hpp:125
forcefields::unit_system::WATT
const double WATT
Definition
tip4p_unit_system.hpp:249
forcefields::unit_system::debye
const double debye
Definition
tip4p_unit_system.hpp:113
forcefields::unit_system::ANGSTROM
const double ANGSTROM
Definition
tip4p_unit_system.hpp:265
forcefields::unit_system::k_boltzmann
const double k_boltzmann
Definition
tip4p_unit_system.hpp:109
forcefields::unit_system::METRE_PER_SECOND
const double METRE_PER_SECOND
Definition
tip4p_unit_system.hpp:244
forcefields::unit_system::METRE_PER_SECOND2
const double METRE_PER_SECOND2
Definition
tip4p_unit_system.hpp:245
forcefields::unit_system::SECOND
const double SECOND
Definition
tip4p_unit_system.hpp:218
forcefields::unit_system::GRAM
const double GRAM
Definition
tip4p_unit_system.hpp:258
forcefields::unit_system::COULOMB
const double COULOMB
Definition
tip4p_unit_system.hpp:248
forcefields::unit_system::KG
const double KG
Definition
tip4p_unit_system.hpp:217
forcefields::unit_system::TEMPERATURE
const char *const TEMPERATURE
Definition
tip4p_unit_system.hpp:242
forcefields::unit_system::KILO
const double KILO
Definition
tip4p_unit_system.hpp:253
forcefields::unit_system::CURRENT
const char CURRENT[]
Definition
tip4p_unit_system.hpp:205
forcefields::unit_system::METRE
const double METRE
Definition
tip4p_unit_system.hpp:214
forcefields::unit_system::sqrt_one_over_4_pi_epsilon0
const double sqrt_one_over_4_pi_epsilon0
This is the quantity 1/sqrt(4*pi*epsilon0) in SI units.
Definition
tip4p_unit_system.hpp:120
forcefields::unit_system::KJ
const double KJ
Definition
tip4p_unit_system.hpp:262
forcefields::unit_system::NANO
const double NANO
Definition
tip4p_unit_system.hpp:254
forcefields::unit_system::KCAL_PER_MOL
const double KCAL_PER_MOL
Definition
tip4p_unit_system.hpp:272
forcefields::unit_system::NM
const double NM
Definition
tip4p_unit_system.hpp:257
forcefields::unit_system::Na_avogadro
const double Na_avogadro
Definition
tip4p_unit_system.hpp:110
forcefields::unit_system::AMPERE
const double AMPERE
Definition
tip4p_unit_system.hpp:219
forcefields::unit_system::MASS
const char MASS[]
Definition
tip4p_unit_system.hpp:204
forcefields::unit_system::PRESSURE
const char PRESSURE[]
Definition
tip4p_unit_system.hpp:210
forcefields::unit_system::EV
const double EV
Definition
tip4p_unit_system.hpp:269
forcefields::unit_system::VELOCITY
const char VELOCITY[]
Definition
tip4p_unit_system.hpp:206
forcefields::unit_system::one_over_4_pi_epsilon0
const double one_over_4_pi_epsilon0
This is the quantity 1/(4*pi*epsilon0) in SI units.
Definition
tip4p_unit_system.hpp:116
forcefields::unit_system::TIME
const char TIME[]
Definition
tip4p_unit_system.hpp:203
forcefields::unit_system::calory
const double calory
Definition
tip4p_unit_system.hpp:111
forcefields::unit_system::JOULE
const double JOULE
Definition
tip4p_unit_system.hpp:247
forcefields::unit_system::NEWTON
const double NEWTON
Definition
tip4p_unit_system.hpp:246
forcefields::unit_system::ENERGY
const char ENERGY[]
Definition
tip4p_unit_system.hpp:209
forcefields::unit_system::ERGS
const double ERGS
Definition
tip4p_unit_system.hpp:277
forcefields::unit_system::FORCE
const char FORCE[]
Definition
tip4p_unit_system.hpp:208
forcefields::unit_system::pi
const double pi
Definition
tip4p_unit_system.hpp:123
forcefields::unit_system::ANGSTROM2
const double ANGSTROM2
Definition
tip4p_unit_system.hpp:266
forcefields::unit_system::R_gas
const double R_gas
Definition
tip4p_unit_system.hpp:108
forcefields::unit_system::ONE_OVER_4_PI_EPSILON0
const double ONE_OVER_4_PI_EPSILON0
Definition
tip4p_unit_system.hpp:279
forcefields::unit_system::FEMTO
const double FEMTO
Definition
tip4p_unit_system.hpp:255
forcefields::unit_system::MOL
const double MOL
Definition
tip4p_unit_system.hpp:124
forcefields::unit_system::KELVIN
const double KELVIN
Definition
tip4p_unit_system.hpp:251
forcefields::unit_system::G_PER_MOL
const double G_PER_MOL
Definition
tip4p_unit_system.hpp:260
forcefields::unit_system::ACCELERATION
const char ACCELERATION[]
Definition
tip4p_unit_system.hpp:207
forcefields::unit_system::CALORY
const double CALORY
Definition
tip4p_unit_system.hpp:271
forcefields::unit_system::FS
const double FS
Definition
tip4p_unit_system.hpp:263
forcefields::unit_system::CHARGE
const char CHARGE[]
Definition
tip4p_unit_system.hpp:211
forcefields::unit_system::ANGSTROM3
const double ANGSTROM3
Definition
tip4p_unit_system.hpp:267
forcefields
Definition
ccl.hpp:21
include
eon
potentials
XTBPot
units.hpp
Generated by
1.17.0
Generated by
Doxygen 1.17.0
Analytics by
Antics
provided by
TurtleTech ehf