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]
impl SphSolver2
[src]pub fn new_default() -> SphSolver2
[src]
pub fn new_default() -> SphSolver2
[src]Constructs a solver with empty particle set.
impl SphSolver2
[src]
impl SphSolver2
[src]pub fn drag_coefficient(&self) -> f64
[src]
pub fn drag_coefficient(&self) -> f64
[src]Returns the drag coefficient.
pub fn set_drag_coefficient(&mut self, new_drag_coefficient: f64)
[src]
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]
pub fn restitution_coefficient(&self) -> f64
[src]Sets the restitution coefficient.
pub fn set_restitution_coefficient(&mut self, new_restitution_coefficient: f64)
[src]
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 set_gravity(&mut self, new_gravity: &Vector2D)
[src]
pub fn set_gravity(&mut self, new_gravity: &Vector2D)
[src]Sets the gravity.
pub fn particle_system_data(&self) -> &SphSystemData2Ptr
[src]
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]
pub fn collider(&self) -> &Option<Collider2Ptr>
[src]Returns the collider.
pub fn set_collider(&mut self, new_collider: &Collider2Ptr)
[src]
pub fn set_collider(&mut self, new_collider: &Collider2Ptr)
[src]Sets the collider.
pub fn emitter(&self) -> &Option<ParticleEmitter2Ptr>
[src]
pub fn emitter(&self) -> &Option<ParticleEmitter2Ptr>
[src]Returns the emitter.
pub fn set_emitter(&mut self, new_emitter: &ParticleEmitter2Ptr)
[src]
pub fn set_emitter(&mut self, new_emitter: &ParticleEmitter2Ptr)
[src]Sets the emitter.
pub fn wind(&self) -> &VectorField2Ptr
[src]
pub fn wind(&self) -> &VectorField2Ptr
[src]Returns the wind field.
pub fn set_wind(&mut self, new_wind: &VectorField2Ptr)
[src]
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]
impl SphSolver2
[src]pub fn eos_exponent(&self) -> f64
[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]
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]
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]
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]
pub fn viscosity_coefficient(&self) -> f64
[src]Returns the viscosity coefficient.
pub fn set_viscosity_coefficient(&mut self, new_viscosity_coefficient: f64)
[src]
pub fn set_viscosity_coefficient(&mut self, new_viscosity_coefficient: f64)
[src]Sets the viscosity coefficient.
pub fn pseudo_viscosity_coefficient(&self) -> f64
[src]
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]
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]
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]
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]
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]
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]
impl Animation for SphSolver2
[src]impl PhysicsAnimation for SphSolver2
[src]
impl PhysicsAnimation for SphSolver2
[src]fn number_of_sub_time_steps(&self, time_interval_in_seconds: f64) -> usize
[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]
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]
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]
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]
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]
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]
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]
fn advance_single_frame(&mut self)
[src]Advances a single frame.
fn current_frame(&self) -> Frame
[src]
fn current_frame(&self) -> Frame
[src]Returns current frame. Read more
fn set_current_frame(&mut self, frame: &Frame)
[src]
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]
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
impl RefUnwindSafe for SphSolver2
impl Send for SphSolver2
impl Sync for SphSolver2
impl Unpin for SphSolver2
impl UnwindSafe for SphSolver2
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>,