[−][src]Struct voroxx::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]
v1: &[f64; 3],
v2: &[f64; 3],
v3: &[f64; 3],
v4: &[f64; 3]
) -> Self
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]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for VoronoiCellNeighbor
[src]
impl VoronoiCellBase for VoronoiCellNeighbor
[src]
pub fn number_of_faces(&self) -> i32
[src]
pub fn number_of_edges(&self) -> i32
[src]
pub fn number_of_vertices(&self) -> i32
[src]
pub fn translate(&mut self, xyz: &[f64; 3])
[src]
pub fn surface_area(&self) -> f64
[src]
pub fn volume(&self) -> f64
[src]
pub fn total_edge_distance(&self) -> f64
[src]
pub fn centroid(&self) -> [f64; 3]
[src]
pub fn vertices(&self) -> Vec<[f64; 3]>
[src]
pub fn face_areas(&self) -> Vec<f64>
[src]
pub fn face_perimeters(&self) -> Vec<f64>
[src]
pub fn face_vertices(&self) -> Vec<Vec<usize>>
[src]
pub fn normals(&self) -> Vec<[f64; 3]>
[src]
pub fn max_radius_squared(&self) -> f64
[src]
Auto Trait Implementations
impl RefUnwindSafe for VoronoiCellNeighbor
impl !Send for VoronoiCellNeighbor
impl !Sync for VoronoiCellNeighbor
impl Unpin for VoronoiCellNeighbor
impl UnwindSafe for VoronoiCellNeighbor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,