Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes

OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy > Class Template Reference

#include <mbd_sequential_truncating_collision_resolver.h>

Inheritance diagram for OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >:
OpenTissue::mbd::CollisionResolverInterface< mbd_types > collision_law_policy OpenTissue::mbd::StepperInterface< mbd_types >

List of all members.

Classes

class  constraint_traits
struct  ContactPointComparision
class  edge_traits
class  node_traits

Public Types

typedef
mbd_types::math_policy::index_type 
size_type
typedef
mbd_types::math_policy::real_type 
real_type
typedef
mbd_types::math_policy::vector3_type 
vector3_type
typedef
mbd_types::math_policy::value_traits 
value_traits
typedef mbd_types::group_type group_type
typedef mbd_types::body_type body_type
typedef mbd_types::edge_type edge_type
typedef mbd_types::contact_type contact_type
typedef mbd_types::material_type material_type
typedef std::vector
< contact_type * > 
contact_ptr_heap

Public Member Functions

 SequentialTruncatingCollisionResolver ()
virtual ~SequentialTruncatingCollisionResolver ()
real_type const & truncation_fraction () const
void set_truncation_fraction (real_type const &value)
size_type const & truncation_limit () const
size_typetruncation_limit ()
void resolve_collisions (group_type &group)

Protected Member Functions

template<typename iterator >
void init_heap (iterator const &cbegin, iterator const &cend, contact_ptr_heap &S)
void update_heap (contact_ptr_heap &S)
contact_typeminimum (contact_ptr_heap &S)
void update_all_dependent_contacts (contact_type *cp)
void update (contact_type *cp)

Protected Attributes

size_type m_resolve_limit
 The maximum number of times a contact can be resolved before the impulse is truncated (default value is 20).
real_type m_truncation_fraction
 The fraction of largest initial approach velocity, which will result in a truncation impulse to be used (default value is 1000).

Detailed Description

template<typename mbd_types, typename collision_law_policy>
class OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >

A Sequential Collision Resolver. This collision resovler can be used with any collision law by specifying the collision law as a template policy.

The algorithm iterates over all contacs in the specified group, in an increasing order determined by their relative contact velocity in the normal direction.

In some cases such a scheme may fail, entering a inifinite loop, or even computational death due to very slow convergence. To alleviate these problems the algorithm supports truncating impulses. This means that if certain criteria are fulfilled then the normal restitution is set to zero before computing an impulse.

If one is too aggressive in setting up the truncation criteria's then it can have the effect of low restitution values are seen as zero-restitution. In our experience the default settings tend to damp the restituion coefficient towards zero when in the range 0 -.5, above .5 does not seem to be visually noticable.

Also large stacks of objects, like 20 objects placed un top of each other seem to make truncation kick in regardless of initial velocities and the values of coefficient of restitution.


Member Typedef Documentation

template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::body_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::body_type
template<typename mbd_types, typename collision_law_policy>
typedef std::vector<contact_type*> OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::contact_ptr_heap
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::contact_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::contact_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::edge_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::edge_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::group_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::group_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::material_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::material_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::math_policy::real_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::real_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::math_policy::index_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::size_type
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::math_policy::value_traits OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::value_traits
template<typename mbd_types, typename collision_law_policy>
typedef mbd_types::math_policy::vector3_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::vector3_type

Constructor & Destructor Documentation

template<typename mbd_types, typename collision_law_policy>
OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::SequentialTruncatingCollisionResolver (  )  [inline]
template<typename mbd_types, typename collision_law_policy>
virtual OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::~SequentialTruncatingCollisionResolver (  )  [inline, virtual]

Member Function Documentation

template<typename mbd_types, typename collision_law_policy>
template<typename iterator >
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::init_heap ( iterator const &  cbegin,
iterator const &  cend,
contact_ptr_heap S 
) [inline, protected]

Initialize Heap

Parameters:
cbegin The position of the first contact in a range.
cend The position one past the last contact in a range.
S The heap.
template<typename mbd_types, typename collision_law_policy>
contact_type* OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::minimum ( contact_ptr_heap S  )  [inline, protected]

Get Minimum element from Heap.

Parameters:
S The heap.
Returns:
A pointer to the contact point with smallest contact normal velocity.
template<typename mbd_types, typename collision_law_policy>
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::resolve_collisions ( group_type group  )  [inline]

Resolve Collisions

Parameters:
group The group on which to resolve collisions.
template<typename mbd_types, typename collision_law_policy>
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::set_truncation_fraction ( real_type const &  value  )  [inline]

Set Truncation Fraction.

Parameters:
value A positive value indicating the new truncation fraction. That is the fraction of the initial largest approach velocity, which yields the velocity threshold for when a collision should be truncated. That is when approach velocity of a collision is less than the threshold the collision is truncated.
template<typename mbd_types, typename collision_law_policy>
real_type const& OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::truncation_fraction (  )  const [inline]
template<typename mbd_types, typename collision_law_policy>
size_type& OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::truncation_limit (  )  [inline]
template<typename mbd_types, typename collision_law_policy>
size_type const& OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::truncation_limit (  )  const [inline]
template<typename mbd_types, typename collision_law_policy>
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::update ( contact_type cp  )  [inline, protected]

Update Contact Point.

Parameters:
cp A pointer to the contact that should be updated. That is its relative normal contact velocity is re-computed.
template<typename mbd_types, typename collision_law_policy>
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::update_all_dependent_contacts ( contact_type cp  )  [inline, protected]

Update All Dependent Contacts. This method updates all contacts that shares a body with the specified contact. The contact graph data structure is used to quickly identify the contacts that needs to be updated.

Parameters:
cp The contact point indicating the bodies that are shared.
template<typename mbd_types, typename collision_law_policy>
void OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::update_heap ( contact_ptr_heap S  )  [inline, protected]

Update Heap.

Parameters:
S The heap that should be updated.

Member Data Documentation

template<typename mbd_types, typename collision_law_policy>
size_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::m_resolve_limit [protected]

The maximum number of times a contact can be resolved before the impulse is truncated (default value is 20).

template<typename mbd_types, typename collision_law_policy>
real_type OpenTissue::mbd::SequentialTruncatingCollisionResolver< mbd_types, collision_law_policy >::m_truncation_fraction [protected]

The fraction of largest initial approach velocity, which will result in a truncation impulse to be used (default value is 1000).


The documentation for this class was generated from the following file: