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