Fixed segv in make_edi when no reference structure given
[gromacs/adressmacs.git] / include / physics.h
blob34ab640ea77bf0cf90dd66f53c8dc4a270015b43
1 /*
2 * $Id$
3 *
4 * This source code is part of
5 *
6 * G R O M A C S
7 *
8 * GROningen MAchine for Chemical Simulations
9 *
10 * VERSION 3.2.0
11 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
12 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
13 * Copyright (c) 2001-2004, The GROMACS development team,
14 * check out http://www.gromacs.org for more information.
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * If you want to redistribute modifications, please consider that
22 * scientific software is very special. Version control is crucial -
23 * bugs must be traceable. We will be happy to consider code for
24 * inclusion in the official distribution, but derived work must not
25 * be called official GROMACS. Details are found in the README & COPYING
26 * files - if they are missing, get the official version at www.gromacs.org.
28 * To help us fund GROMACS development, we humbly ask that you cite
29 * the papers on the package - you can find them in the top README file.
31 * For more info, check our website at http://www.gromacs.org
33 * And Hey:
34 * Gromacs Runs On Most of All Computer Systems
37 #ifndef _physics_h
38 #define _physics_h
40 #ifdef HAVE_CONFIG_H
41 #include <config.h>
42 #endif
45 * Physical constants to be used in Gromacs.
46 * No constants (apart from 0, 1 or 2) should
47 * be anywhere else in the code.
50 #include <math.h>
52 #ifndef M_PI
53 #ifdef _PI
54 #define M_PI _PI
55 #else
56 #define M_PI 3.14159265358979323846
57 #endif
58 #endif
60 #define ANGSTROM (1e-10) /* Old... */
61 #define KILO (1e3) /* Thousand */
62 #define NANO (1e-9) /* A Number */
63 #define PICO (1e-12) /* A Number */
64 #define A2NM (ANGSTROM/NANO) /* NANO */
65 #define NM2A (NANO/ANGSTROM) /* 10.0 */
66 #define RAD2DEG (180.0/M_PI) /* Conversion */
67 #define DEG2RAD (M_PI/180.0) /* id */
68 #define CAL2JOULE (4.184) /* id */
69 #define E_CHARGE (1.60217733e-19) /* Coulomb */
71 #define AMU (1.6605402e-27) /* kg */
72 #define BOLTZMANN (1.380658e-23) /* (J/K) */
73 #define AVOGADRO (6.0221367e23) /* () */
74 #define RGAS (BOLTZMANN*AVOGADRO) /* (J/(mol K)) */
75 #define BOLTZ (RGAS/KILO) /* (kJ/(mol K)) */
76 #define FARADAY (E_CHARGE*AVOGADRO) /* (C/mol) */
77 #define ELECTRONVOLT (E_CHARGE*AVOGADRO/KILO) /* (kJ/mol) */
78 #define PLANCK1 (6.6262e-34) /* J s */
79 #define PLANCK (6.6262e-34*AVOGADRO/(PICO*KILO)) /* (kJ/mol) ps */
81 #define EPSILON0 (5.72765E-4) /* (e^2 / Na (kJ nm))
82 == (e^2 mol/(kJ nm)) */
84 #define SPEED_OF_LIGHT (2.9979245800E05) /* nm/ps */
85 #define ATOMICMASS_keV (940000.0) /* Atomic mass in keV */
86 #define ELECTRONMASS_keV (512.0) /* Electron mas in keV */
88 #define FACEL (332.0636*CAL2JOULE) /* (10 * (ONE_4PI_EPS0)) */
89 #define ONE_4PI_EPS0 (FACEL*0.1) /* 1/(4*pi*e0)*/
90 #define PRESFAC (16.6054) /* bar / pressure unity */
91 #define ENM2DEBYE 48.0321 /* Convert electron nm *
92 * to debye */
93 #define DEBYE2ENM 0.02081941
94 /* to convert from a acceleration in (e V)/(amu nm) */
95 /* FIELDFAC is also Faraday's constant and E_CHARGE/(1e6 AMU) */
96 #define FIELDFAC (FARADAY/KILO)
98 /* to convert AU to MD units: */
99 #define HARTREE2KJ 4.3597482e-21
100 #define BORH2NM 0.0529177249
101 #define HARTREE_BOHR2MD (HARTREE2KJ*AVOGADRO/BORH2NM)
103 #endif /* _physics_h */