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
// Copyright 2023 Mikael Lund
//
// Licensed under the Apache license, version 2.0 (the "license");
// you may not use this file except in compliance with the license.
// You may obtain a copy of the license at
//
// http://www.apache.org/licenses/license-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the license is distributed on an "as is" basis,
// without warranties or conditions of any kind, either express or implied.
// See the license for the specific language governing permissions and
// limitations under the license.
//! # Interatomic
//!
//! A library for calculating interatomic interactions
//! such as van der Waals, electrostatics, and other two-body or many-body potentials.
//!
extern crate approx;
/// A point in 3D space
pub type Vector3 = Vector3;
/// A stack-allocated 3x3 square matrix
pub type Matrix3 = Matrix3;
pub use CombinationRule;
use ;
pub use coulomb;
pub use Cutoff;
/// Electrostatic prefactor, e²/4πε₀ × 10⁷ × NA (Å × kJ / mol).
///
/// Can be used to calculate e.g. the interaction energy bewteen two
/// point charges in kJ/mol:
///
/// Examples:
/// ```
/// use interatomic::ELECTRIC_PREFACTOR;
/// let z1 = 1.0; // unit-less charge number
/// let z2 = -1.0; // unit-less charge number
/// let r = 7.0; // separation in angstrom
/// let rel_dielectric_const = 80.0; // relative dielectric constant
/// let energy = ELECTRIC_PREFACTOR * z1 * z2 / (rel_dielectric_const * r);
/// assert_eq!(energy, -2.48099031507825); // in kJ/mol
pub use TO_CHEMISTRY_UNIT as ELECTRIC_PREFACTOR;