pub struct UffOptimizer {
pub max_iterations: usize,
pub force_threshold: f64,
pub verbose: bool,
pub num_threads: usize,
pub cutoff: f64,
pub history_size: usize,
pub max_displacement: f64,
pub step_hook: Option<Arc<StepHook>>,
pub cancel_flag: Option<Arc<AtomicBool>>,
}Expand description
Optimizer for molecular structures using the FIRE (Fast Iterative Relaxation Engine) algorithm.
Fields§
§max_iterations: usizeMaximum number of iterations to perform.
force_threshold: f64Threshold for the maximum force on any atom (kcal/mol/Å).
verbose: boolWhether to print optimization progress to tracing logs.
num_threads: usizeNumber of threads to use. 0 means automatic based on system size.
cutoff: f64Cutoff distance for non-bonded interactions (Å).
history_size: usizeNumber of steps to average for convergence criteria.
max_displacement: f64Maximum distance an atom can move in a single step (Å).
step_hook: Option<Arc<StepHook>>Optional hook called after each iteration.
cancel_flag: Option<Arc<AtomicBool>>Optional flag to cancel optimization from another thread/context.
Implementations§
Source§impl UffOptimizer
impl UffOptimizer
Sourcepub fn new(max_iterations: usize, force_threshold: f64) -> Self
pub fn new(max_iterations: usize, force_threshold: f64) -> Self
Creates a new optimizer with default settings.
pub fn with_max_displacement(self, max: f64) -> Self
pub fn with_num_threads(self, num_threads: usize) -> Self
pub fn with_cutoff(self, cutoff: f64) -> Self
pub fn with_history_size(self, size: usize) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
pub fn with_step_hook<F>(self, hook: F) -> Self
pub fn with_cancel_flag(self, flag: Arc<AtomicBool>) -> Self
Sourcepub fn optimize(&self, system: &mut System)
pub fn optimize(&self, system: &mut System)
Optimized structural geometry using the FIRE algorithm.
Sourcepub async fn optimize_async(&self, system: &mut System)
pub async fn optimize_async(&self, system: &mut System)
Asynchronous version of the optimizer for non-blocking environments (Wasm/UIs).
Auto Trait Implementations§
impl Freeze for UffOptimizer
impl !RefUnwindSafe for UffOptimizer
impl Send for UffOptimizer
impl Sync for UffOptimizer
impl Unpin for UffOptimizer
impl UnsafeUnpin for UffOptimizer
impl !UnwindSafe for UffOptimizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more