pub struct NeighborList { /* private fields */ }Expand description
Candidate pairs built with a displacement skin for reuse across frames.
Implementations§
Source§impl NeighborList
impl NeighborList
Sourcepub fn build(
positions: &[[f32; 3]],
left: &[u32],
right: &[u32],
cutoff: f32,
skin: f32,
periodic: Option<&PeriodicBox>,
generation: CoordinateGeneration,
) -> Result<Self, SpatialError>
pub fn build( positions: &[[f32; 3]], left: &[u32], right: &[u32], cutoff: f32, skin: f32, periodic: Option<&PeriodicBox>, generation: CoordinateGeneration, ) -> Result<Self, SpatialError>
Builds candidates out to cutoff + skin.
§Errors
Returns an error for invalid distances or atom indices.
Sourcepub fn build_with_options(
positions: &[[f32; 3]],
left: &[u32],
right: &[u32],
cutoff: f32,
periodic: Option<&PeriodicBox>,
generation: CoordinateGeneration,
options: NeighborListOptions,
) -> Result<Self, SpatialError>
pub fn build_with_options( positions: &[[f32; 3]], left: &[u32], right: &[u32], cutoff: f32, periodic: Option<&PeriodicBox>, generation: CoordinateGeneration, options: NeighborListOptions, ) -> Result<Self, SpatialError>
Builds candidates under an explicit cell-grid memory policy.
§Errors
Returns an error for invalid options, distances or atom indices.
Sourcepub const fn generation(&self) -> CoordinateGeneration
pub const fn generation(&self) -> CoordinateGeneration
The coordinate generation used to build this candidate set.
Sourcepub const fn is_current(&self, generation: CoordinateGeneration) -> bool
pub const fn is_current(&self, generation: CoordinateGeneration) -> bool
Whether a structure-local cache entry belongs to generation.
Sourcepub fn can_reuse(
&self,
positions: &[[f32; 3]],
periodic: Option<&PeriodicBox>,
) -> bool
pub fn can_reuse( &self, positions: &[[f32; 3]], periodic: Option<&PeriodicBox>, ) -> bool
Whether no atom has moved more than half the skin.
Reuse additionally requires the same coordinate count and the same periodic box used to construct the candidate set.
Sourcepub fn pairs(
&self,
positions: &[[f32; 3]],
cutoff: f32,
periodic: Option<&PeriodicBox>,
) -> Result<Vec<NeighborPair>, SpatialError>
pub fn pairs( &self, positions: &[[f32; 3]], cutoff: f32, periodic: Option<&PeriodicBox>, ) -> Result<Vec<NeighborPair>, SpatialError>
Filters the candidates at the requested inner cutoff.
§Errors
Returns an error when positions moved far enough that an unseen pair could have entered the cutoff, or when the cutoff is invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NeighborList
impl RefUnwindSafe for NeighborList
impl Send for NeighborList
impl Sync for NeighborList
impl Unpin for NeighborList
impl UnsafeUnpin for NeighborList
impl UnwindSafe for NeighborList
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> 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