Skip to main content

NeighborList

Struct NeighborList 

Source
pub struct NeighborList { /* private fields */ }
Expand description

Candidate pairs built with a displacement skin for reuse across frames.

Implementations§

Source§

impl NeighborList

Source

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.

Source

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.

Source

pub const fn generation(&self) -> CoordinateGeneration

The coordinate generation used to build this candidate set.

Source

pub const fn is_current(&self, generation: CoordinateGeneration) -> bool

Whether a structure-local cache entry belongs to generation.

Source

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.

Source

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§

Source§

impl Debug for NeighborList

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.