Class BodyBase#
Defined in File BodyBase.h
Inheritance Relationships#
Base Type#
public Karana::Dynamics::CoordBase(Class CoordBase)
Derived Types#
public Karana::Dynamics::CompoundBody(Class CompoundBody)public Karana::Dynamics::PhysicalBody(Class PhysicalBody)
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 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
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(kc::ks_ptr<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(kc::ks_ptr<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(kc::ks_ptr<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(kc::ks_ptr<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#
Return the oframe to pframe Psi() matrix for this CoordBase.
For
a flex body this is a 6x(nU+6) psi matrix, the lhs is at the pnode, and the rhs at the body frame.
For a subhinge this is a 6x6 psi matrix, the lhs/rhs are the subhinge’s oframe and pframe pair.
a compound subhinge this is the 6x(nbodies*(6+nU)) psi matrix, the lhs is at the physical parent, and the rhs at the embedded bodies.
- Returns:
the Psi() matrix
-
inline virtual km::Mat _oframe2pframePhi() const override#
Return the oframe to pframe Phi() matrix for this CoordBase.
For
a flex body this is a 6x(nU+6) phi matrix, the lhs is at the pnode, and the rhs at the body frame.
a subhinge this is a 6x6 phi matrix, the lhs/rhs are the subhinge’s oframe and pframe pair.
a compound subhinge this is the 6x(nbodies*(6+nU)) E_Phi_G matrix, the lhs is at the physical parent, and the rhs at the embedded bodies.
- Returns:
the Phi() matrix
-
inline virtual km::Mat _pframe2otherPhi(const kf::Frame&) const override#
Return the pframe to other frame Phi() matrix for this CoordBase.
For
a flex body this is a (nU+6)x6 phi matrix - the lhs is at the body frame, and the rhs at the other frame.
a subhinge this is a 6x6 matrix - the lhs is the pframe, and the rhs at the other frame.
a compound subhinge this is the (nbodies*(6+nU))x6 matrix, the lhs is at the embedded body frames, and the rhs at the other frame.
- Parameters:
other – the other to frame
- Returns:
the Phi() matrix
-
virtual km::Mat jacobian(const kf::Frame &target, bool oriented) const override#
Compute the 6xnU Jacobian to a frame with respect the body’s deformation coordinates.
This method returns 6xnU matrix, where nU is the number of deformation coordinates.
- Parameters:
target – Frame the target frame
oriented – the orientation of the coordinates provider
- Returns:
The Jacobian matrix
-
virtual km::Mat jacobianDot(const kf::Frame &target, bool oriented) const override#
Compute the 6xnU Jacobian time derivative for the body’s deformation coordinates.
This method returns 6xnU matrix, where nU is the number of deformation coordinates.
- Parameters:
target – Frame the target frame
oriented – the orientation of the coordinates provider
- Returns:
the Jacobian matrix time derivative
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.
-
kc::RegistryList<CompoundBody> _algorithmic_gather_child_cbs#
List of child compound bodies 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.
-
const kc::ks_ptr<Multibody> &multibody() const#