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
//! # uff-relax
//!
//! `uff-relax` is a fast, parallelized molecular structure optimizer using the
//! Universal Force Field (UFF) and the FIRE (Fast Iterative Relaxation Engine) algorithm.
//!
//! ## Features
//! - **Fast**: Optimized force calculations with spatial partitioning (Cell Lists).
//! - **Parallel**: Automatic multi-threading using Rayon for large systems.
//! - **Flexible**: Supports periodic boundary conditions (Orthorhombic and Triclinic).
//! - **Easy to use**: Simple API for defining atoms, bonds, and running optimizations.
//!
//! ## Quick Start
//!
//! ```rust
//! use uff_relax::{System, Atom, Bond, UnitCell, UffOptimizer};
//! use glam::DVec3;
//!
//! // Define atoms
//! let atoms = vec![
//! Atom::new(6, DVec3::new(0.0, 0.0, 0.0)),
//! Atom::new(6, DVec3::new(1.5, 0.0, 0.0)),
//! ];
//! // Define bonds
//! let bonds = vec![Bond { atom_indices: (0, 1), order: 1.0 }];
//! // Setup system
//! let mut system = System::new(atoms, bonds, UnitCell::new_none());
//! // Optimize
//! UffOptimizer::new(100, 1e-2).optimize(&mut system);
//! ```
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use calculate_coulomb;
use Once;
static START: Once = new;
/// Initializes the Rayon thread pool.
/// If `num_threads` is Some(n), it sets that specific number.
/// If `num_threads` is None, it checks `RAYON_NUM_THREADS` env var or defaults to 4.