Class LoopsCompoundBody#
Defined in File CECompoundBody.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::CECompoundBody(Class CECompoundBody)
Class Documentation#
-
class LoopsCompoundBody : public Karana::Dynamics::CECompoundBody#
Constraint embedding class for a bodies with loop constraints.
This class is embedding loop constraint for a subgraph of bodies.
Public Functions
-
virtual ~LoopsCompoundBody()#
Destructor.
-
inline virtual std::string_view typeString() const noexcept override#
Returns the type string.
- Returns:
The type string.
-
LoopsCompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> bodies_tree, const std::vector<unsigned int> &indep_indices_U, const std::vector<unsigned int> &indep_indices_Q = {})#
Constructs a LoopsCompoundBody with list of independent bodies.
- Parameters:
name – instance name
parent_subtree – the parent subgraph this the body will belong to
component_bodies – subgraph with bodies being embedded
indep_indices_U – the list of independent U coordinate indices
indep_indices_Q – the list of independent Q coordinate indices
-
LoopsCompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> bodies_tree, const std::vector<kc::ks_ptr<PhysicalBody>> &indep_bodies)#
Constructs a LoopsCompoundBody with list of independent coord indices.
- Parameters:
name – instance name
parent_subtree – the parent subgraph this the body will belong to
component_bodies – subgraph with bodies being embedded
indep_bodies – the bodies whose coordinates should be independent
Public Static Functions
-
static kc::ks_ptr<LoopsCompoundBody> create(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, const std::vector<kc::ks_ptr<PhysicalBody>> &indep_bodies)#
Constructs a LoopsCompoundBody with list of independent bodies.
- Parameters:
name – instance name
parent_subtree – the parent subgraph this the body will belong to
component_bodies – subgraph with bodies being embedded
indep_bodies – the bodies whose coordinates should be independent
- Returns:
a LoopsCompoundBody instance
-
static kc::ks_ptr<LoopsCompoundBody> create(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, const std::vector<unsigned int> &indep_indices_U, const std::vector<unsigned int> &indep_indices_Q = {})#
Constructs a LoopsCompoundBody with list of independent coord indices.
The option of specifying independent coordinates at the indices level gives finer-grain control than the other create() method. Also, this method allows specifying different values for the independent Q and U coordinates. The U coordinates are used if the Q list is empty.
- Parameters:
name – instance name
parent_subtree – the parent subgraph this the body will belong to
component_bodies – subgraph with bodies being embedded
indep_indices_U – the list of independent U coordinate indices
indep_indices_Q – the list of independent Q coordinate indices
- Returns:
a LoopsCompoundBody instance
Protected Functions
-
virtual void _updateDependentQ(const km::Vec &min_q, bool global) const override#
Convert the input minimal coords Q into the full dependent Q for all the aggregated subhinges for the compound body
-
virtual km::Mat _constraintX() const override#
Return the X matrix that maps the min independent U to the full dependent U for the compound body
-
virtual km::Vec _constraintXdotU(const km::Vec &U) const override#
Return the Xdot*U product vector where Xdot is the time derivative of the X constraint matrix
- Parameters:
the – input U vector
- Returns:
the Xdot*U product
-
void _discard(kc::ks_ptr<Base> &base) override#
Return the X matrix pseudo inverse that maps the full dependent U for the compound body to the min independent U
Protected Attributes
-
kc::ks_ptr<ConstraintKinematicsSolver> _cks = nullptr#
the CK solver used to solve for the dependent coordinates
-
std::vector<unsigned int> _rows_Y#
-
std::vector<unsigned int> _rows_Ydot#
-
std::vector<unsigned int> _dep_indices_U#
indices of all dependent coords among the _bodies_tree coordinates
-
virtual ~LoopsCompoundBody()#