Class PhysicalModalBody

Contents

Class PhysicalModalBody#

Nested Relationships#

Nested Types#

Inheritance Relationships#

Base Type#

Class Documentation#

class PhysicalModalBody : public Karana::Dynamics::PhysicalBody#

Flexible body class supporting assumed modes based small deformation.

See the Flexible body systems section for more discussion on flexible bodies.

Public Functions

PhysicalModalBody(const std::string &name, kc::ks_ptr<Multibody> mb, size_t nmodes)#

Constructs a PhysicalModalBody.

Parameters:
  • name – the body’s name

  • mb – the Multibody instance

  • nmodes – the number of deformation modes

~PhysicalModalBody()#

Destructor.

inline virtual const std::string &typeString() const noexcept override#

Get the type string of the frame.

Returns:

The type string.

virtual void setBodyToJointTransform(const km::HomTran &t) override#

Set the the body frame to body HingePnode pnode transform.

For a deformable body, this is the transform value in the undeformed configuration. This method should only be used for body pnodes. The Node::setBodyToNodeTransform() method should be used for all other nodes.

Parameters:

t – The input transform

virtual km::HomTran getBodyToJointTransform() const override#

Return the body frame to body HingePnode pnode transform.

For a deformable body, this is the transform value in the undeformed configuration.

Returns:

the transform

virtual bool isFinalized() const override#

Checks is the params for the object have been initialized.

Returns:

True if the params have set up.

km::Vec getStiffnessVector() const#

Get the stiffness vector for the body.

Returns:

The stiffness vector for the body.

void setStiffnessVector(const km::Vec &stiffness)#

Set the stiffness vector for the body.

Parameters:

stiffness – The new stiffness vector for the body.

km::Vec getDampingVector() const#

Get the damping vector for the body.

Returns:

The new damping vector for the body.

void setDampingVector(const km::Vec &damping)#

Set the damping vector for the body.

Parameters:

damping – The new damping vector for the body.

virtual std::string dumpString(const std::string &prefix, const Karana::Core::Base::dumpOptions *options) const override#

Return information about the object.

Parameters:
  • prefix – A string to use as prefix for each output line

  • options – Struct with options to tailor the output

Returns:

String with the information about the object.

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

placeholder implementation

virtual km::Mat66 getNodeUpsilonFromPnode(const Node &node) override#

Return the 6x6 OSCM Upsilon matrix for a body node using the pnode Upsilon.

Thie method is used for the scatter step for onode Upsilon computation.

Parameters:

nd – the body node

Returns:

the OSCM Upsilon matrix

virtual km::Mat66 getNodeUpsilonFromBody(const Node &node) override#

Return the 6x6 OSCM Upsilon matrix for a body node using the body’s Upsilon.

Thie method is used to compute the child onode UpsilonPlus value after crossing the modal dofs.

Parameters:

node – the body node

Returns:

the OSCM Upsilon matrix

virtual km::Mat getUpsilonMatrix() override#

Get the (nU+6) square Upslon matrix in the body frame after crossing the flex dofs

virtual void setParams(const PhysicalBodyParams &params) override#

Set the PhysicalBody paramaters.

Parameters:

params – the parameters to set

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

Return the coordinate map matrix to be used for ATBI computations.

Returns:

coordinate map matrix

Public Static Functions

static kc::ks_ptr<PhysicalModalBody> create(const std::string &name, kc::ks_ptr<Multibody> mbs, size_t nmodes)#

Factory method to create a PhysicalModalBody instance.

Parameters:
  • name – the body’s name

  • mbs – the Multibody instance

  • nmodes – the number of deformation modes

Returns:

a new PhysicalModalBody instance

static std::vector<kc::ks_ptr<PhysicalBody>> addSerialChain(const std::string &name, size_t nbodies, PhysicalBody &root, HingeBase::HINGE_TYPE htype = HingeBase::HINGE_TYPE::PIN, PhysicalBodyParams *params = nullptr)#

Add a serial chain of flexible physical bodies to the multibody system.

Add a serial chain of flexible bodies to the multibody system to the specified root body with the specified mass properties, hinge type and hinge connection properties. This method is mainly used for procedurally generating large test systems.

Parameters:
  • name – prefix string to use for the new body names

  • nbodies – number of bodies

  • root – the parent body to attach the chain to

  • params – the body params for each body

Returns:

the list of new flexible bodies

static std::vector<kc::ks_ptr<PhysicalBody>> addTree(const std::string &name, size_t branch_length, size_t nbranches, size_t depth, PhysicalBody &root, HingeBase::HINGE_TYPE htype = HingeBase::HINGE_TYPE::PIN, PhysicalBodyParams *params = nullptr)#

Add a sub-tree of flexible physical bodies to the multibody system.

Add a sub-tree of flexible bodies to the multibody system to the specified root body with the specified mass properties, hinge type and hinge connection properties. This method is mainly used for procedurally generating large test systems.

Parameters:
  • name – prefix string to use for the new body names

  • branch_length – the number of bodies in a branch

  • nbranches – the number of chidren branches

  • depth – the number of branching levels to create

  • root – the parent body to attach the chain to

  • params – the body params for each body

Returns:

the list of new rigid bodies

Protected Functions

inline const km::Mat &_atbiCoordMapMatrix() const#
virtual km::Mat pframeCoordMapMatrix() const override#

same as the (6+nU, 6) _computeHst_Mfl(*this), so the lhs is in the body frame.

virtual km::Mat getATBIMatPsi() const override#

Return the (6, nU+6) psi transformation matrix bewteen the pnode and the body. The lhs is in the pnode frame and the rhs in the body frame. This method should only be called for bodies whose pnode is not a floating frame. This method is used by both _oframe2pframePsi() and _oframe2pframePsi.

virtual km::Mat getATBID() const override#

nU square matrix

virtual km::Mat getATBIDinv() const override#

nU square matrix

virtual km::Mat getATBIG() const override#

Return (nU+6)xnU matrix with upper rows padded in for Minv computations. lhs is in the body frame. Note that this differs from _atbi_mats.G whose rhs is in the pnode deformed translational frame. This version is used in the Minv computations.

virtual km::Mat getATBITauper() const override#

Return (nU+6) square matrix with upper rows padded in for Minv computations. lhs is in the body frame, and the bottom right in the body frame. Note that this differs from _atbi_mats.tauper whose rhs is in the pnode deformed translational frame. This version is used in the Minv computations.

virtual km::Mat _oframe2pframePsi() const override#

Returns the (6, nU+6) size pnode to body frame Psi

virtual km::Mat _oframe2pframePhi() const override#

Returns the (6, nU+6) size pnode to body frame Phi

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

Returns the (nU+6, 6) size body frame to body node connected frame Phi

void discardNodeDeformationProvider(kc::ks_ptr<Node> nd)#

Discard the node’s deformation provider.

Parameters:

nd – The node whose deformation provider we want to discard.

void discardPnodeDeformationProvider()#

Discard the pnode’s deformation provider.

virtual void _setupNode(Node &nd, bool force_node) override#

Helper method to create a node. This method is specialized by bodies that are deformable

virtual void _detachNode(kc::ks_ptr<Node> &node) override#

Discard the provided node.

Parameters:

node – The node to discard.

km::Mat _getM() const#

Get the (nU+6) size square body mass properties M matrix - value can vary with configuration when using modal integrals

km::Mat _getMff() const#

Get the nU size square flex/flex sub-block of the body’s mass properties M - non-identity when using modal integrals

km::Mat _getMfr() const#

Get the nUx6 size flex/rigidly sub-block of the body’s mass properties M - non-zero when using modal integrals

void _discardNodeDeformationProvider(kc::ks_ptr<Node> nd)#

Discard the node’s deformation provider.

Parameters:

nd – The node whose deformation provider we want to discard.

void _discardPnodeDeformationProvider()#

Discard the pnode’s deformation provider.

virtual km::SpatialVector _getPnodeATBIFilterZ() override#

Compute the z ATBI filter spatial vector at the pnode after crossing the flex dofs

virtual km::Mat66 _getPnodeATBIMatricesP() override#

Compute the P ATBI matrix at the pnode after crossing the flex dofs

virtual km::SpatialVector _getOnodeATBISmootherAlphaPlus(const HingeOnode &ond) override#

Compute the alpha^+ ATBI smoothing spatial accel vector at the onode

virtual void _processPnodeATBISmootherVectors() override#

Compute the modal accels as part of the ATBI smoothing step

virtual km::SpatialVector _getPnodeInvDynForcesF() override#

Compter the inter-body spatial force at the pnode from the inverse dynamics computations

SZNodeMatrices _computeSZMatrices(const Node &node)#

Compute and cache the S (nUx6) and Z (6x6) matrices for computing pnode to body node transformations.

virtual km::Mat66 _pnodeToChildNodeTransform(const Node &node) override#

Return the pnode to body node 6x6 transformation matrix - this takes into account Z matrix

virtual km::Mat _bodyToChildNodeTransform(const Node &node, const kf::Frame &from_frame) const override#

Return the (nU+6, 6) A_fl(node) matrix - transformed to the “from_frame” via phi(from_frame, body_frame). The A_fl(node) matrix by itself is

[Pi^* // phi(bd, node_trans)] * phi(node_trans, node)

We apply the phi(from_frame, bd) to the bottom row to tranform it to the from_frame.

This also works for floating base systems (where the pnode is no longer a physical point) because we do not allow any offsets between the pnode and the body frame for such bodies. Otherwse, we would have to use phi(pnode, node_trans) because the P value is at the pnode, not the body frame.

void _computeATBICoordMapMatrix(km::Mat&) const#
km::Mat _computeHst_Mfl(const kf::Frame &at_frame) const#

Compute the (nU+6)xnU Hst_Mfl matrix transformed from the (lhs) pnode deformed trans frame to the specified (rhs) at_frame (often the body frame). This is the left block of the full Hst matrix when the “at_frame” is the body frame (per the book). Note however that the pnode is the at_frame when working with the full Hst matrix.

const km::Vec _externalModalForces() const#

Return the (6, nU+6) psi transformation matrix bewteen the pnode and the body. The lhs is in the pnode frame and the rhs in the body frame. This method should only be called for bodies whose pnode is not a floating frame. This method is used by both _oframe2pframePsi() and _oframe2pframePsi. Process the external spatial forces on the body force nodes and return the overall nU sized vector

const km::Vec _constraintModalForces() const#

Process the constraint spatial forces on the body constraint nodes and return the overall nU sized vector

void _setupNodeDeformation(kc::ks_ptr<Node> nd)#
void _setupPnodeDeformation()#
virtual void _discardHingePnode() override#
virtual void _discardHingeOnode(kc::ks_ptr<HingeOnode> &onode) override#
virtual kc::ks_ptr<HingePnode> _createPnode(bool floating_frame) override#

Methods to create and discard nodes

virtual kc::ks_ptr<HingeOnode> _createOnode(const std::string &name) override#
virtual void _setBodyToNodeTransform(Node &node, const km::HomTran &t) override#

Get/set the the transform to a body node. For a deformable body, this is the transform value in the undeformed configuration. This method should be used for all nodes, except for the pnode for whom the get/setBodyToJointTransform() method should be used. These methods are protected to allow them to specialized for rigid and deformable bodies.

virtual km::HomTran _getBodyToNodeTransform(const Node &node) const override#
km::Mat _getMassAtFrame(const kf::Frame &frame) const#
virtual void _getPnodeCRBInertiaMatrix(km::Mat &R) override#

Update the full (nU+6)x(nU+6) flex input R matrix with contributions from the child onodes and the body itself transformed to the pnode.

void _oneTimeSetupDataCaches()#
void _oneTimeTeardownDataCaches()#

Protected Attributes

km::Vec _stiffness_vector#
km::Vec _damping_vector#
bool _using_modal_integrals = false#

the flex (nU+6)x(nU+6) CRB mass matrix for the body at the pnode. This is updated by _getPnodeCRBInertiaMatrix(), though the method returns only the 6x6 rigid/rigid part. set to true if modal integrals have been set up for this body

ModalUpsilonMatrices _modal_upsilon_matrices#
kc::ks_ptr<kc::DataCache<km::Mat>> _atbi_coord_map_matrix_cache = nullptr#

the (6*nU)xNU joint map matrix data cach e for ATBI computations for the subhinge.

struct ATBIFilterVectors : public Karana::Dynamics::CoordBase::ATBIFilterVectors#

Public Functions

inline void resize(size_t modal_nU)#

Constructor

void dump(const std::string &indent) const#

Public Members

km::Vec z#
km::SpatialVector zplus#
km::Vec epsilon#

Residual hinge force (nU)

eps = T - H * (zR + PR*a)

km::Vec nu#

Residual hinge acceleration (nU)

nu = Dinv * eps

struct ATBIMatrices : public Karana::Dynamics::CoordBase::ATBIMatrices#

Overall struct for ATBI dynamics matrix quantities for an articulation subhinge which includes the fixed and subhinge dof size matrices.

HP (6, nU) - the lhs is in the pnode deformed translational frame G (6, nU) - the lhs is in the pnode deformed translational frame tauper (6, nU+6) - lhs is in the pnode deformed translational frame, while the bottom part of the right is in the body frame

psi (6, nU+6) - lhs is in the pnode frame, while the bottom part of the right is in the body frame

Public Functions

inline void resize(size_t modal_nU, size_t body_nU)#

Public Members

km::Mat P#
km::Mat66 Pplus#
km::Mat HP#

HP = H*P (nU x body_nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

km::Mat D#

D = H*P*HT (nU x nU)

km::Mat Dinv#

Dinv = inverse(D) (nU x nU)

km::Mat G#

G = P*H*Dinv (body_nU x nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

km::Mat tauper#

tauper = I - GH (body_nU x body_nU)

For a subhinge the lhs is in the pframe, while it in the pnode deformed translational frame for a flex body.

km::Mat psi#

psi = phi * tauper (body_nU x body_nU)

For a subhinge, the left is in the oframe, right in the pframe. For a flex body, the lefts is in the pnode frame and the right in the body frame.

struct ATBISmootherVectors#

Public Members

km::SpatialVector alpha_plus#

alpha+ vector at the onode and represented in the onode frame.

struct ModalUpsilonMatrices#

Public Members

km::Mat Upsilon#

OSI (nmodes+6) Upsilon matrix for the body about and in the body frame

struct SZNodeMatrices#

matrices for computing the pnode to body node psi and Upsilon values for a flex body

Public Members

km::Mat S#
km::Mat66 Z#