pub struct Expanded<F> {
pub f: F,
pub delta: f64,
}Expand description
Expand another potential.
U(r) = f(r - \delta)§Example
Expanded Lennard-Jones:
use approxim::{assert_abs_diff_eq, assert_relative_eq};
use hoomd_interaction::univariate::{
Expanded, LennardJones, UnivariateEnergy,
};
let epsilon = 1.5;
let sigma = 1.0;
let delta = 0.75;
let lj: LennardJones = LennardJones { epsilon, sigma };
let expanded_lj = Expanded { f: lj, delta };
assert_abs_diff_eq!(
expanded_lj.energy(1.0),
expanded_lj.f.energy(1.0 - 0.75)
);Fields§
§f: FThe original potential.
delta: f64$\delta$ value $[\mathrm{length}]$.
Trait Implementations§
Source§impl<'de, F> Deserialize<'de> for Expanded<F>where
F: Deserialize<'de>,
impl<'de, F> Deserialize<'de> for Expanded<F>where
F: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<F: UnivariateEnergy> UnivariateEnergy for Expanded<F>
impl<F: UnivariateEnergy> UnivariateEnergy for Expanded<F>
Source§impl<F: UnivariateForce> UnivariateForce for Expanded<F>
impl<F: UnivariateForce> UnivariateForce for Expanded<F>
impl<F> StructuralPartialEq for Expanded<F>
Auto Trait Implementations§
impl<F> Freeze for Expanded<F>where
F: Freeze,
impl<F> RefUnwindSafe for Expanded<F>where
F: RefUnwindSafe,
impl<F> Send for Expanded<F>where
F: Send,
impl<F> Sync for Expanded<F>where
F: Sync,
impl<F> Unpin for Expanded<F>where
F: Unpin,
impl<F> UnsafeUnpin for Expanded<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Expanded<F>where
F: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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