Class BodyBase#

Inheritance Relationships#

Base Type#

Derived Types#

Class Documentation#

class BodyBase : public Karana::Dynamics::CoordBase#

Represents the abstract base class for bodies.

This class is the base class for bodies from which physical and compound body classes are derived. The coordinates associated with this class as those from deformation coordinates.

Subclassed by Karana::Dynamics::CompoundBody, Karana::Dynamics::PhysicalBody

Public Functions

const kc::ks_ptr<Multibody> &multibody() const#

Return the Multibody system that the body belongs to.

Returns:

the parent Multibody instance

inline bool isCompoundBody() const#

Return flag indicating whether this is a CompoundBody.

Returns:

true is the body is a CompoundBody

virtual ~BodyBase()#

BodyBase destructor.

virtual const kc::ks_ptr<PhysicalBody> &physicalParentBody() const = 0#

Return the PhysicalBody inboard parent body for the body.

For a PhysicalBody this is simply the inboard body connected to it via a PhysicalHinge. For a CompoundBody, this is the single PhysicalBody to which the base pnodes in the CompoundBody are connected to.

Returns:

the parent PhysicalBody body instance

virtual kc::ks_ptr<HingeBase> parentHinge() const = 0#

Return the parent hinge for the body.

For a PhysicalBody, parent hinge is a PhysicalHinge, while for a CompoundBody the parent hinge is a CompoundHinge

Returns:

The parent HingeBase instance

inline virtual bool isRootBody() const#

Return true is this body is the Multibody’s virtual root body.

The default return value if false, since only physical bodies can possibly be the virtual root body.

Returns:

true if this is the virtual root body

Protected Functions

inline kc::ks_ptr<SubTree> _parentSubtree() const#

Return the SubTree that owns the body.

Return the parent SubTree that created this body and has it in its usage tracking map. Physical bodies are always owned by the Multibody tree. Compound bodies are owned by non-multibody subtrees.

Returns:

the parent SubTree instance

BodyBase(std::string_view nm, kc::id_t id, kc::ks_ptr<SubTree> parent_subtree)#

BodyBase constructor.

Parameters:
  • nm – instance name

  • id – instance id

  • parent_subtree – the subtree the body belongs to

virtual void _setupChildBodyCacheDependencies(const BodyBase &child_body) = 0#

Set up cache dependencies with a child body.

Parameters:

child_body – the child body

virtual void _setupChildPhysicalBodyCacheDependencies(const PhysicalBody &child_body, bool skip_scatter) = 0#

Set up cache dependencies with a PhysicalBody child body.

Parameters:
  • child_body – the PhysicalBody child body

  • skip_scatter – if true, skip dependencies for the scatter phase

virtual void _setupChildCompoundBodyCacheDependencies(const CompoundBody &child_body) = 0#

Set up cache dependencies with a CompoundBody child body.

Parameters:

child_body – the CompoundBody child body

virtual void _setupBaseBodyCacheDependencies() = 0#

Set up cache dependencies for a base body.

virtual void _teardownChildBodyCacheDependencies(const BodyBase &child_body) = 0#

Tear down cache dependencies with a child body.

Parameters:

child_body – the child body

virtual void _teardownChildPhysicalBodyCacheDependencies(const PhysicalBody &child_body, bool skip_scatter) = 0#

Tear down cache dependencies with a PhysicalBody child body.

Parameters:
  • child_body – the PhysicalBody child body

  • skip_scatter – if true, skip dependencies for the scatter phase

virtual void _teardownChildCompoundBodyCacheDependencies(const CompoundBody &child_body) = 0#

Tear down cache dependencies with a CompoundBody child body.

Parameters:

child_body – the CompoundBody child body

virtual void _teardownBaseBodyCacheDependencies() = 0#

Tear down cache dependencies for a base body.

inline virtual km::Mat getATBIMatPsi() const override#

Get the ATBI psi matrix value.

Returns:

The ATBI psi matrix value for this subhinge.

virtual km::Mat getATBID() const override#

Get the ATBI D matrix value.

Returns:

The ATBI D matrix value for this subhinge.

virtual km::Mat getATBIDinv() const override#

Get the ATBI D inverse matrix value.

Returns:

The ATBI D inverse matrix value for this subhinge.

inline virtual km::Mat getATBIG() const override#

The ATBI G matrix at the pframe. For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. This is different from _atbi_mats.G.

Returns:

The ATBI G matrix value for this subhinge.

inline virtual km::Mat getATBITauper() const override#

The ATBI tauper matrix at the pframe. For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. This is different from _atbi_mats.tauper.

Returns:

The ATBI tauper matrix value for this subhinge.

inline virtual km::Mat getUpsilonMatrix() override#

The Upsilon at the pframe (after crossing the ATBI dofs). For a subhinge, pframe is the regular subhinge pframe, and for a flex body it is the body frame. For a subhinge, this is a nU size square matrix, while for a flex body it is a (nU+6) size square matrix.

Returns:

The ATBI Upsilon matrix value for this subhinge.

inline virtual km::Mat _oframe2pframePsi() const override#

for flex bodies returns 6x(nU+6) ATBI psi matrix, for subhinges the size is 6x6. For a flex body, the lhs is at the pnode, and the rhs at the body frame. For a subhinge, the lhs/rhs are the subhinge’s oframe and pframe pair.

inline virtual km::Mat _oframe2pframePhi() const override#

for flex bodies returns 6x(nU+6) phi matrix, for subhinges the size is 6x6. For a flex body, the lhs is at the pnode, and the rhs at the body frame. For a subhinge, the lhs/rhs are the subhinge’s oframe and pframe pair.

inline virtual km::Mat _pframe2otherPhi(const kf::Frame&) const override#

for flex bodies returns (nU+6)x6 psi matrix, for subhinges the size is 6x6. For a flex body, the lhs is at the body frame, and the rhs at the other frame. For a subhinge, the lhs is the pframe, and the rhs at the other frame.

inline virtual km::Mat jacobian(const kf::Frame&, bool) const override#

placeholder implementation

inline virtual km::Mat jacobianDot(const kf::Frame&, bool) const override#

placeholder implementation

inline virtual void _computeCoordMapMatrix(km::Mat)#

Return the matrix mapping generalized velocities to body spatial velocities.

For a PhysicalBody this is a 6xnU matrix, while for a CompoundBody the row size is 6 times the number for aggregated bodies

Parameters:

The – matrix to fill with the returned values

Protected Attributes

kc::ks_ptr<SubTree> _parent_subtree = nullptr#

parent subtree

The parent SubTree that created this body and has it in its usage tracking map. Physical bodies are always owned by the multibody tree. Compound bodies are owned by non-multibody subtrees.

bool _is_compound_body = false#

whether or not this body is a compound body. We could check whether the parent SubGraph is the multibody tree or not, but storing as a flag and accessing it is faster than doing the comparison each time.

kc::RegistryList<HingeOnode> _algorithmic_gather_child_onodes#

List of child body HingeOnode onodes to use for gather data cache callbacks for this body. The contents of this list are set by the algorithmic SubTree this body belongs to.