Struct oxygengine_physics_2d::prelude::FEMSurface
source · pub struct FEMSurface<N>where
N: RealField + Copy,{ /* private fields */ }
Expand description
A deformable surface using FEM to simulate linear elasticity.
The surface is described by a set of triangle elements. This implements an isoparametric approach where the interpolations are linear.
Implementations§
source§impl<N> FEMSurface<N>where
N: RealField + Copy,
impl<N> FEMSurface<N>where N: RealField + Copy,
sourcepub fn user_data(&self) -> Option<&(dyn Any + Send + Sync + 'static)>
pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync + 'static)>
Retrieves a reference to the user-defined user-data attached to this object.
sourcepub fn user_data_mut(
&mut self
) -> Option<&mut (dyn Any + Send + Sync + 'static)>
pub fn user_data_mut( &mut self ) -> Option<&mut (dyn Any + Send + Sync + 'static)>
Retrieves a mutable reference to the user-defined user-data attached to this object.
sourcepub fn set_user_data(
&mut self,
data: Option<Box<dyn Any + Send + Sync, Global>>
) -> Option<Box<dyn Any + Send + Sync, Global>>
pub fn set_user_data( &mut self, data: Option<Box<dyn Any + Send + Sync, Global>> ) -> Option<Box<dyn Any + Send + Sync, Global>>
Sets the user-defined data attached to this object.
sourcepub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync, Global>>
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync, Global>>
Replace by None
the user-defined data attached to this object and returns the old value.
sourcepub fn positions(
&self
) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
pub fn positions( &self ) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
The position of this body in generalized coordinates.
sourcepub fn positions_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
pub fn positions_mut( &mut self ) -> &mut Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
The position of this body in generalized coordinates.
sourcepub fn velocities(
&self
) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
pub fn velocities( &self ) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
The velocity of this body in generalized coordinates.
sourcepub fn velocities_mut(
&mut self
) -> &mut Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
pub fn velocities_mut( &mut self ) -> &mut Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>
The mutable velocity of this body in generalized coordinates.
sourcepub fn set_plasticity(&mut self, strain_threshold: N, creep: N, max_force: N)
pub fn set_plasticity(&mut self, strain_threshold: N, creep: N, max_force: N)
Sets the plastic properties of this deformable surface.
Note that large plasticity creep coefficient can yield to significant instability.
sourcepub fn set_young_modulus(&mut self, young_modulus: N)
pub fn set_young_modulus(&mut self, young_modulus: N)
Sets the young modulus of this deformable surface.
sourcepub fn set_poisson_ratio(&mut self, poisson_ratio: N)
pub fn set_poisson_ratio(&mut self, poisson_ratio: N)
Sets the poisson ratio of this deformable surface.
sourcepub fn boundary(&self) -> Vec<(OPoint<usize, Const<2>>, usize), Global>
pub fn boundary(&self) -> Vec<(OPoint<usize, Const<2>>, usize), Global>
Returns the triangles at the boundary of this surface.
Each element of the returned Vec
is a tuple containing the 3 indices of the triangle
vertices, and the index of the corresponding triangle element.
sourcepub fn boundary_polyline(
&self
) -> (Polyline<N>, Vec<usize, Global>, Vec<usize, Global>)
pub fn boundary_polyline( &self ) -> (Polyline<N>, Vec<usize, Global>, Vec<usize, Global>)
Returns a triangle mesh at the boundary of this surface as well as a mapping between the mesh vertices and this surface degrees of freedom and the mapping between the mesh triangles and this surface body parts (the triangle elements).
The output is (triangle mesh, deformation indices, element to body part map).
sourcepub fn boundary_collider_desc(&mut self) -> DeformableColliderDesc<N>
pub fn boundary_collider_desc(&mut self) -> DeformableColliderDesc<N>
Computes the DeformableColliderDesc
that can generate a collider covering the boundary polyline of this FEM surface.
As a side-effect, this will rearrange the degrees-of-freedom (DOF) of this FEM surface so that all the DOFs linked to the boundary collider are located at the beginning of the array of DOFs of this surface.
sourcepub fn renumber_dofs(&mut self, deformation_indices: &[usize])
pub fn renumber_dofs(&mut self, deformation_indices: &[usize])
Renumber degrees of freedom so that the deformation_indices[i]
-th DOF becomes the i
-th one.
sourcepub fn set_node_kinematic(&mut self, i: usize, is_kinematic: bool)
pub fn set_node_kinematic(&mut self, i: usize, is_kinematic: bool)
Restrict the specified node acceleration to always be zero so it can be controlled manually by the user at the velocity level.
sourcepub fn clear_kinematic_nodes(&mut self)
pub fn clear_kinematic_nodes(&mut self)
Mark all nodes as non-kinematic.
Trait Implementations§
source§impl<N> Body<N> for FEMSurface<N>where
N: RealField + Copy,
impl<N> Body<N> for FEMSurface<N>where N: RealField + Copy,
source§fn update_dynamics(&mut self, dt: N)
fn update_dynamics(&mut self, dt: N)
Update the dynamics property of this deformable surface.
source§fn update_acceleration(
&mut self,
gravity: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
parameters: &IntegrationParameters<N>
)
fn update_acceleration( &mut self, gravity: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, parameters: &IntegrationParameters<N> )
Update the dynamics property of this deformable surface.
source§fn gravity_enabled(&self) -> bool
fn gravity_enabled(&self) -> bool
source§fn enable_gravity(&mut self, enabled: bool)
fn enable_gravity(&mut self, enabled: bool)
source§fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
source§fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
source§fn update_kinematics(&mut self)
fn update_kinematics(&mut self)
source§fn clear_forces(&mut self)
fn clear_forces(&mut self)
source§fn clear_update_flags(&mut self)
fn clear_update_flags(&mut self)
source§fn update_status(&self) -> BodyUpdateStatus
fn update_status(&self) -> BodyUpdateStatus
source§fn apply_displacement(&mut self, disp: &[N])
fn apply_displacement(&mut self, disp: &[N])
source§fn status(&self) -> BodyStatus
fn status(&self) -> BodyStatus
source§fn set_status(&mut self, status: BodyStatus)
fn set_status(&mut self, status: BodyStatus)
source§fn activation_status(&self) -> &ActivationStatus<N>
fn activation_status(&self) -> &ActivationStatus<N>
source§fn generalized_acceleration(
&self
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_acceleration( &self ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
source§fn generalized_velocity(
&self
) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity( &self ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
source§fn companion_id(&self) -> usize
fn companion_id(&self) -> usize
source§fn set_companion_id(&mut self, id: usize)
fn set_companion_id(&mut self, id: usize)
source§fn generalized_velocity_mut(
&mut self
) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
fn generalized_velocity_mut( &mut self ) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
source§fn integrate(&mut self, parameters: &IntegrationParameters<N>)
fn integrate(&mut self, parameters: &IntegrationParameters<N>)
source§fn activate_with_energy(&mut self, energy: N)
fn activate_with_energy(&mut self, energy: N)
source§fn deactivate(&mut self)
fn deactivate(&mut self)
source§fn set_deactivation_threshold(&mut self, threshold: Option<N>)
fn set_deactivation_threshold(&mut self, threshold: Option<N>)
source§fn part(&self, id: usize) -> Option<&(dyn BodyPart<N> + 'static)>
fn part(&self, id: usize) -> Option<&(dyn BodyPart<N> + 'static)>
source§fn world_point_at_material_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>
) -> OPoint<N, Const<2>>
fn world_point_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> OPoint<N, Const<2>>
source§fn position_at_material_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>
) -> Isometry<N, Unit<Complex<N>>, 2>
fn position_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> Isometry<N, Unit<Complex<N>>, 2>
source§fn material_point_at_world_point(
&self,
part: &(dyn BodyPart<N> + 'static),
point: &OPoint<N, Const<2>>
) -> OPoint<N, Const<2>>
fn material_point_at_world_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> OPoint<N, Const<2>>
source§fn fill_constraint_geometry(
&self,
part: &(dyn BodyPart<N> + 'static),
_: usize,
center: &OPoint<N, Const<2>>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>,
out_vel: Option<&mut N>
)
fn fill_constraint_geometry( &self, part: &(dyn BodyPart<N> + 'static), _: usize, center: &OPoint<N, Const<2>>, force_dir: &ForceDirection<N>, j_id: usize, wj_id: usize, jacobians: &mut [N], inv_r: &mut N, ext_vels: Option<&Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>>, out_vel: Option<&mut N> )
center
(relative to the body part’s center of mass) and
the direction dir
. Read moresource§fn has_active_internal_constraints(&mut self) -> bool
fn has_active_internal_constraints(&mut self) -> bool
true
if this bodies contains internal constraints that need to be solved.source§fn setup_internal_velocity_constraints(
&mut self,
_: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>,
_: &IntegrationParameters<N>
)
fn setup_internal_velocity_constraints( &mut self, _: &Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>, _: &IntegrationParameters<N> )
source§fn warmstart_internal_velocity_constraints(
&mut self,
_: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
)
fn warmstart_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>> )
source§fn step_solve_internal_velocity_constraints(
&mut self,
_: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>
)
fn step_solve_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>> )
source§fn step_solve_internal_position_constraints(
&mut self,
_: &IntegrationParameters<N>
)
fn step_solve_internal_position_constraints( &mut self, _: &IntegrationParameters<N> )
source§fn velocity_at_point(
&self,
part_id: usize,
point: &OPoint<N, Const<2>>
) -> Velocity2<N>
fn velocity_at_point( &self, part_id: usize, point: &OPoint<N, Const<2>> ) -> Velocity2<N>
source§fn apply_force_at_local_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_force_at_local_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool )
source§fn apply_force(
&mut self,
part_id: usize,
force: &Force2<N>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool )
source§fn apply_local_force(
&mut self,
part_id: usize,
force: &Force2<N>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_local_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool )
source§fn apply_force_at_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_force_at_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool )
source§fn apply_local_force_at_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_local_force_at_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool )
source§fn apply_local_force_at_local_point(
&mut self,
part_id: usize,
force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>,
point: &OPoint<N, Const<2>>,
force_type: ForceType,
auto_wake_up: bool
)
fn apply_local_force_at_local_point( &mut self, part_id: usize, force: &Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>>, force_type: ForceType, auto_wake_up: bool )
source§fn update_activation_status(&mut self)
fn update_activation_status(&mut self)
fn advance(&mut self, _time_ratio: N)
fn validate_advancement(&mut self)
fn clamp_advancement(&mut self)
fn part_motion( &self, _part_id: usize, _time_origin: N ) -> Option<BodyPartMotion<N>>
fn step_started(&mut self)
source§fn add_local_inertia_and_com(
&mut self,
_part_index: usize,
_com: OPoint<N, Const<2>>,
_inertia: Inertia2<N>
)
fn add_local_inertia_and_com( &mut self, _part_index: usize, _com: OPoint<N, Const<2>>, _inertia: Inertia2<N> )
source§fn status_dependent_ndofs(&self) -> usize
fn status_dependent_ndofs(&self) -> usize
source§fn status_dependent_body_part_velocity(
&self,
part: &(dyn BodyPart<N> + 'static)
) -> Velocity2<N>
fn status_dependent_body_part_velocity( &self, part: &(dyn BodyPart<N> + 'static) ) -> Velocity2<N>
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§fn is_kinematic(&self) -> bool
fn is_kinematic(&self) -> bool
Auto Trait Implementations§
impl<N> !RefUnwindSafe for FEMSurface<N>
impl<N> Send for FEMSurface<N>
impl<N> Sync for FEMSurface<N>
impl<N> Unpin for FEMSurface<N>where N: Unpin,
impl<N> !UnwindSafe for FEMSurface<N>
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§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.