Expand description
§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
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);Re-exports§
pub use atom::Atom;pub use atom::Bond;pub use atom::UffAtomType;pub use cell::UnitCell;pub use cell::CellType;pub use forcefield::System;pub use forcefield::EnergyTerms;pub use optimizer::UffOptimizer;pub use params::get_uff_params;pub use params::element_symbol;
Modules§
Functions§
- init_
parallelism - Initializes the Rayon thread pool.
If
num_threadsis Some(n), it sets that specific number. Ifnum_threadsis None, it checksRAYON_NUM_THREADSenv var or defaults to 4.