pub struct Boundary {
pub positions: Vec<Point<Real>>,
pub velocities: Vec<Vector<Real>>,
pub volumes: Vec<Real>,
pub forces: Option<RwLock<Vec<Vector<Real>>>>,
}
Expand description
A boundary object.
A boundary object is composed of static particles, or of particles coupled with non-fluid bodies.
Fields§
§positions: Vec<Point<Real>>
The world-space position of the boundary particles.
velocities: Vec<Vector<Real>>
The artificial velocities of each boundary particle.
volumes: Vec<Real>
The volume computed for each boundary particle.
forces: Option<RwLock<Vec<Vector<Real>>>>
The forces applied to each particle of this boundary object.
If this is set to None
(which is the default), the boundary won’t receive any
force for fluids.
Implementations§
source§impl Boundary
impl Boundary
sourcepub fn new(particle_positions: Vec<Point<Real>>) -> Self
pub fn new(particle_positions: Vec<Point<Real>>) -> Self
Initialize a boundary object with the given particles.
sourcepub fn num_particles(&self) -> usize
pub fn num_particles(&self) -> usize
The number of particles of this boundary object.
sourcepub fn transform_by(&mut self, pose: &Isometry<Real>)
pub fn transform_by(&mut self, pose: &Isometry<Real>)
Transforms all the particle positions of this boundary by the given isometry.
sourcepub fn apply_force(&self, i: usize, f: Vector<Real>)
pub fn apply_force(&self, i: usize, f: Vector<Real>)
Apply a force f
to the i
-th particle of this boundary object.
This call relies on thread-safe interior mutability.
sourcepub fn clear_forces(&mut self, resize_buffer: bool)
pub fn clear_forces(&mut self, resize_buffer: bool)
Clears all the forces applied to this boundary object’s particles.
Auto Trait Implementations§
impl RefUnwindSafe for Boundary
impl Send for Boundary
impl Sync for Boundary
impl Unpin for Boundary
impl UnwindSafe for Boundary
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.