File: constants.C

package info (click to toggle)
ball 1.5.0%2Bgit20180813.37fc53c-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 239,888 kB
  • sloc: cpp: 326,149; ansic: 4,208; python: 2,303; yacc: 1,778; lex: 1,099; xml: 958; sh: 322; makefile: 95
file content (115 lines) | stat: -rw-r--r-- 2,896 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: constants.C,v 1.6 2002/02/27 12:20:33 sturm Exp $

#include <BALL/COMMON/constants.h>

namespace BALL
{
	namespace Constants
	{
		// EPSILON (used for comparisons)
		double EPSILON = 1e-6;

		// PI
		const double  PI = 3.14159265358979323846;

		// Euler's number - base of the natural logarithm
		const double  E  = 2.718281828459045235;
		
		//	Elementary charge.
		const double	ELEMENTARY_CHARGE = 1.60217738E-19;  	 // C
	
		/// Elementary charge (alias)
		const double	e0								=	ELEMENTARY_CHARGE;

		// Electron mass.
		const double	ELECTRON_MASS   	= 9.1093897E-31;   	 // kg

		// Proton mass.
		const double	PROTON_MASS     	= 1.6726230E-27;   	 // kg

		// Neutron mass.
		const double	NEUTRON_MASS    	= 1.6749286E-27;   	 // kg

		// Avogadro constant.
		const double	AVOGADRO        	= 6.0221367E+23;   	 // 1 / mol

		// Avogadro constant (alias)
		const double	NA								= AVOGADRO;

		// Avogadro constant (alias)
		const double	MOL             	= AVOGADRO;

		// Boltzmann constant.
		const double	BOLTZMANN       	= 1.380657E-23;  	   // J / K

		// Boltzmann constant (alias)
		const double	k	        				= BOLTZMANN;
		
		// Planck constant.
		const double	PLANCK 	         	= 6.6260754E-34;      // J * sec

		// Planck constant (alias)
		const double	h       	   			= PLANCK;

		// Gas constant (= NA * k)	
		const double	GAS_CONSTANT 	  	= NA * k;

		// Gas constant (alias)
		const double R 								= GAS_CONSTANT;

		// Faraday constant (= NA * e0)
		const double	FARADAY         	= NA * e0;

		// Faraday constant (alias)
		const double	F    							= FARADAY;

		// Bohr radius.
		const double	BOHR_RADIUS     	= 5.29177249E-11;     // m

		// Bohr radius (alias)
		const double	a0     						= BOHR_RADIUS;

		//  the following values from: 
		//  P.W.Atkins: Physical Chemistry, 5th ed., Oxford University Press, 1995

		// Vacuum permittivity.
		const double	VACUUM_PERMITTIVITY    	= 8.85419E-12;     // C^2 / (J * m)

		// Vacuum permeability.
		const double	VACUUM_PERMEABILITY     = (4 * PI * 1E-7);	// J s^2 / (C^2 * m)

		// Speed of light.
		const double	SPEED_OF_LIGHT          = 2.99792458E+8;	  // m / s

		// Speed of Light (alias)
		const double	c												= SPEED_OF_LIGHT;

		// Gravitational constant.
		const double	GRAVITATIONAL_CONSTANT  = 6.67259E-11;    	// N m^2 / kg^2

		// Fine structure constant.
		const double	FINE_STRUCTURE_CONSTANT = 7.29735E-3;   		// 1
			
		// Degree per rad.
		const double	DEG_PER_RAD				= 57.2957795130823209;

		// Rad per degree.
		const double	RAD_PER_DEG			 	= 0.0174532925199432957;

		// mm per inch.
		const double	MM_PER_INCH 			= 25.4;

		// m per foot.
		const double	M_PER_FOOT  			= 3.048;

		// Joule per calorie
		const double	JOULE_PER_CAL     = 4.184;

		// Calories per Joule.
		const double	CAL_PER_JOULE     = (1 / 4.184);

	}
}