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]
impl SphSystemData3
[src]pub fn new_default() -> SphSystemData3
[src]
pub fn new_default() -> SphSystemData3
[src]Constructs empty SPH system.
pub fn new(number_of_particles: usize) -> SphSystemData3
[src]
pub fn new(number_of_particles: usize) -> SphSystemData3
[src]Constructs SPH system data with given number of particles.
impl SphSystemData3
[src]
impl SphSystemData3
[src]pub fn set_radius(&mut self, new_radius: f64)
[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]
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_mut(&mut self) -> &mut Vec<f64>
[src]
pub fn densities_mut(&mut self) -> &mut Vec<f64>
[src]Returns the density array accessor (mutable).
pub fn pressures_mut(&mut self) -> &mut Vec<f64>
[src]
pub fn pressures_mut(&mut self) -> &mut Vec<f64>
[src]Returns the pressure array accessor (mutable).
pub fn update_densities(&mut self)
[src]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
pub fn build_neighbor_searcher(&mut self)
[src]Builds neighbor searcher with kernel radius.
pub fn build_neighbor_lists(&mut self)
[src]
pub fn build_neighbor_lists(&mut self)
[src]Builds neighbor lists with kernel radius.
impl SphSystemData3
[src]
impl SphSystemData3
[src]pub fn positions_mut(&mut self) -> &mut Vec<Vector3D>
[src]
pub fn positions_mut(&mut self) -> &mut Vec<Vector3D>
[src]Returns the position array (mutable).
pub fn velocities(&self) -> &Vec<Vector3D>
[src]
pub fn velocities(&self) -> &Vec<Vector3D>
[src]Returns the velocity array (immutable).
pub fn velocities_mut(&mut self) -> &mut Vec<Vector3D>
[src]
pub fn velocities_mut(&mut self) -> &mut Vec<Vector3D>
[src]Returns the velocity array (mutable).
pub fn forces_mut(&mut self) -> &mut Vec<Vector3D>
[src]
pub fn forces_mut(&mut self) -> &mut Vec<Vector3D>
[src]Returns the force array (mutable).
pub fn number_of_particles(&self) -> usize
[src]
pub fn number_of_particles(&self) -> usize
[src]Returns the number of particles.
pub fn neighbor_lists(&self) -> &Vec<Vec<usize>>
[src]
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
impl RefUnwindSafe for SphSystemData3
impl Send for SphSystemData3
impl Sync for SphSystemData3
impl Unpin for SphSystemData3
impl UnwindSafe for SphSystemData3
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,