Struct salva3d::object::Fluid[][src]

pub struct Fluid {
    pub nonpressure_forces: Vec<Box<dyn NonPressureForce>>,
    pub positions: Vec<Point<Real>>,
    pub velocities: Vec<Vector<Real>>,
    pub accelerations: Vec<Vector<Real>>,
    pub volumes: Vec<Real>,
    pub density0: Real,
    // some fields omitted
}
Expand description

A fluid object.

A fluid object is composed of movable particles with additional properties like viscosity.

Fields

nonpressure_forces: Vec<Box<dyn NonPressureForce>>

Nonpressure forces this fluid is subject to.

positions: Vec<Point<Real>>

The world-space position of the fluid particles.

velocities: Vec<Vector<Real>>

The velocities of the fluid particles.

accelerations: Vec<Vector<Real>>

The accelerations of the fluid particles.

volumes: Vec<Real>

The volume of the fluid particles.

density0: Real

The rest density of this fluid.

Implementations

Initializes a new fluid object with the given particle positions, particle radius, density, and viscosity.

The particle radius should be the same as the radius used to initialize the liquid world.

Mark the given particle to be deleted at the next timestep.

The number of particles that will be deleted at the next timestep.

The mask of particles that will be deleted at the next timestep.

The radius of this fluid’s particles.

The default volume given to each of this fluid’s particles.

Add a set of particles to this fluid.

If velocities is None the velocity of each particle will be initialized at zero. If it is not None, then it must be a slice with the same length than positions.

Sorts all the particles of this fluids according to morton order.

Apply the given transformation to each particle of this fluid.

The number of particles on this fluid.

The mass of the i-th particle of this fluid.

The inverse mass of the i-th particle of this fluid.

Returns 0 if the i-th particle has a zero mass.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.