1 #ifndef SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
2 #define SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
35 class MultibodySystem;
36 class SimbodyMatterSubsystem;
37 class ContactTrackerSubsystem;
38 class ContactForceGenerator;
67 Real getTransitionVelocity()
const;
69 void setTransitionVelocity(Real vt);
71 Real getOOTransitionVelocity()
const;
81 void setTrackDissipatedEnergy(
bool shouldTrack);
86 bool getTrackDissipatedEnergy()
const;
92 int getNumContactForces(
const State& state)
const;
136 bool calcContactPatchDetailsById(
const State& state,
170 Real getDissipatedEnergy(
const State& state)
const;
192 void setDissipatedEnergy(
State& state, Real energy)
const;
214 bool hasDefaultForceGenerator()
const;
244 class CompliantContactSubsystemImpl& updImpl();
245 const CompliantContactSubsystemImpl& getImpl()
const;
312 Real potentialEnergy, Real powerLoss)
313 : m_contactId(id), m_contactPt(contactPt),
314 m_forceOnSurface2(forceOnSurface2),
315 m_potentialEnergy(potentialEnergy), m_powerLoss(powerLoss) {}
342 Real potentialEnergy, Real powerLoss)
344 m_contactPt = contactPt;
345 m_forceOnSurface2 = forceOnSurface2;
346 m_potentialEnergy = potentialEnergy;
347 m_powerLoss = powerLoss; }
356 { m_forceOnSurface2=forceOnSurface2; }
359 { m_potentialEnergy=potentialEnergy; }
365 void clear() {m_contactId.invalidate();}
367 bool isValid()
const {
return m_contactId.isValid();}
374 m_contactPt = X_BA*m_contactPt;
375 m_forceOnSurface2 = X_BA.
R()*m_forceOnSurface2;
382 Real m_potentialEnergy;
388 o <<
"ContactForce for ContactId " << f.
getContactId() <<
" (ground frame):\n";
543 o <<
"ContactDetail (ground frame):\n";
583 void clear() {m_resultant.clear(); m_elements.clear();}
584 bool isValid()
const {
return m_resultant.isValid();}
593 m_resultant.changeFrameInPlace(X_BA);
594 for (
unsigned i=0; i<m_elements.size(); ++i)
595 m_elements[i].changeFrameInPlace(X_BA);
634 { assert(m_compliantContactSubsys);
return *m_compliantContactSubsys; }
636 { m_compliantContactSubsys = sub; }
651 virtual void calcContactForce
663 virtual void calcContactPatch
699 virtual void calcContactForce
705 virtual void calcContactPatch
730 virtual void calcContactForce
736 virtual void calcContactPatch
757 virtual void calcContactForce
763 virtual void calcContactPatch
770 void calcContactForceAndDetails
777 void calcWeightedPatchCentroid
779 const std::set<int>& insideFaces,
780 Vec3& weightedPatchCentroid,
781 Real& patchArea)
const;
786 const std::set<int>& insideFaces,
790 Real meshDeformationFraction,
791 Real areaScaleFactor,
792 Real k, Real c, Real us, Real ud, Real uv,
793 const Vec3& resultantPt_M,
795 Real& potentialEnergy,
797 Vec3& weightedCenterOfPressure_M,
798 Real& sumOfAllPressureMoments,
817 virtual void calcContactForce
823 "ContactForceGenerator::DoNothing::calcContactForce() not implemented yet."); }
824 virtual void calcContactPatch
830 "ContactForceGenerator::DoNothing::calcContactPatch() not implemented yet."); }
848 virtual void calcContactForce
854 "ContactForceGenerator::ThrowError::calcContactForce() not implemented yet."); }
855 virtual void calcContactPatch
861 "ContactForceGenerator::ThrowError::calcContactPatch() not implemented yet."); }
866 #endif // SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
#define SimTK_ASSERT_ALWAYS(cond, msg)
Definition: ExceptionMacros.h:349
Every Simbody header and source file should include this header before any other Simbody header...
This is the handle class for the hidden State implementation.
Definition: State.h:264
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
The job of the MultibodySystem class is to coordinate the activities of various subsystems which can ...
Definition: MultibodySystem.h:48
This is logically an abstract class, more specialized than "Subsystem" but not yet concrete...
Definition: ForceSubsystem.h:36
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition: CompliantContactSubsystem.h:387
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72