[][src]Struct voroxx::VoronoiCellNeighbor

#[repr(C)]pub struct VoronoiCellNeighbor(_);

A single Voronoi cell, with neighbor information.

This class represents a single Voronoi cell, as a collection of vertices that are connected by edges. The class contains routines for initializing the Voronoi cell to be simple shapes such as a box, tetrahedron, or octahedron. It the contains routines for recomputing the cell based on cutting it by a plane, which forms the key routine for the Voronoi cell computation. It contains numerous routine for computing statistics about the Voronoi cell, and it can output the cell in several formats.

Use this class in cases when is necessary to track the IDs of neighboring particles associated with each face of the Voronoi cell.

Implementations

impl VoronoiCellNeighbor[src]

pub fn init(xyz_min: &[f64; 3], xyz_max: &[f64; 3]) -> Self[src]

Initializes the Voronoi cell to be an axis aligned rectangular box with the given dimensions. The neighbor information for the initial faces are ID numbers from -1 to -6.

Parameters:

  • xyz_min The minimum coordinates.
  • xyz_max The maximum coordinates.

pub fn init_octahedron(l: f64) -> Self[src]

Initializes the cell to be an octahedron with vertices at (l,0,0), (-l,0,0), (0,l,0), (0,-l,0), (0,0,l), and (0,0,-l). The neighbor information for the initial faces are ID numbers from -1 to -8.

Parameters:

  • l a parameter setting the size of the octahedron.

pub fn init_tetrahedron(
    v1: &[f64; 3],
    v2: &[f64; 3],
    v3: &[f64; 3],
    v4: &[f64; 3]
) -> Self
[src]

Initializes the cell to be a tetrahedron. The neighbor information for the initial faces are ID numbers from -1 to -4.

Parameters:

  • v1 The coordinates (x,y,z) of the first vertex.
  • v2 The coordinates (x,y,z) of the second vertex.
  • v3 The coordinates (x,y,z) of the third vertex.
  • v4 The coordinates (x,y,z) of the fourth vertex.

pub fn plane(&mut self, xyz: &[f64; 3]) -> bool[src]

Cuts a Voronoi cell using the plane corresponding to the perpendicular bisector between the particle and the origin. This sets the plane ID number to zero; see method nplane to supply a different plane ID number.

Parameters: (x, y, z) The position of the particle.

Returns: False if the plane cut deleted the cell entirely, true otherwise.

pub fn nplane(&mut self, xyz: &[f64; 3], p_id: i32) -> bool[src]

Cuts a Voronoi cell using the plane corresponding to the perpendicular bisector of the particle and the origin.

Parameters:

  • (x, y, z) The position of the particle.
  • p_id The plane ID number for tracking neighbors.

Returns: False if the plane cut deleted the cell entirely, true otherwise.

pub fn neighbors(&self) -> Vec<i32>[src]

Returns a list of IDs of neighboring particles corresponding to each face.

Trait Implementations

impl Clone for VoronoiCellNeighbor[src]

impl Drop for VoronoiCellNeighbor[src]

impl VoronoiCellBase for VoronoiCellNeighbor[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.