Skip to main content

VecCellBuilder

Struct VecCellBuilder 

Source
pub struct VecCellBuilder<K, const D: usize> { /* private fields */ }
Expand description

Construct a VecCell with given parameters.

§Example

use hoomd_spatial::VecCell;

let vec_cell = VecCell::<usize, 3>::builder()
    .nominal_search_radius(2.5.try_into()?)
    .maximum_search_radius(7.5)
    .build();

Implementations§

Source§

impl<K, const D: usize> VecCellBuilder<K, D>
where K: Copy + Eq + Hash,

Source

pub fn nominal_search_radius(self, nominal_search_radius: PositiveReal) -> Self

Choose the most commonly used search radius.

VecCell performs the best when searching for points within the nominal search radius of a given position.

§Example
use hoomd_spatial::VecCell;

let vec_cell = VecCell::<usize, 3>::builder()
    .nominal_search_radius(2.5.try_into()?)
    .build();
Source

pub fn maximum_search_radius(self, maximum_search_radius: f64) -> Self

Choose the largest search radius.

The maximum radius is rounded up to the nearest integer multiple of the nominal search radius. VecCell will panic when asked to search for points within a radius larger than the maximum.

§Example
use hoomd_spatial::VecCell;

let vec_cell = VecCell::<usize, 3>::builder()
    .nominal_search_radius(2.5.try_into()?)
    .maximum_search_radius(7.5)
    .build();
Source

pub fn build(self) -> VecCell<K, D>

Construct the VecCell with the chosen parameters.

§Example
use hoomd_spatial::VecCell;

let vec_cell = VecCell::<usize, 3>::builder()
    .nominal_search_radius(2.5.try_into()?)
    .maximum_search_radius(7.5)
    .build();

Auto Trait Implementations§

§

impl<K, const D: usize> Freeze for VecCellBuilder<K, D>

§

impl<K, const D: usize> RefUnwindSafe for VecCellBuilder<K, D>
where K: RefUnwindSafe,

§

impl<K, const D: usize> Send for VecCellBuilder<K, D>
where K: Send,

§

impl<K, const D: usize> Sync for VecCellBuilder<K, D>
where K: Sync,

§

impl<K, const D: usize> Unpin for VecCellBuilder<K, D>
where K: Unpin,

§

impl<K, const D: usize> UnsafeUnpin for VecCellBuilder<K, D>

§

impl<K, const D: usize> UnwindSafe for VecCellBuilder<K, D>
where K: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.