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

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

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 pondes 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

Protected Functions

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

BodyBase constructor.

virtual kc::ks_ptr<BodyBase> getPtr() = 0#

Return the shared pointer for the instance.

Returns:

BodyBase shared pointer

virtual kc::ks_ptr<const BodyBase> getPtr() const = 0#

Return the const shared pointer for the instance.

Returns:

BodyBase const shared pointer

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 matrix psi value.

Returns:

The ATBI matrix psi value for this subhinge.

virtual km::Mat getATBID() const override#
virtual km::Mat getATBIDinv() const override#
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.

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.

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.

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 teh 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#
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.