Struct spherical_cow::PackedVolume[][src]

pub struct PackedVolume<C> {
    pub spheres: Vec<Sphere>,
    pub container: C,
}

To obtain quantitative values of your packing effectiveness, PackedVolume provides a number of useful indicators of such.

Fields

spheres: Vec<Sphere>

A set of spheres generated by a call to pack_spheres.

container: C

The container in which spheres have been packed.

Implementations

impl<C: Container> PackedVolume<C>[src]

pub fn new<D: Distribution<f64>>(
    container: C,
    mut size_distribution: &mut D
) -> Result<PackedVolume<C>, Error>
[src]

Creates a new PackedVolume by calling pack_spheres with a given distribution of sphere sizes and a container to pack into.

pub fn from_vec(spheres: Vec<Sphere>, container: C) -> PackedVolume<C>[src]

Creates a PackedVolume from a pre calculated cluster of spheres. Useful for gathering statistics from packings generated elsewhere for comparison to the current algorithm. Also used for deserialization. This method is currently unchecked, so use with caution.

pub fn volume_fraction(&self) -> f32[src]

Calculates the volume fraction ν = Vs/V: the volume of all spheres packed into a container divided by the volume of said container.

The Kepler Conjecture suggests that the densest possible volume fraction for equal sized spheres is ~74.05%. However, the higest possible volume fraction for any random radii distribution is currently unknown to mathematicians. The algorithm implemented herin obtains 59.29% in a cube with side lengths of 90 with sphere radii between 0.01 and 0.02, compared with a long standing and well known geometric compression algorithm which achieved 52.89%.

pub fn void_ratio(&self) -> f32[src]

Calculates the void ratio e = Vv/Vs: the volume of all void space divided by the volume of solids in the container. Here we take 'solids' to mean volumes of all packed spheres.

pub fn coordination_number(&self) -> f32[src]

The coordination number indicates the connectivity of the packing. For any given sphere in the packing, its coordination number is defined as the number of spheres it is in contact with. This function returns the arethmetic mean of all coordination numbers in the packing, yielding a overall coordination number of the system.

pub fn fabric_tensor(&self) -> Matrix3<f32>[src]

Generates the fabric tensor of the packing. The sum of all eigenvalues phi_i,j will always equal 1. Perfectly isotropic packing should see the diagonals of this matrix = 1/3. Deviations from this value indicates the amount of anisotropy in the system.

Trait Implementations

impl<C: Debug> Debug for PackedVolume<C>[src]

impl<'de, C: Container + Deserialize<'de>> Deserialize<'de> for PackedVolume<C>[src]

impl<C: Container + Serialize> Serialize for PackedVolume<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for PackedVolume<C> where
    C: RefUnwindSafe
[src]

impl<C> Send for PackedVolume<C> where
    C: Send
[src]

impl<C> Sync for PackedVolume<C> where
    C: Sync
[src]

impl<C> Unpin for PackedVolume<C> where
    C: Unpin
[src]

impl<C> UnwindSafe for PackedVolume<C> where
    C: UnwindSafe
[src]

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,