pub struct HardShape<G>(pub G);Expand description
Infinite energy when sites overlap, 0 when they don’t (not differentiable).
HardShape represents each site with a hard orientable shape.
The generic type names are:
G: Theshapetype.
§Example
use hoomd_geometry::{Convex, shape::Rectangle};
use hoomd_interaction::pairwise::HardShape;
let square = Rectangle::with_equal_edges(1.0.try_into()?);
let hard_shape = HardShape(Convex(square));Tuple Fields§
§0: GTrait Implementations§
Source§impl<'de, G> Deserialize<'de> for HardShape<G>where
G: Deserialize<'de>,
impl<'de, G> Deserialize<'de> for HardShape<G>where
G: 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<G> MaximumInteractionRange for HardShape<G>where
G: BoundingSphereRadius,
impl<G> MaximumInteractionRange for HardShape<G>where
G: BoundingSphereRadius,
Source§fn maximum_interaction_range(&self) -> f64
fn maximum_interaction_range(&self) -> f64
The largest distance between two sites where the pairwise interaction may be non-zero.
Source§impl<G, S, R, P> SitePairEnergy<S> for HardShape<G>
impl<G, S, R, P> SitePairEnergy<S> for HardShape<G>
Source§fn site_pair_energy(&self, site_properties_i: &S, site_properties_j: &S) -> f64
fn site_pair_energy(&self, site_properties_i: &S, site_properties_j: &S) -> f64
Compute the energy contribution from a pair of sites.
A pair of hard shapes contributes an infinite energy when they overlap, and zero when they do not.
§Example
use hoomd_geometry::{Convex, shape::Rectangle};
use hoomd_interaction::{SitePairEnergy, pairwise::HardShape};
use hoomd_microstate::property::OrientedPoint;
use hoomd_vector::{Angle, Cartesian};
use std::f64::consts::PI;
let square = Rectangle::with_equal_edges(1.0.try_into()?);
let hard_shape = HardShape(Convex(square));
let a = OrientedPoint {
position: Cartesian::from([1.0, -1.0]),
orientation: Angle::from(PI / 2.0),
};
let b = OrientedPoint {
position: Cartesian::from([2.0, 0.0]),
orientation: Angle::from(PI / 4.0),
};
assert_eq!(hard_shape.site_pair_energy(&a, &b), 0.0);
let c = OrientedPoint {
position: Cartesian::from([1.5, -0.5]),
orientation: Angle::from(PI / 4.0),
};
assert_eq!(hard_shape.site_pair_energy(&a, &c), f64::INFINITY);Source§fn site_pair_energy_initial(
&self,
_site_properties_i: &S,
_site_properties_j: &S,
) -> f64
fn site_pair_energy_initial( &self, _site_properties_i: &S, _site_properties_j: &S, ) -> f64
Evaluate the energy contribution from a pair of sites in the initial state.
Hard shapes are assumed to be non-overlapping in the initial state. This method always returns zero.
Source§fn is_only_infinite_or_zero() -> bool
fn is_only_infinite_or_zero() -> bool
Does this potential only ever return infinity or zero? Read more
impl<G> StructuralPartialEq for HardShape<G>
Auto Trait Implementations§
impl<G> Freeze for HardShape<G>where
G: Freeze,
impl<G> RefUnwindSafe for HardShape<G>where
G: RefUnwindSafe,
impl<G> Send for HardShape<G>where
G: Send,
impl<G> Sync for HardShape<G>where
G: Sync,
impl<G> Unpin for HardShape<G>where
G: Unpin,
impl<G> UnsafeUnpin for HardShape<G>where
G: UnsafeUnpin,
impl<G> UnwindSafe for HardShape<G>where
G: 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