Struct vox_geometry_rust::sph_system_data3::SphSystemData3[][src]

pub struct SphSystemData3 { /* fields omitted */ }
Expand description

3-D SPH particle system data.

This class extends ParticleSystemData3 to specialize the data model for SPH. It includes density and pressure array as a default particle attribute, and it also contains SPH utilities such as interpolation operator.

Implementations

impl SphSystemData3[src]

pub fn new_default() -> SphSystemData3[src]

Constructs empty SPH system.

pub fn new(number_of_particles: usize) -> SphSystemData3[src]

Constructs SPH system data with given number of particles.

impl SphSystemData3[src]

pub fn set_radius(&mut self, new_radius: f64)[src]

\brief Sets the radius.

Sets the radius of the particle system. The radius will be interpreted as target spacing.

pub fn set_mass(&mut self, new_mass: f64)[src]

\brief Sets the mass of a particle.

Setting the mass of a particle will change the target density.

  • parameter: new_mass The new mass.

pub fn densities(&self) -> &Vec<f64>[src]

Returns the density array accessor (immutable).

pub fn densities_mut(&mut self) -> &mut Vec<f64>[src]

Returns the density array accessor (mutable).

pub fn pressures(&self) -> &Vec<f64>[src]

Returns the pressure array accessor (immutable).

pub fn pressures_mut(&mut self) -> &mut Vec<f64>[src]

Returns the pressure array accessor (mutable).

pub fn update_densities(&mut self)[src]

\brief Updates the density array with the latest particle positions.

This function updates the density array by recalculating each particle’s latest nearby particles’ position.

\warning You must update the neighbor searcher (SphSystemData3::build_neighbor_searcher) before calling this function.

pub fn set_target_density(&mut self, target_density: f64)[src]

Sets the target density of this particle system.

pub fn target_density(&self) -> f64[src]

Returns the target density of this particle system.

pub fn set_target_spacing(&mut self, spacing: f64)[src]

\brief Sets the target particle spacing in meters.

Once this function is called, hash grid and density should be updated using updateHashGrid() and update_densities).

pub fn target_spacing(&self) -> f64[src]

Returns the target particle spacing in meters.

pub fn set_relative_kernel_radius(&mut self, relative_radius: f64)[src]

\brief Sets the relative kernel radius.

Sets the relative kernel radius compared to the target particle spacing (i.e. kernel radius / target spacing). Once this function is called, hash grid and density should be updated using updateHashGrid() and update_densities).

pub fn relative_kernel_radius(&self) -> f64[src]

\brief Returns the relative kernel radius.

Returns the relative kernel radius compared to the target particle spacing (i.e. kernel radius / target spacing).

pub fn set_kernel_radius(&mut self, kernel_radius: f64)[src]

\brief Sets the absolute kernel radius.

Sets the absolute kernel radius compared to the target particle spacing (i.e. relative kernel radius * target spacing). Once this function is called, hash grid and density should be updated using updateHashGrid() and update_densities).

pub fn kernel_radius(&self) -> f64[src]

Returns the kernel radius in meters unit.

pub fn sum_of_kernel_nearby(&self, origin: &Vector3D) -> f64[src]

Returns sum of kernel function evaluation for each nearby particle.

pub fn interpolate_scalar(&self, origin: &Vector3D, values: &Vec<f64>) -> f64[src]

\brief Returns interpolated value at given origin point.

Returns interpolated scalar data from the given position using standard SPH weighted average. The data array should match the particle layout. For example, density or pressure arrays can be used.

\warning You must update the neighbor searcher (SphSystemData3::build_neighbor_searcher) before calling this function.

pub fn interpolate_vec(
    &self,
    origin: &Vector3D,
    values: &Vec<Vector3D>
) -> Vector3D
[src]

\brief Returns interpolated vector value at given origin point.

Returns interpolated vector data from the given position using standard SPH weighted average. The data array should match the particle layout. For example, velocity or acceleration arrays can be used.

\warning You must update the neighbor searcher (SphSystemData3::build_neighbor_searcher) before calling this function.

pub fn gradient_at(&self, i: usize, values: &Vec<f64>) -> Vector3D[src]

Returns the gradient of the given values at i-th particle.

\warning You must update the neighbor lists (SphSystemData3::build_neighbor_lists) before calling this function.

pub fn laplacian_at_scalar(&self, i: usize, values: &Vec<f64>) -> f64[src]

Returns the laplacian of the given values at i-th particle.

\warning You must update the neighbor lists (SphSystemData3::build_neighbor_lists) before calling this function.

pub fn laplacian_at_vec(&self, i: usize, values: &Vec<Vector3D>) -> Vector3D[src]

Returns the laplacian of the given values at i-th particle.

\warning You must update the neighbor lists (SphSystemData3::build_neighbor_lists) before calling this function.

pub fn build_neighbor_searcher(&mut self)[src]

Builds neighbor searcher with kernel radius.

pub fn build_neighbor_lists(&mut self)[src]

Builds neighbor lists with kernel radius.

impl SphSystemData3[src]

pub fn radius(&self) -> f64[src]

Returns the radius of the particles.

pub fn mass(&self) -> f64[src]

Returns the mass of the particles.

pub fn positions(&self) -> &Vec<Vector3D>[src]

Returns the position array (immutable).

pub fn positions_mut(&mut self) -> &mut Vec<Vector3D>[src]

Returns the position array (mutable).

pub fn velocities(&self) -> &Vec<Vector3D>[src]

Returns the velocity array (immutable).

pub fn velocities_mut(&mut self) -> &mut Vec<Vector3D>[src]

Returns the velocity array (mutable).

pub fn forces(&self) -> &Vec<Vector3D>[src]

Returns the force array (immutable).

pub fn forces_mut(&mut self) -> &mut Vec<Vector3D>[src]

Returns the force array (mutable).

pub fn number_of_particles(&self) -> usize[src]

Returns the number of particles.

pub fn neighbor_lists(&self) -> &Vec<Vec<usize>>[src]

\brief Returns neighbor lists.

This function returns neighbor lists which is available after calling PointParallelHashGridSearcher2::build_neighbor_lists. Each list stores indices of the neighbors.

\return Neighbor lists.

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

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

Initializes a with the given initializer. Read more

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

Dereferences the given pointer. Read more

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

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

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

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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

pub fn vzip(self) -> V