pub trait PressureSolver {
    // Required methods
    fn init_with_fluids(&mut self, fluids: &[Fluid]);
    fn init_with_boundaries(&mut self, boundaries: &[Boundary]);
    fn predict_advection(
        &mut self,
        timestep: &TimestepManager,
        kernel_radius: Real,
        contact_manager: &ContactManager,
        gravity: &Vector<Real>,
        fluids: &mut [Fluid],
        boundaries: &[Boundary]
    );
    fn evaluate_kernels(
        &mut self,
        kernel_radius: Real,
        contact_manager: &mut ContactManager,
        fluids: &[Fluid],
        boundaries: &[Boundary]
    );
    fn compute_densities(
        &mut self,
        contact_manager: &ContactManager,
        fluids: &[Fluid],
        boundaries: &mut [Boundary]
    );
    fn step(
        &mut self,
        counters: &mut Counters,
        timestep: &mut TimestepManager,
        gravity: &Vector<Real>,
        contact_manager: &mut ContactManager,
        kernel_radius: Real,
        fluids: &mut [Fluid],
        boundaries: &[Boundary]
    );
}
Expand description

Trait implemented by pressure solvers.

Required Methods§

source

fn init_with_fluids(&mut self, fluids: &[Fluid])

Initialize this solver with the given fluids.

source

fn init_with_boundaries(&mut self, boundaries: &[Boundary])

Initialize this solver with the given boundaries.

source

fn predict_advection( &mut self, timestep: &TimestepManager, kernel_radius: Real, contact_manager: &ContactManager, gravity: &Vector<Real>, fluids: &mut [Fluid], boundaries: &[Boundary] )

Predicts advection with the given gravity.

source

fn evaluate_kernels( &mut self, kernel_radius: Real, contact_manager: &mut ContactManager, fluids: &[Fluid], boundaries: &[Boundary] )

Evaluate the SPH kernels for all the contacts in contact_manager.

source

fn compute_densities( &mut self, contact_manager: &ContactManager, fluids: &[Fluid], boundaries: &mut [Boundary] )

Compute the densities of all the boundary and fluid particles.

source

fn step( &mut self, counters: &mut Counters, timestep: &mut TimestepManager, gravity: &Vector<Real>, contact_manager: &mut ContactManager, kernel_radius: Real, fluids: &mut [Fluid], boundaries: &[Boundary] )

Solves pressure and non-pressure force for the given fluids and boundaries.

Both self.init_with_fluids and self.init_with_boundaries must be called before this method.

Implementors§

source§

impl<KernelDensity, KernelGradient> PressureSolver for DFSPHSolver<KernelDensity, KernelGradient>
where KernelDensity: Kernel, KernelGradient: Kernel,

source§

impl<KernelDensity, KernelGradient> PressureSolver for IISPHSolver<KernelDensity, KernelGradient>
where KernelDensity: Kernel, KernelGradient: Kernel,