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,

source

pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync + 'static)>

Retrieves a reference to the user-defined user-data attached to this object.

source

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.

source

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.

source

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.

source

pub fn positions( &self ) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>

The position of this body in generalized coordinates.

source

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.

source

pub fn velocities( &self ) -> &Matrix<N, Dynamic, Const<1>, VecStorage<N, Dynamic, Const<1>>>

The velocity of this body in generalized coordinates.

source

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.

source

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.

source

pub fn set_young_modulus(&mut self, young_modulus: N)

Sets the young modulus of this deformable surface.

source

pub fn set_poisson_ratio(&mut self, poisson_ratio: N)

Sets the poisson ratio of this deformable surface.

source

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.

source

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).

source

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.

source

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.

source

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.

source

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,

source§

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> )

Update the dynamics property of this deformable surface.

source§

fn gravity_enabled(&self) -> bool

Whether this body is affected by gravity.
source§

fn enable_gravity(&mut self, enabled: bool)

Enable or disable gravity for this body.
source§

fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>

If this is a deformable body, returns its deformed positions.
source§

fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>

If this is a deformable body, returns a mutable reference to its deformed positions.
source§

fn update_kinematics(&mut self)

Updates the kinematics, e.g., positions and jacobians, of this body.
source§

fn clear_forces(&mut self)

Reset the timestep-specific dynamic information of this body.
source§

fn clear_update_flags(&mut self)

Clear all the update flags of this body.
source§

fn update_status(&self) -> BodyUpdateStatus

The flags tracking what modifications were applied to a body.
source§

fn apply_displacement(&mut self, disp: &[N])

Applies a generalized displacement to this body.
source§

fn status(&self) -> BodyStatus

The status of this body.
source§

fn set_status(&mut self, status: BodyStatus)

Set the status of this body.
source§

fn activation_status(&self) -> &ActivationStatus<N>

Information regarding activation and deactivation (sleeping) of this body.
source§

fn ndofs(&self) -> usize

The number of degrees of freedom of this body.
source§

fn generalized_acceleration( &self ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>

The generalized accelerations at each degree of freedom of this body.
source§

fn generalized_velocity( &self ) -> Matrix<N, Dynamic, Const<1>, SliceStorage<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>

The generalized velocities of this body.
source§

fn companion_id(&self) -> usize

The companion ID of this body.
source§

fn set_companion_id(&mut self, id: usize)

Set the companion ID of this body (may be reinitialized by nphysics).
source§

fn generalized_velocity_mut( &mut self ) -> Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>>

The mutable generalized velocities of this body.
source§

fn integrate(&mut self, parameters: &IntegrationParameters<N>)

Integrate the position of this body.
source§

fn activate_with_energy(&mut self, energy: N)

Force the activation of this body with the given level of energy.
source§

fn deactivate(&mut self)

Put this body to sleep.
source§

fn set_deactivation_threshold(&mut self, threshold: Option<N>)

Sets the energy bellow which this body is put to sleep. Read more
source§

fn num_parts(&self) -> usize

The number of parts of this body.
source§

fn part(&self, id: usize) -> Option<&(dyn BodyPart<N> + 'static)>

A reference to the specified body part.
source§

fn world_point_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> OPoint<N, Const<2>>

Transform the given point expressed in material coordinates to world-space.
source§

fn position_at_material_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> Isometry<N, Unit<Complex<N>>, 2>

Transform the given point expressed in material coordinates to world-space.
source§

fn material_point_at_world_point( &self, part: &(dyn BodyPart<N> + 'static), point: &OPoint<N, Const<2>> ) -> OPoint<N, Const<2>>

Transform the given point expressed in material coordinates to world-space.
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> )

Fills all the jacobians (and the jacobians multiplied by the inverse augmented mass matrix) for a constraint applying a force at the point center (relative to the body part’s center of mass) and the direction dir. Read more
source§

fn has_active_internal_constraints(&mut self) -> bool

Returns 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> )

Initializes the internal velocity constraints of a body.
source§

fn warmstart_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>> )

For warmstarting the solver, modifies the delta velocity applied by the internal constraints of this body.
source§

fn step_solve_internal_velocity_constraints( &mut self, _: &mut Matrix<N, Dynamic, Const<1>, SliceStorageMut<'_, N, Dynamic, Const<1>, Const<1>, Dynamic>> )

Execute one step for the iterative resolution of this body’s internal velocity constraints.
source§

fn step_solve_internal_position_constraints( &mut self, _: &IntegrationParameters<N> )

Execute one step for the iterative resolution of this body’s internal position constraints.
source§

fn velocity_at_point( &self, part_id: usize, point: &OPoint<N, Const<2>> ) -> Velocity2<N>

Gets the velocity of the given point of this body.
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 )

Apply a force at a given local point of a part of this body.
source§

fn apply_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool )

Apply a force at the center of mass of a part of this body.
source§

fn apply_local_force( &mut self, part_id: usize, force: &Force2<N>, force_type: ForceType, auto_wake_up: bool )

Apply a local force at the center of mass of a part of this body.
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 )

Apply a force at a given point of a part of this body.
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 )

Apply a local force at a given point of a part of this body.
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 )

Apply a local force at a given local point of a part of this body.
source§

fn is_ground(&self) -> bool

Returns true if this body is the ground.
source§

fn update_activation_status(&mut self)

Update whether this body needs to be waken up after a user-interaction.
source§

fn advance(&mut self, _time_ratio: N)

source§

fn validate_advancement(&mut self)

source§

fn clamp_advancement(&mut self)

source§

fn part_motion( &self, _part_id: usize, _time_origin: N ) -> Option<BodyPartMotion<N>>

source§

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> )

Add the given inertia to the local inertia of this body part.
source§

fn status_dependent_ndofs(&self) -> usize

The number of degrees of freedom (DOF) of this body, taking its status into account. Read more
source§

fn status_dependent_body_part_velocity( &self, part: &(dyn BodyPart<N> + 'static) ) -> Velocity2<N>

The velocity of the specified body part, taking this body status into account. Read more
source§

fn is_active(&self) -> bool

Check if this body is active.
source§

fn is_dynamic(&self) -> bool

Whether or not the status of this body is dynamic.
source§

fn is_kinematic(&self) -> bool

Whether or not the status of this body is kinematic.
source§

fn is_static(&self) -> bool

Whether or not the status of this body is static.
source§

fn activate(&mut self)

Force the activation of this body.

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Send + Sync, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Component for Twhere T: Send + Sync + 'static,