Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_GET_NCP_FORMULATION_H
00002 #define OPENTISSUE_DYNAMICS_MBD_UTIL_MBD_GET_NCP_FORMULATION_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/dynamics/mbd/mbd_evaluate_constraints.h>
00013 #include <OpenTissue/dynamics/mbd/mbd_get_jacobian_matrix.h>
00014 #include <OpenTissue/dynamics/mbd/mbd_get_dependencies_vector.h>
00015 #include <OpenTissue/dynamics/mbd/mbd_get_factors_vector.h>
00016 #include <OpenTissue/dynamics/mbd/mbd_get_limit_vectors.h>
00017 #include <OpenTissue/dynamics/mbd/mbd_get_regularization_vector.h>
00018 #include <OpenTissue/dynamics/mbd/mbd_get_stabilization_vector.h>
00019 #include <OpenTissue/dynamics/mbd/mbd_get_inverse_mass_matrix.h>
00020
00021 namespace OpenTissue
00022 {
00023 namespace mbd
00024 {
00025 template<typename group_type, typename real_type, typename matrix_type, typename vector_type, typename idx_vector_type>
00026 void get_ncp_formulation(
00027 group_type & group
00028 , real_type const & fps
00029 , matrix_type & J
00030 , matrix_type & invM
00031 , vector_type & lo
00032 , vector_type & hi
00033 , idx_vector_type & pi
00034 , vector_type & mu
00035 , vector_type & gamma
00036 , vector_type & b
00037 , bool const & use_stabilization
00038 , bool const & use_friction
00039 , bool const & use_bounce
00040 , bool const & use_erp
00041 )
00042 {
00043 size_t m = detail::evaluate_constraints(group,fps,use_stabilization,use_friction,use_bounce,use_erp);
00044 detail::get_jacobian_matrix (group, m, J );
00045 detail::get_dependencies_vector (group, m, pi );
00046 detail::get_factors_vector (group, m, mu );
00047 detail::get_limit_vectors (group, m, lo,hi);
00048 get_inverse_mass_matrix (group, invM );
00049 detail::get_regularization_vector(group, m, gamma);
00050 detail::get_stabilization_vector (group, m, b );
00051 }
00052
00053 }
00054 }
00055
00056 #endif