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

OpenTissue::versatile::Simulator< versatile_types > Class Template Reference

#include <versatile_simulator.h>

List of all members.

Public Types

typedef
versatile_types::value_traits 
value_traits
typedef versatile_types::real_type real_type
typedef
versatile_types::vector3_type 
vector3_type
typedef
versatile_types::matrix3x3_type 
matrix3x3_type
typedef
OpenTissue::versatile::Mesh
< versatile_types > 
mesh_type
typedef std::list< mesh_type * > mesh_ptr_container
typedef
mesh_ptr_container::iterator 
mesh_ptr_iterator
typedef
boost::indirect_iterator
< mesh_ptr_iterator, mesh_type
mesh_iterator
typedef
OpenTissue::versatile::detail::collision_policy
< versatile_types > 
policy
typedef
OpenTissue::spatial_hashing::PointDataQuery
< typename policy::hash_grid,
policy
point_query_type
typedef policy::result_container contact_container
typedef contact_container::iterator contact_iterator
typedef
OpenTissue::geometry::Plane
< versatile_types > 
plane_type

Public Member Functions

void add (mesh_type &mesh)
void clear ()
void run (real_type const &dT, real_type const &fraction)
real_type compute_internal_energy ()

Protected Member Functions

void run (real_type const &dT, real_type const &fraction, real_type const &dt)
void collision_resolving (real_type const &dT, real_type const &fraction)
void collision_detection ()

Protected Attributes

mesh_ptr_container m_meshes
 All objects that should be simulated.
contact_container m_contacts
 Container holding collision detection results.
point_query_type m_point_query
 The collision detection.

Detailed Description

template<typename versatile_types>
class OpenTissue::versatile::Simulator< versatile_types >

Versatile Method.

Some observations:

Good stability <- small time steps, small geometries (re-scale world to unity), keep k_D, k_A, k_V below 100 or so.


Member Typedef Documentation

template<typename versatile_types >
typedef policy::result_container OpenTissue::versatile::Simulator< versatile_types >::contact_container
template<typename versatile_types >
typedef contact_container::iterator OpenTissue::versatile::Simulator< versatile_types >::contact_iterator
template<typename versatile_types >
typedef versatile_types::matrix3x3_type OpenTissue::versatile::Simulator< versatile_types >::matrix3x3_type
template<typename versatile_types >
typedef boost::indirect_iterator<mesh_ptr_iterator,mesh_type> OpenTissue::versatile::Simulator< versatile_types >::mesh_iterator
template<typename versatile_types >
typedef std::list<mesh_type*> OpenTissue::versatile::Simulator< versatile_types >::mesh_ptr_container
template<typename versatile_types >
typedef mesh_ptr_container::iterator OpenTissue::versatile::Simulator< versatile_types >::mesh_ptr_iterator
template<typename versatile_types >
typedef OpenTissue::versatile::Mesh<versatile_types> OpenTissue::versatile::Simulator< versatile_types >::mesh_type
template<typename versatile_types >
typedef OpenTissue::geometry::Plane<versatile_types> OpenTissue::versatile::Simulator< versatile_types >::plane_type
template<typename versatile_types >
typedef OpenTissue::spatial_hashing::PointDataQuery<typename policy::hash_grid,policy> OpenTissue::versatile::Simulator< versatile_types >::point_query_type
template<typename versatile_types >
typedef OpenTissue::versatile::detail::collision_policy<versatile_types> OpenTissue::versatile::Simulator< versatile_types >::policy
template<typename versatile_types >
typedef versatile_types::real_type OpenTissue::versatile::Simulator< versatile_types >::real_type
template<typename versatile_types >
typedef versatile_types::value_traits OpenTissue::versatile::Simulator< versatile_types >::value_traits
template<typename versatile_types >
typedef versatile_types::vector3_type OpenTissue::versatile::Simulator< versatile_types >::vector3_type

Member Function Documentation

template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::add ( mesh_type mesh  )  [inline]
template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::clear ( void   )  [inline]
template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::collision_detection (  )  [inline, protected]
template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::collision_resolving ( real_type const &  dT,
real_type const &  fraction 
) [inline, protected]
template<typename versatile_types >
real_type OpenTissue::versatile::Simulator< versatile_types >::compute_internal_energy (  )  [inline]
template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::run ( real_type const &  dT,
real_type const &  fraction 
) [inline]

Run Simulation. Remeber to compute external forces prior to invoking this method.

Parameters:
dT The frame time.
fraction Error reduction parameter, indicates the fraction that penetrations should be reduced too within time dT. Don't be too overeager, value of 0.05 (5%) seems to do a good job.
template<typename versatile_types >
void OpenTissue::versatile::Simulator< versatile_types >::run ( real_type const &  dT,
real_type const &  fraction,
real_type const &  dt 
) [inline, protected]

Time-Step method.

Parameters:
dT Frame time-step.
fraction Penetration reduction parameter.
dt The time-step time. Observe that an explicit integration method (Verlet) is being used. Your time-step should be order of ms (milliseconds) otherwise the simulation becomes unstable.

Member Data Documentation

template<typename versatile_types >
contact_container OpenTissue::versatile::Simulator< versatile_types >::m_contacts [protected]

Container holding collision detection results.

template<typename versatile_types >
mesh_ptr_container OpenTissue::versatile::Simulator< versatile_types >::m_meshes [protected]

All objects that should be simulated.

template<typename versatile_types >
point_query_type OpenTissue::versatile::Simulator< versatile_types >::m_point_query [protected]

The collision detection.


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