Public Types | Public Member Functions | Protected Attributes

OpenTissue::mbd::ConstraintInterface< mbd_types > Class Template Reference

#include <mbd_constraint_interface.h>

Inheritance diagram for OpenTissue::mbd::ConstraintInterface< mbd_types >:
OpenTissue::mbd::CoreConstraintInterface< mbd_types >

List of all members.

Public Types

typedef mbd_types::body_type body_type
typedef
mbd_types::math_policy::size_type 
size_type
typedef
mbd_types::math_policy::real_type 
real_type
typedef
mbd_types::math_policy::vector_range 
vector_range
typedef
mbd_types::math_policy::idx_vector_range 
idx_vector_range
typedef
mbd_types::math_policy::matrix_range 
matrix_range

Public Member Functions

 ConstraintInterface ()
virtual ~ConstraintInterface ()
body_typeget_body_A () const
body_typeget_body_B () const
void set_jacobian_index (size_type const &idx)
size_type const & get_jacobian_index () const
virtual void evaluate ()=0
virtual void get_linear_jacobian_A (matrix_range &J) const =0
virtual void get_linear_jacobian_B (matrix_range &J) const =0
virtual void get_angular_jacobian_A (matrix_range &J) const =0
virtual void get_angular_jacobian_B (matrix_range &J) const =0
virtual void get_stabilization_term (vector_range &b_error) const =0
virtual void get_low_limits (vector_range &lo) const =0
virtual void get_high_limits (vector_range &hi) const =0
virtual void get_dependency_indices (idx_vector_range &dep) const =0
virtual void get_dependency_factors (vector_range &factors) const =0
virtual void set_regularization (vector_range const &gamma)=0
virtual void get_regularization (vector_range &gamma) const =0
virtual void set_solution (vector_range const &solution)=0
virtual void get_solution (vector_range &solution) const =0

Protected Attributes

body_typem_bodyA
 A pointer to the first body.
body_typem_bodyB
 A pointer to the second body.
size_type m_jacobian_idx
 Starting row index if jacobian data in system jacobian (note that column indices are determined by bodies).

Detailed Description

template<typename mbd_types>
class OpenTissue::mbd::ConstraintInterface< mbd_types >

Constraint base Class. Constraints are always imposed between a pair of bodies. These bodies are ordered uniquely such that the body denoted by A have the smallest index and the body denoted by B have the greatest index.

Besides that it defines several paramters common to all constraints such as error reduction parameter and constraint force mixing.


Member Typedef Documentation

template<typename mbd_types >
typedef mbd_types::body_type OpenTissue::mbd::ConstraintInterface< mbd_types >::body_type
template<typename mbd_types >
typedef mbd_types::math_policy::idx_vector_range OpenTissue::mbd::ConstraintInterface< mbd_types >::idx_vector_range
template<typename mbd_types >
typedef mbd_types::math_policy::matrix_range OpenTissue::mbd::ConstraintInterface< mbd_types >::matrix_range
template<typename mbd_types >
typedef mbd_types::math_policy::vector_range OpenTissue::mbd::ConstraintInterface< mbd_types >::vector_range

Constructor & Destructor Documentation

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

Member Function Documentation

template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::evaluate (  )  [pure virtual]

Evaluate Constraint. This method is responsible for evaluating the current state of the constraint. This implies setting up any internal data structures needed for construting the jacobians and auxiliary data later on.

Also the method is responsible for evaluating whetever the constraint is actually active in the current state. This implies that if the method isEvaluatedActive() is invoked afterwards then it should return the active state determined by evaluate().

template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_angular_jacobian_A ( matrix_range J  )  const [pure virtual]

Get Angular Jacobian of body A.

Parameters:
J Upon return this matrix contains the request jacobian matrix. The matrix must have dimension mx3, where m is the number of jacobian variables (rows).
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_angular_jacobian_B ( matrix_range J  )  const [pure virtual]

Get Angular Jacobian of body B.

Parameters:
J Upon return this matrix contains the request jacobian matrix. The matrix must have dimension mx3, where m is the number of jacobian variables (rows).
template<typename mbd_types >
body_type* OpenTissue::mbd::ConstraintInterface< mbd_types >::get_body_A (  )  const [inline]

Get body_type A.

Returns:
A pointer to the first body.
template<typename mbd_types >
body_type* OpenTissue::mbd::ConstraintInterface< mbd_types >::get_body_B (  )  const [inline]

Get body_type B.

Returns:
A pointer to the second body.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_dependency_factors ( vector_range factors  )  const [pure virtual]

Get Bounds Scaling Factor. Imagine having the same case as described in the getDepedencyIndices() method. The first row is not dependent on the others, so its scale factor is a ``don't care'', if the bounds of the second row are twice the value of the first variable, and the bounds on the third row are three times the value of the first variable, then the fac-vector is equal to [0,2,3] real_type.

Notice that all factor values are non-negative.

Parameters:
factors Upon return the vector holds all factor values. Must be have size equal to number of jacobian rows.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_dependency_indices ( idx_vector_range dep  )  const [pure virtual]

Get Dependency Indices. As an example say a constraint have tree variables, ie. three jacobian rows, these are numbered locally 0,1, and 2. Imagine that the bounds on the last two are dependent on the first row. Further assume that the global index of the first row is given by the index-value m. In this case the dep-vector should be equal to

[max_value,m,m]

Note: An entry containing the maximum possible value of the underlying data type indicates that there are no dependencies on the correspoding constraint.

Note: The method should return global indices of the dependent constraints and NOT local indices. One can use the method get_jacobian_index() to retrieve the global index of the first constraint variable.

Parameters:
dep Upon return vector holds relative dependency indices. Must be have size equal to number of jacobian rows
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_high_limits ( vector_range hi  )  const [pure virtual]

Get Jacobian High Limits.

Parameters:
hi Upon return this vector holds the high limits of the lagrange multipliers associated with the jacobian constraints. Must be have size equal to number of jacobian rows.
template<typename mbd_types >
size_type const& OpenTissue::mbd::ConstraintInterface< mbd_types >::get_jacobian_index (  )  const [inline]

Return Starting Index of Jacobian Data.

Returns:
The starting row index into the system jacobian and error term vector.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_linear_jacobian_A ( matrix_range J  )  const [pure virtual]

Get Linear Jacobian of body A.

Parameters:
J Upon return this matrix contains the request jacobian matrix. The matrix must have dimension mx3, where m is the number of jacobian variables (rows).
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_linear_jacobian_B ( matrix_range J  )  const [pure virtual]

Get Linear Jacobian of body B.

Parameters:
J Upon return this matrix contains the request jacobian matrix. The matrix must have dimension mx3, where m is the number of jacobian variables (rows).
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_low_limits ( vector_range lo  )  const [pure virtual]

Get Jacobian Low Limits.

Parameters:
lambda_low Upon return this vector holds the low limits of the lagrange multipliers associated with the jacobian constraints.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_regularization ( vector_range gamma  )  const [pure virtual]

Get Constraint force_type Mixing Vector.

Parameters:
gamma Upon return this vector holds the values of the gamma paramters. Must be have size equal to number of jacobian rows.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_solution ( vector_range solution  )  const [pure virtual]

Get Cached Solution.

Parameters:
solution Upon return this vector expression will contain the last stored solution. Must be have size equal to number of jacobian rows.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::get_stabilization_term ( vector_range b_error  )  const [pure virtual]

Get Error Term Vector.

Parameters:
b_error Upon return this vector holds the error term (or right hand side vector) related to the jacobian variables. Initially the vector must have the same size as the number of jacobian variables (rows).
template<typename mbd_types >
void OpenTissue::mbd::ConstraintInterface< mbd_types >::set_jacobian_index ( size_type const &  idx  )  [inline]

Set Starting Index of Jacobian Data.

Parameters:
idx The global starting row index into the system jacobian and error term vector. That is the global index corresponding to local 0-row.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::set_regularization ( vector_range const &  gamma  )  [pure virtual]

Set Constraint force_type Mixing Parameters. Note all values must be in the interval 0..1. The vector must have same size as the number of jacobian constraints (rows in the jacobian matrices).

Parameters:
gamma A vector containing the new parameter values. Must be have size equal to number of jacobian rows.
template<typename mbd_types >
virtual void OpenTissue::mbd::ConstraintInterface< mbd_types >::set_solution ( vector_range const &  solution  )  [pure virtual]

Save Solution of Jacobian Lagrange Multipliers

Parameters:
solution A vector expression containing the solution to be saved. Must be have size equal to number of jacobian rows.

Member Data Documentation

template<typename mbd_types >
body_type* OpenTissue::mbd::ConstraintInterface< mbd_types >::m_bodyA [protected]

A pointer to the first body.

template<typename mbd_types >
body_type* OpenTissue::mbd::ConstraintInterface< mbd_types >::m_bodyB [protected]

A pointer to the second body.

template<typename mbd_types >
size_type OpenTissue::mbd::ConstraintInterface< mbd_types >::m_jacobian_idx [protected]

Starting row index if jacobian data in system jacobian (note that column indices are determined by bodies).


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