Struct gosh_optim::Dynamics
source · [−]pub struct Dynamics<'a, U> { /* private fields */ }Expand description
A potential walker for dynamic simulation
Implementations
sourceimpl<'a, U> Dynamics<'a, U>
impl<'a, U> Dynamics<'a, U>
sourcepub fn new(x: &[f64], f: impl EvaluatePotential<U> + 'a) -> Self
pub fn new(x: &[f64], f: impl EvaluatePotential<U> + 'a) -> Self
Construct a Dynamics
Parameters
- x: initial position
- f: a closure for evaluation of energy and force at current position.
in closure f:
- the first paramater is the position
- the second is the force to be updated
- the return value is the energy
sourcepub fn get_extra(&mut self) -> Result<&U>
pub fn get_extra(&mut self) -> Result<&U>
Return extra data returned in evaluate method of EvaluatePotential
trait.
The potential will be evaluated when necessary.
sourcepub fn get_energy(&mut self) -> Result<f64>
pub fn get_energy(&mut self) -> Result<f64>
Return energy at current position if ok.
The function will be evaluated when necessary.
sourceimpl<'a, U> Dynamics<'a, U>
impl<'a, U> Dynamics<'a, U>
sourcepub fn set_epsilon(&mut self, eps: f64)
pub fn set_epsilon(&mut self, eps: f64)
Set epsilon for determining if structure has any substantial changes. If so, the potential will be re-evaluated automatically.
sourcepub fn step_toward(&mut self, displacement: &[f64])
pub fn step_toward(&mut self, displacement: &[f64])
Update position x with a prescribed displacement.
x += displacement
sourcepub fn set_position(&mut self, position: &[f64])
pub fn set_position(&mut self, position: &[f64])
Set current position directly.
sourceimpl<'a> Dynamics<'a, ()>
impl<'a> Dynamics<'a, ()>
sourcepub fn from_chemical_model(
model: &'a mut impl ChemicalModel,
mol: Molecule
) -> Dynamics<'_, ()>
pub fn from_chemical_model(
model: &'a mut impl ChemicalModel,
mol: Molecule
) -> Dynamics<'_, ()>
Create Dynamics for molecule simulation using chemical model model.
Auto Trait Implementations
impl<'a, U> !RefUnwindSafe for Dynamics<'a, U>
impl<'a, U> !Send for Dynamics<'a, U>
impl<'a, U> !Sync for Dynamics<'a, U>
impl<'a, U> Unpin for Dynamics<'a, U> where
U: Unpin,
impl<'a, U> !UnwindSafe for Dynamics<'a, U>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> IntoSql for T
impl<T> IntoSql for T
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self is actually part of its subset T (and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self to the equivalent element of its superset.