uff-relax
A high-performance, parallelized molecular structure optimizer for Rust, powered by the Universal Force Field (UFF) and the FIRE algorithm.
Features
- ๐ High Performance: Optimized force evaluations with Cell Lists for efficient neighbor searching.
- ๐งต Parallel Processing: Scalable multi-threading via Rayon, automatically enabled for large systems (>1000 atoms).
- โก Electrostatics: Supported via the Wolf Summation Method (Damped Coulomb Summation) for efficient and accurate partial charge interactions.
- ๐ Wasm Support: Fully compatible with WebAssembly for browser-based molecular modeling.
- ๐ Async Optimizer: Non-blocking
optimize_asyncAPI with customizable step hooks, perfect for responsive UIs. - ๐ PBC Support: Periodic boundary conditions for Orthorhombic and Triclinic systems.
- ๐งช Smart Type Assignment: Automatically infers UFF atom types from atomic numbers and connectivity.
- ๐ฆ Structure Validation: Automatic detection of abnormal overlaps and stretched bonds (e.g., mechanical entanglements or interlocked rings) after optimization.
- ๐ฆ Pure Rust: Fast, safe, and multi-platform.
Installation
Add this to your Cargo.toml:
[]
= "1.0.7" # Use the latest version
= { = "0.31", = ["serde"] }
= "1.11"
= { = "1.0", = ["derive"] }
For WebAssembly support, enable the wasm feature:
= { = "1.0.7", = ["wasm"] }
Quick Start
use ;
use DVec3;
Running Examples
Try the included examples to see the optimizer in action:
Benchmarks
This crate includes specialized benchmarks to measure scaling performance and handle large-scale systems. These are standalone binaries (harness = false) to ensure minimal overhead.
1. Parallelization Threshold (1 vs 2 threads)
Measures the efficiency of parallelization by comparing 1 and 2 threads as the number of atoms increases. This benchmark helped establish the initial PARALLEL_THRESHOLD.
2. Large System Stress Test
Simulates a system with 100,000 atoms to verify stability and memory efficiency in large-scale optimizations.
3. Thread Scalability Comparison
Compares the performance across various thread counts (1, 2, 4, 8, etc.) for different system sizes, identifying optimal parallelization strategies.
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Author
Forblaze Project
Website: https://forblaze-works.com/