Struct vox_geometry_rust::sph_solver2::SphSolver2[][src]

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

2-D SPH solver.

This class implements 2-D SPH solver. The main pressure solver is based on equation-of-state (EOS).

\see M{"u}ller et al., Particle-based fluid simulation for interactive applications, SCA 2003. \see M. Becker and M. Teschner, Weakly compressible SPH for free surface flows, SCA 2007. \see Adams and Wicke, Meshless approximation methods and applications in physics based modeling and animation, Eurographics tutorials 2009.

Implementations

impl SphSolver2[src]

pub fn new_default() -> SphSolver2[src]

Constructs a solver with empty particle set.

pub fn new(
    target_density: f64,
    target_spacing: f64,
    relative_kernel_radius: f64
) -> SphSolver2
[src]

Constructs a solver with target density, spacing, and relative kernel radius.

impl SphSolver2[src]

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

Returns the drag coefficient.

pub fn set_drag_coefficient(&mut self, new_drag_coefficient: f64)[src]

\brief Sets the drag coefficient.

The drag coefficient controls the amount of air-drag. The coefficient should be a positive number and 0 means no drag force.

  • parameter: new_drag_coefficient The new drag coefficient.

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

Sets the restitution coefficient.

pub fn set_restitution_coefficient(&mut self, new_restitution_coefficient: f64)[src]

\brief Sets the restitution coefficient.

The restitution coefficient controls the bouncy-ness of a particle when it hits a collider surface. The range of the coefficient should be 0 to 1 – 0 means no bounce back and 1 means perfect reflection.

  • parameter: new_restitution_coefficient The new restitution coefficient.

pub fn gravity(&self) -> &Vector2D[src]

Returns the gravity.

pub fn set_gravity(&mut self, new_gravity: &Vector2D)[src]

Sets the gravity.

pub fn particle_system_data(&self) -> &SphSystemData2Ptr[src]

\brief Returns the particle system data.

This function returns the particle system data. The data is created when this solver is constructed and also owned by the solver.

\return The particle system data.

pub fn collider(&self) -> &Option<Collider2Ptr>[src]

Returns the collider.

pub fn set_collider(&mut self, new_collider: &Collider2Ptr)[src]

Sets the collider.

pub fn emitter(&self) -> &Option<ParticleEmitter2Ptr>[src]

Returns the emitter.

pub fn set_emitter(&mut self, new_emitter: &ParticleEmitter2Ptr)[src]

Sets the emitter.

pub fn wind(&self) -> &VectorField2Ptr[src]

Returns the wind field.

pub fn set_wind(&mut self, new_wind: &VectorField2Ptr)[src]

\brief Sets the wind.

Wind can be applied to the particle system by setting a vector field to the solver.

  • parameter: new_wind The new wind.

impl SphSolver2[src]

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

Returns the exponent part of the equation-of-state.

pub fn set_eos_exponent(&mut self, new_eos_exponent: f64)[src]

\brief Sets the exponent part of the equation-of-state.

This function sets the exponent part of the equation-of-state. The value must be greater than 1.0, and smaller inputs will be clamped. Default is 7.

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

Returns the negative pressure scale.

pub fn set_negative_pressure_scale(&mut self, new_negative_pressure_scale: f64)[src]

\brief Sets the negative pressure scale.

This function sets the negative pressure scale. By setting the number between 0 and 1, the solver will scale the effect of negative pressure which can prevent the clumping of the particles near the surface. Input value outside 0 and 1 will be clamped within the range. Default is 0.

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

Returns the viscosity coefficient.

pub fn set_viscosity_coefficient(&mut self, new_viscosity_coefficient: f64)[src]

Sets the viscosity coefficient.

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

Returns the pseudo viscosity coefficient.

pub fn set_pseudo_viscosity_coefficient(
    &mut self,
    new_pseudo_viscosity_coefficient: f64
)
[src]

\brief Sets the pseudo viscosity coefficient.

This function sets the pseudo viscosity coefficient which applies additional pseudo-physical damping to the system. Default is 10.

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

Returns the speed of sound.

pub fn set_speed_of_sound(&mut self, new_speed_of_sound: f64)[src]

\brief Sets the speed of sound.

This function sets the speed of sound which affects the stiffness of the EOS and the time-step size. Higher value will make EOS stiffer and the time-step smaller. The input value must be higher than 0.0.

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

\brief Multiplier that scales the max allowed time-step.

This function returns the multiplier that scales the max allowed time-step. When the scale is 1.0, the time-step is bounded by the speed of sound and max acceleration.

pub fn set_time_step_limit_scale(&mut self, new_scale: f64)[src]

\brief Sets the multiplier that scales the max allowed time-step.

This function sets the multiplier that scales the max allowed time-step. When the scale is 1.0, the time-step is bounded by the speed of sound and max acceleration.

Trait Implementations

impl Animation for SphSolver2[src]

fn on_update(&mut self, frame: &Frame)[src]

The implementation of this function should update the animation state for given Frame instance frame. Read more

fn update(&mut self, frame: &Frame)[src]

Updates animation state for given frame. Read more

impl PhysicsAnimation for SphSolver2[src]

fn number_of_sub_time_steps(&self, time_interval_in_seconds: f64) -> usize[src]

Returns the number of sub-time-steps.

fn on_advance_time_step(&mut self, time_step_in_seconds: f64)[src]

Called when a single time-step should be advanced. Read more

fn on_initialize(&mut self)[src]

Called at frame 0 to initialize the physics state. Read more

fn view(&self) -> &PhysicsAnimationData[src]

fn view_mut(&mut self) -> &mut PhysicsAnimationData[src]

fn is_using_fixed_sub_time_steps(&self) -> bool[src]

Returns true if fixed sub-time stepping is used. Read more

fn set_is_using_fixed_sub_time_steps(&mut self, is_using: bool)[src]

Sets true if fixed sub-time stepping is used. Read more

fn number_of_fixed_sub_time_steps(&self) -> usize[src]

Returns the number of fixed sub-time steps. Read more

fn set_number_of_fixed_sub_time_steps(&mut self, number_of_steps: usize)[src]

Sets the number of fixed sub-time steps. Read more

fn advance_single_frame(&mut self)[src]

Advances a single frame.

fn current_frame(&self) -> Frame[src]

Returns current frame. Read more

fn set_current_frame(&mut self, frame: &Frame)[src]

Sets current frame cursor (but do not invoke update()). Read more

fn current_time_in_seconds(&self) -> f64[src]

Returns current time in seconds. Read more

fn on_update(&mut self, frame: &Frame)[src]

fn advance_time_step(&mut self, time_interval_in_seconds: f64)[src]

fn initialize(&mut self)[src]

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