Class CECompoundBody#
Defined in File CECompoundBody.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::CompoundBody(Class CompoundBody)
Derived Types#
public Karana::Dynamics::GearedCompoundBody(Class GearedCompoundBody)public Karana::Dynamics::LoopsCompoundBody(Class LoopsCompoundBody)
Class Documentation#
-
class CECompoundBody : public Karana::Dynamics::CompoundBody#
Represents a compound body.
This class is for compound bodies representing a subtree of bodies.
Subclassed by Karana::Dynamics::GearedCompoundBody, Karana::Dynamics::LoopsCompoundBody
Public Functions
-
CECompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, size_t indep_n_u)#
CECompoundBody constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance one of the classes derived from this.
- Parameters:
name – Name of the CECompoundBody
parent_subtree – The SubTree to add this CECompoundBody to
component_bodies – The SubTree that contains the bodies that make up this CECompoundBody
indep_n_u – The number of independent velocity coordinates for this CECompoundBody.
-
virtual ~CECompoundBody()#
CECompoundBody destructor.
-
inline virtual std::string_view typeString() const noexcept override#
Returns the type string.
- Returns:
The type string.
-
inline std::vector<unsigned int> independentIndicesU() const#
-
inline std::vector<unsigned int> independentIndicesQ() const#
Protected Functions
-
virtual kc::ks_ptr<CompoundSubhinge> _createSubhinge(kc::ks_ptr<CompoundHinge> hinge) override#
Create the compound subhinge
-
virtual void _updateDependentQ(const km::Vec &min_Q, bool global) const = 0#
Convert the input minimal independent coords Q into the full dependent Q for all the aggregated subhinges for the compound body as appropriate and set the values. Note that the constraints are at the velocity level and not the Q level, and in some cases Q is subject to a different (and perhaps no) constraints, The global flag controls whether the incoming Q values are global are local chart coordinates.
- Parameters:
min_Q – the minimal coordinates
global – flag whether incoming coords are local or global
-
virtual const km::Mat &_constraintX() const#
Return the X matrix that maps the min independent U to the full U (independent, dependent, constraint dofs) for the compound body
- Returns:
the full constraint X matrix
-
virtual void _computeConstraintX(km::Mat &val) const = 0#
-
virtual km::Mat _matX() const#
Return the X matrix that maps the min independent U to the dependent U (without constraint dofs) for the compound body
- Returns:
the non-constraint X matrix
-
virtual const km::Vec &_constraintXdotU() const#
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
-
virtual void _computeXdotU(km::Vec &val) const = 0#
Protected Attributes
-
kc::ks_ptr<kc::DataCache<km::Mat>> _cache_constraintX = nullptr#
-
kc::ks_ptr<kc::DataCache<km::Vec>> _cache_XdotU = nullptr#
-
std::vector<unsigned int> _indep_indices_U#
indices of all independent coords among the multibody level coordinates
-
std::vector<unsigned int> _indep_indices_Q#
-
std::vector<std::pair<kc::ks_ptr<PhysicalSubhinge>, size_t>> _indep_cbs_U#
List contains the physical subhinge+offset value for each of the independent indices
-
std::vector<std::pair<kc::ks_ptr<PhysicalSubhinge>, size_t>> _indep_cbs_Q#
-
CECompoundBody(std::string_view name, kc::ks_ptr<SubGraph> parent_subtree, kc::ks_ptr<SubGraph> component_bodies, size_t indep_n_u)#