Simbody 3.7
Loading...
Searching...
No Matches
CompliantContactSubsystem.h
Go to the documentation of this file.
1#ifndef SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
2#define SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
3
4/* -------------------------------------------------------------------------- *
5 * Simbody(tm) *
6 * -------------------------------------------------------------------------- *
7 * This is part of the SimTK biosimulation toolkit originating from *
8 * Simbios, the NIH National Center for Physics-Based Simulation of *
9 * Biological Structures at Stanford, funded under the NIH Roadmap for *
10 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11 * *
12 * Portions copyright (c) 2008-13 Stanford University and the Authors. *
13 * Authors: Peter Eastman, Michael Sherman *
14 * Contributors: *
15 * *
16 * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17 * not use this file except in compliance with the License. You may obtain a *
18 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19 * *
20 * Unless required by applicable law or agreed to in writing, software *
21 * distributed under the License is distributed on an "AS IS" BASIS, *
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23 * See the License for the specific language governing permissions and *
24 * limitations under the License. *
25 * -------------------------------------------------------------------------- */
26
27#include "SimTKmath.h"
30
31#include <cassert>
32
33namespace SimTK {
34
35class MultibodySystem;
36class SimbodyMatterSubsystem;
37class ContactTrackerSubsystem;
38class ContactForceGenerator;
39class Contact;
40class ContactForce;
41class ContactPatch;
42
43
44
45//==============================================================================
46// COMPLIANT CONTACT SUBSYSTEM
47//==============================================================================
54public:
57
65
72
81void setTrackDissipatedEnergy(bool shouldTrack);
87
92int getNumContactForces(const State& state) const;
99const ContactForce& getContactForce(const State& state, int n) const;
107const ContactForce& getContactForceById(const State& state, ContactId id) const;
108
137 ContactId id,
138 ContactPatch& patch) const;
139
170Real getDissipatedEnergy(const State& state) const;
171
192void setDissipatedEnergy(State& state, Real energy) const;
193
194
200
206
210
215
221
225
231
237
// don't show in Doxygen docs
242//--------------------------------------------------------------------------
243 private:
244class CompliantContactSubsystemImpl& updImpl();
245const CompliantContactSubsystemImpl& getImpl() const;
246};
247
248
249
250//==============================================================================
251// CONTACT FORCE
252//==============================================================================
302public:
304ContactForce() {} // invalid
305
310ContactForce(ContactId id, const Vec3& contactPt,
311 const SpatialVec& forceOnSurface2,
312 Real potentialEnergy, Real powerLoss)
313: m_contactId(id), m_contactPt(contactPt),
314 m_forceOnSurface2(forceOnSurface2),
315 m_potentialEnergy(potentialEnergy), m_powerLoss(powerLoss) {}
316
318ContactId getContactId() const {return m_contactId;}
322const Vec3& getContactPoint() const {return m_contactPt;}
326const SpatialVec& getForceOnSurface2() const {return m_forceOnSurface2;}
329Real getPotentialEnergy() const {return m_potentialEnergy;}
333Real getPowerDissipation() const {return m_powerLoss;}
334
340void setTo(ContactId id, const Vec3& contactPt,
341 const SpatialVec& forceOnSurface2,
342 Real potentialEnergy, Real powerLoss)
343{ m_contactId = id;
344 m_contactPt = contactPt;
345 m_forceOnSurface2 = forceOnSurface2;
346 m_potentialEnergy = potentialEnergy;
347 m_powerLoss = powerLoss; }
348
350void setContactId(ContactId id) {m_contactId=id;}
352void setContactPoint(const Vec3& contactPt) {m_contactPt=contactPt;}
355void setForceOnSurface2(const SpatialVec& forceOnSurface2)
356{ m_forceOnSurface2=forceOnSurface2; }
358void setPotentialEnergy(Real potentialEnergy)
359{ m_potentialEnergy=potentialEnergy; }
361void setPowerDissipation(Real powerLoss) {m_powerLoss=powerLoss;}
362
365void clear() {m_contactId.invalidate();}
367bool isValid() const {return m_contactId.isValid();}
368
373void changeFrameInPlace(const Transform& X_BA) {
374 m_contactPt = X_BA*m_contactPt; // shift & reexpress in B
375 m_forceOnSurface2 = X_BA.R()*m_forceOnSurface2; // reexpress in B
376}
377
378private:
379ContactId m_contactId; // Which Contact produced this force?
380Vec3 m_contactPt; // In some frame A
381SpatialVec m_forceOnSurface2; // at contact pt, in A; neg. for Surf1
382Real m_potentialEnergy; // > 0 when due to compression
383Real m_powerLoss; // > 0 means dissipation
384};
385
386// For debugging.
387inline std::ostream& operator<<(std::ostream& o, const ContactForce& f) {
388 o << "ContactForce for ContactId " << f.getContactId() << " (ground frame):\n";
389 o << " contact point=" << f.getContactPoint() << "\n";
390 o << " force on surf2 =" << f.getForceOnSurface2() << "\n";
391 o << " pot. energy=" << f.getPotentialEnergy()
392 << " powerLoss=" << f.getPowerDissipation();
393 return o << "\n";
394}
395
396//==============================================================================
397// CONTACT DETAIL
398//==============================================================================
465public:
468const Vec3& getContactPoint() const {return m_contactPt;}
476const Vec3& getSlipVelocity() const {return m_slipVelocity;}
505
506
510void changeFrameInPlace(const Transform& X_BA) {
511 const Rotation& R_BA = X_BA.R();
512 m_contactPt = X_BA*m_contactPt; // shift & reexpress in B (18 flops)
513 m_patchNormal = R_BA*m_patchNormal; // reexpress only (3*15 flops)
514 m_slipVelocity = R_BA*m_slipVelocity; // "
516}
517
522 const Rotation& R_BA = X_BA.R();
523 m_contactPt = X_BA*m_contactPt; // shift & reexpress in B (18 flops)
524 m_patchNormal = R_BA*(-m_patchNormal); // reverse & reexpress (3*18 flops)
525 m_slipVelocity = R_BA*(-m_slipVelocity); // "
527}
528
529Vec3 m_contactPt; // location of contact point C in A
530UnitVec3 m_patchNormal; // points outwards from body 1, exp. in A
531Vec3 m_slipVelocity; // material slip rate, perp. to normal, in A
532Vec3 m_forceOnSurface2; // applied at C, -force to surf1
533Real m_deformation; // total normal compression (approach)
534Real m_deformationRate; // d/dt deformation, w.r.t. A frame
536Real m_peakPressure; // > 0 in compression
537Real m_potentialEnergy; // > 0 when due to compression
538Real m_powerLoss; // > 0 means dissipation
539};
540
541// For debugging.
542inline std::ostream& operator<<(std::ostream& o, const ContactDetail& d) {
543 o << "ContactDetail (ground frame):\n";
544 o << " contact point=" << d.m_contactPt << "\n";
545 o << " contact normal=" << d.m_patchNormal << "\n";
546 o << " slip velocity=" << d.m_slipVelocity << "\n";
547 o << " force on surf2 =" << d.m_forceOnSurface2 << "\n";
548 o << " deformation=" << d.m_deformation
549 << " deformation rate=" << d.m_deformationRate << "\n";
550 o << " patch area=" << d.m_patchArea
551 << " peak pressure=" << d.m_peakPressure << "\n";
552 o << " pot. energy=" << d.m_potentialEnergy << " powerLoss=" << d.m_powerLoss;
553 return o << "\n";
554}
555
556
557
558//==============================================================================
559// CONTACT PATCH
560//==============================================================================
582public:
583void clear() {m_resultant.clear(); m_elements.clear();}
584bool isValid() const {return m_resultant.isValid();}
585const ContactForce& getContactForce() const {return m_resultant;}
586int getNumDetails() const {return (int)m_elements.size();}
587const ContactDetail& getContactDetail(int n) const {return m_elements[n];}
588
592void changeFrameInPlace(const Transform& X_BA) {
593 m_resultant.changeFrameInPlace(X_BA);
594 for (unsigned i=0; i<m_elements.size(); ++i)
595 m_elements[i].changeFrameInPlace(X_BA);
596}
597
600};
601
602
603
604//==============================================================================
605// CONTACT FORCE GENERATOR
606//==============================================================================
616public:
617// Reasonably good physically-based compliant contact models.
618class ElasticFoundation; // for TriangleMeshContact
619class HertzCircular; // for CircularPointContact
620class HertzElliptical; // for EllipticalPointContact
621
622// Penalty-based models enforcing non-penetration but without attempting
623// to model the contacting materials physically.
624class BrickHalfSpacePenalty; // for BrickHalfSpaceContact
625
626// These are for response to unknown ContactTypeIds.
627class DoNothing; // do nothing if called
628class ThrowError; // throw an error if called
629
631explicit ContactForceGenerator(ContactTypeId type): m_contactType(type) {}
632
636ContactTypeId getContactTypeId() const {return m_contactType;}
637
639{ assert(m_compliantContactSubsys); return *m_compliantContactSubsys; }
641{ m_compliantContactSubsys = sub; }
642
645
657 (const State& state,
658 const Contact& overlapping,
659 const SpatialVec& V_S1S2, // relative surface velocity (S2 in S1)
660 ContactForce& contactForce) const = 0;
661
669 (const State& state,
670 const Contact& overlapping,
671 const SpatialVec& V_S1S2, // relative surface velocity (S2 in S1)
672 ContactPatch& patch) const = 0;
673
674
675//--------------------------------------------------------------------------
676private:
677 // This generator should be called only for Contact objects of the
678 // indicated type id.
679 ContactTypeId m_contactType;
680 // This is a reference to the owning CompliantContactSubsystem if any;
681 // don't delete on destruction.
682 const CompliantContactSubsystem* m_compliantContactSubsys;
683};
684
685
686
687
688//==============================================================================
689// HERTZ CIRCULAR GENERATOR
690//==============================================================================
691
698: public ContactForceGenerator {
699public:
702
704 (const State& state,
705 const Contact& overlapping,
706 const SpatialVec& V_S1S2,
707 ContactForce& contactForce) const override;
708
710 (const State& state,
711 const Contact& overlapping,
712 const SpatialVec& V_S1S2,
713 ContactPatch& patch) const override;
714};
715
716
717
718//==============================================================================
719// HERTZ ELLIPTICAL GENERATOR
720//==============================================================================
721
728: public ContactForceGenerator {
729public:
732
734 (const State& state,
735 const Contact& overlapping,
736 const SpatialVec& V_S1S2,
737 ContactForce& contactForce) const override;
738
740 (const State& state,
741 const Contact& overlapping,
742 const SpatialVec& V_S1S2,
743 ContactPatch& patch) const override;
744};
745
746
747
748
749//==============================================================================
750// BRICK HALFSPACE GENERATOR
751//==============================================================================
752
756: public ContactForceGenerator {
757public:
760
762 (const State& state,
763 const Contact& overlapping,
764 const SpatialVec& V_S1S2,
765 ContactForce& contactForce) const override;
766
768 (const State& state,
769 const Contact& overlapping,
770 const SpatialVec& V_S1S2,
771 ContactPatch& patch) const override;
772};
773
774
775
776//==============================================================================
777// ELASTIC FOUNDATION GENERATOR
778//==============================================================================
783: public ContactForceGenerator {
784public:
787
789 (const State& state,
790 const Contact& overlapping,
791 const SpatialVec& V_S1S2,
792 ContactForce& contactForce) const override;
793
795 (const State& state,
796 const Contact& overlapping,
797 const SpatialVec& V_S1S2,
798 ContactPatch& patch) const override;
799
800private:
801void calcContactForceAndDetails
802 (const State& state,
803 const Contact& overlapping,
804 const SpatialVec& V_S1S2,
805 ContactForce& contactForce,
806 Array_<ContactDetail>* contactDetails) const;
807
808void calcWeightedPatchCentroid
810 const std::set<int>& insideFaces,
811 Vec3& weightedPatchCentroid,
812 Real& patchArea) const;
813
814void processOneMesh
815 (const State& state,
817 const std::set<int>& insideFaces,
818 const Transform& X_MO,
819 const SpatialVec& V_MO,
820 const ContactGeometry& other,
821 Real meshDeformationFraction, // 0..1
822 Real areaScaleFactor, // >= 0
823 Real k, Real c, Real us, Real ud, Real uv,
824 const Vec3& resultantPt_M, // where to apply forces
825 SpatialVec& resultantForceOnOther_M, // at resultant pt
826 Real& potentialEnergy,
827 Real& powerLoss,
828 Vec3& weightedCenterOfPressure_M, // COP
829 Real& sumOfAllPressureMoments, // COP weight
830 Array_<ContactDetail>* contactDetails) const;
831};
832
833
834
835
836//==============================================================================
837// DO NOTHING FORCE GENERATOR
838//==============================================================================
843: public ContactForceGenerator {
844public:
847
849 (const State& state,
850 const Contact& overlapping,
851 const SpatialVec& V_S1S2,
852 ContactForce& contactForce) const override
853{ SimTK_ASSERT_ALWAYS(!"implemented",
854 "ContactForceGenerator::DoNothing::calcContactForce() not implemented yet."); }
856 (const State& state,
857 const Contact& overlapping,
858 const SpatialVec& V_S1S2,
859 ContactPatch& patch) const override
860{ SimTK_ASSERT_ALWAYS(!"implemented",
861 "ContactForceGenerator::DoNothing::calcContactPatch() not implemented yet."); }
862};
863
864
865
866//==============================================================================
867// THROW ERROR FORCE GENERATOR
868//==============================================================================
874: public ContactForceGenerator {
875public:
878
880 (const State& state,
881 const Contact& overlapping,
882 const SpatialVec& V_S1S2,
883 ContactForce& contactForce) const override
884{ SimTK_ASSERT_ALWAYS(!"implemented",
885 "ContactForceGenerator::ThrowError::calcContactForce() not implemented yet."); }
887 (const State& state,
888 const Contact& overlapping,
889 const SpatialVec& V_S1S2,
890 ContactPatch& patch) const override
891{ SimTK_ASSERT_ALWAYS(!"implemented",
892 "ContactForceGenerator::ThrowError::calcContactPatch() not implemented yet."); }
893};
894
895} // namespace SimTK
896
897#endif // SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
#define SimTK_ASSERT_ALWAYS(cond, msg)
Definition ExceptionMacros.h:349
#define SimTK_PIMPL_DOWNCAST(Derived, Parent)
Similar to the above but for private implementation abstract classes, that is, abstract class hierarc...
Definition SimTKcommon/include/SimTKcommon/internal/common.h:593
Every Simbody header and source file should include this header before any other Simbody header.
#define SimTK_SIMBODY_EXPORT
Definition Simbody/include/simbody/internal/common.h:68
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition Array.h:1520
This subclass of Contact is used when one ContactGeometry object is a half plane and the other is a B...
Definition Contact.h:418
This subclass of Contact represents a contact between two non-conforming surfaces 1 and 2 that initia...
Definition Contact.h:260
This is a force subsystem that implements a compliant contact model to respond to Contact objects as ...
Definition CompliantContactSubsystem.h:53
void adoptDefaultForceGenerator(ContactForceGenerator *generator)
Attach a new generator to this subsystem as the responder to be used when we see a Contact type for w...
void setTrackDissipatedEnergy(bool shouldTrack)
Specify whether to track energy dissipated by contacts.
const MultibodySystem & getMultibodySystem() const
Every Subsystem is owned by a System; a CompliantContactSubsystem expects to be owned by a MultibodyS...
void setTransitionVelocity(Real vt)
Set the transition velocity (vt) of the friction model.
const ContactForceGenerator & getContactForceGenerator(ContactTypeId contact) const
Return the force generator to be used for a Contact of the indicated type.
int getNumContactForces(const State &state) const
Determine how many of the active Contacts are currently generating contact forces.
bool getTrackDissipatedEnergy() const
Obtain the current setting of the "track dissipated energy" flag.
bool hasDefaultForceGenerator() const
Return true if this subsystem has a force generator registered that can be used for response to an un...
const ContactTrackerSubsystem & getContactTrackerSubsystem() const
Get a read-only reference to the ContactTrackerSubsystem associated with this CompliantContactSubsyst...
CompliantContactSubsystem()
Default constructor creates an empty handle.
Definition CompliantContactSubsystem.h:56
void adoptForceGenerator(ContactForceGenerator *generator)
Attach a new generator to this subsystem as the responder to be used when we see the kind of Contact ...
Real getTransitionVelocity() const
Get the transition velocity (vt) of the friction model.
bool calcContactPatchDetailsById(const State &state, ContactId id, ContactPatch &patch) const
Calculate detailed information about a particular active contact patch, including deformed geometric ...
Real getOOTransitionVelocity() const
Get a precalculated 1/vt to avoid expensive runtime divisions.
const ContactForceGenerator & getDefaultForceGenerator() const
Return the force generator to be used for a Contact type for which no suitable force generator has be...
CompliantContactSubsystem(MultibodySystem &, const ContactTrackerSubsystem &)
Add a new CompliantContactSubsystem to the indicated MultibodySystem, specifying the ContactTrackerSu...
const ContactForce & getContactForce(const State &state, int n) const
For each active Contact, get a reference to the most recently calculated force there; the ContactId t...
bool hasForceGenerator(ContactTypeId contact) const
Return true if this subsystem has a force generator registered that can respond to this kind of Conta...
void setDissipatedEnergy(State &state, Real energy) const
Set the accumulated dissipated energy to an arbitrary value.
const ContactForce & getContactForceById(const State &state, ContactId id) const
Get a reference to the ContactForce currently being produced by a particular ContactId; if that Conta...
Real getDissipatedEnergy(const State &state) const
Obtain the total amount of energy dissipated by all the contact responses that were generated by this...
This provides deformed geometry and force details for one element of a contact patch that may be comp...
Definition CompliantContactSubsystem.h:464
Real m_powerLoss
Definition CompliantContactSubsystem.h:538
UnitVec3 m_patchNormal
Definition CompliantContactSubsystem.h:530
const UnitVec3 & getContactNormal() const
This is the normal direction for this contact element, pointing away from body 1's exterior and towar...
Definition CompliantContactSubsystem.h:472
Real m_deformation
Definition CompliantContactSubsystem.h:533
Vec3 m_slipVelocity
Definition CompliantContactSubsystem.h:531
Real getPowerDissipation() const
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this...
Definition CompliantContactSubsystem.h:504
void changeFrameAndSwitchSurfacesInPlace(const Transform &X_BA)
Assuming that this object is currently reporting surface 2 information in frame A,...
Definition CompliantContactSubsystem.h:521
Real m_peakPressure
Definition CompliantContactSubsystem.h:536
const Vec3 & getSlipVelocity() const
Get the relative slip velocity between the bodies at the contact point, as body 2's velocity in body ...
Definition CompliantContactSubsystem.h:476
Real getPatchArea() const
This is the surface area represented by this contact element.
Definition CompliantContactSubsystem.h:493
Real getDeformationRate() const
Get the instantaneous rate at which the material at the contact point is deforming; this is the mater...
Definition CompliantContactSubsystem.h:491
Vec3 m_contactPt
Definition CompliantContactSubsystem.h:529
const Vec3 & getForceOnSurface2() const
Get the total force applied to body 2 at the contact point by this contact element; negate this to fi...
Definition CompliantContactSubsystem.h:479
const Vec3 & getContactPoint() const
This is the point at which this contact element applies equal and opposite forces to the two bodies.
Definition CompliantContactSubsystem.h:468
Real m_deformationRate
Definition CompliantContactSubsystem.h:534
Real getPotentialEnergy() const
Get the amount of potential energy currently stored in the deformation of this contact element.
Definition CompliantContactSubsystem.h:500
Real getDeformation() const
Get the total normal material deformation at the contact point; this is the sum of the deformations o...
Definition CompliantContactSubsystem.h:485
Vec3 m_forceOnSurface2
Definition CompliantContactSubsystem.h:532
void changeFrameInPlace(const Transform &X_BA)
This object is currently in an assumed frame A; given a transform from another frame B to A we'll re-...
Definition CompliantContactSubsystem.h:510
Real m_patchArea
Definition CompliantContactSubsystem.h:535
Real getPeakPressure() const
This is the peak pressure on this element; typically it is just the normal force divided by the patch...
Definition CompliantContactSubsystem.h:497
Real m_potentialEnergy
Definition CompliantContactSubsystem.h:537
This ContactForceGenerator handles contact between a brick and a half-space.
Definition CompliantContactSubsystem.h:756
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
BrickHalfSpacePenalty()
Definition CompliantContactSubsystem.h:758
This ContactForceGenerator silently does nothing.
Definition CompliantContactSubsystem.h:843
DoNothing(ContactTypeId type=ContactTypeId(0))
Definition CompliantContactSubsystem.h:845
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
Definition CompliantContactSubsystem.h:856
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
Definition CompliantContactSubsystem.h:849
This ContactForceGenerator handles contact between a TriangleMesh and a variety of other geometric ob...
Definition CompliantContactSubsystem.h:783
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
ElasticFoundation()
Definition CompliantContactSubsystem.h:785
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
This ContactForceGenerator handles contact between non-conforming objects that meet at a point and ge...
Definition CompliantContactSubsystem.h:698
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
HertzCircular()
Definition CompliantContactSubsystem.h:700
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
This ContactForceGenerator handles contact between non-conforming objects that meet at a point and ge...
Definition CompliantContactSubsystem.h:728
HertzElliptical()
Definition CompliantContactSubsystem.h:730
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
This ContactForceGenerator throws an error if it is every invoked.
Definition CompliantContactSubsystem.h:874
void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const override
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
Definition CompliantContactSubsystem.h:880
void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const override
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
Definition CompliantContactSubsystem.h:887
ThrowError(ContactTypeId type=ContactTypeId(0))
Definition CompliantContactSubsystem.h:876
A ContactForceGenerator implements an algorithm for responding to overlaps or potential overlaps betw...
Definition CompliantContactSubsystem.h:615
ContactTypeId getContactTypeId() const
Return the ContactTypeId handled by this force generator.
Definition CompliantContactSubsystem.h:636
virtual ~ContactForceGenerator()
Base class destructor is virtual but does nothing.
Definition CompliantContactSubsystem.h:644
virtual void calcContactForce(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactForce &contactForce) const =0
The CompliantContactSubsystem will invoke this method on any active contact pair of the right Contact...
void setCompliantContactSubsystem(const CompliantContactSubsystem *sub)
Definition CompliantContactSubsystem.h:640
ContactForceGenerator(ContactTypeId type)
Base class constructor for use by the concrete classes.
Definition CompliantContactSubsystem.h:631
virtual void calcContactPatch(const State &state, const Contact &overlapping, const SpatialVec &V_S1S2, ContactPatch &patch) const =0
The CompliantContactSubsystem will invoke this method in response to a user request for contact patch...
const CompliantContactSubsystem & getCompliantContactSubsystem() const
Definition CompliantContactSubsystem.h:638
This is a simple class containing the basic force information for a single contact between deformable...
Definition CompliantContactSubsystem.h:301
Real getPotentialEnergy() const
Get the amount of potential energy currently stored in the deformation of this contact patch.
Definition CompliantContactSubsystem.h:329
void setContactId(ContactId id)
Change the ContactId contained in this ContactForce object.
Definition CompliantContactSubsystem.h:350
ContactId getContactId() const
Return the ContactId of the Contact that generated this ContactForce.
Definition CompliantContactSubsystem.h:318
void setTo(ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)
Replace the current contents of this ContactForce object with the given arguments.
Definition CompliantContactSubsystem.h:340
void clear()
Restore the ContactForce object to its default-constructed state with an invalid contact id and garba...
Definition CompliantContactSubsystem.h:365
void setPowerDissipation(Real powerLoss)
Change the value stored for power loss in this ContactForce object.
Definition CompliantContactSubsystem.h:361
const SpatialVec & getForceOnSurface2() const
Get the total spatial force applied to body 2 at the contact point (that is, a force and a moment); n...
Definition CompliantContactSubsystem.h:326
void setForceOnSurface2(const SpatialVec &forceOnSurface2)
Change the value stored in this ContactForce object for the spatial force being applied on surface 2.
Definition CompliantContactSubsystem.h:355
void changeFrameInPlace(const Transform &X_BA)
This object is currently in an assumed frame A; given a transform from another frame B to A we'll re-...
Definition CompliantContactSubsystem.h:373
void setContactPoint(const Vec3 &contactPt)
Change the contact point contained in this ContactForce object.
Definition CompliantContactSubsystem.h:352
ContactForce(ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)
Construct with values for all fields.
Definition CompliantContactSubsystem.h:310
Real getPowerDissipation() const
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this...
Definition CompliantContactSubsystem.h:333
ContactForce()
Default constructor has invalid contact id, other fields garbage.
Definition CompliantContactSubsystem.h:304
const Vec3 & getContactPoint() const
This is the point at which this contact element applies equal and opposite forces to the two bodies,...
Definition CompliantContactSubsystem.h:322
void setPotentialEnergy(Real potentialEnergy)
Change the value stored for potential energy in this ContactForce object.
Definition CompliantContactSubsystem.h:358
bool isValid() const
Return true if this contact force contains a valid ContactId.
Definition CompliantContactSubsystem.h:367
This ContactGeometry subclass represents an arbitrary shape described by a mesh of triangular faces.
Definition ContactGeometry.h:1164
A ContactGeometry object describes the shape of all or part of the boundary of a solid object,...
Definition ContactGeometry.h:110
This is a unique integer Id assigned to each contact pair when we first begin to track it.
A ContactPatch is the description of the forces and the deformed shape of the contact surfaces that r...
Definition CompliantContactSubsystem.h:581
void changeFrameInPlace(const Transform &X_BA)
This object is currently in an assumed frame A; given a transform from another frame B to A we'll re-...
Definition CompliantContactSubsystem.h:592
int getNumDetails() const
Definition CompliantContactSubsystem.h:586
void clear()
Definition CompliantContactSubsystem.h:583
const ContactForce & getContactForce() const
Definition CompliantContactSubsystem.h:585
Array_< ContactDetail > m_elements
Definition CompliantContactSubsystem.h:599
ContactForce m_resultant
Definition CompliantContactSubsystem.h:598
const ContactDetail & getContactDetail(int n) const
Definition CompliantContactSubsystem.h:587
bool isValid() const
Definition CompliantContactSubsystem.h:584
This subsystem identifies and tracks potential contacts between the mobilized bodies of a multibody s...
Definition ContactTrackerSubsystem.h:148
This is a small integer that serves as the unique typeid for each type of concrete Contact class.
A Contact contains information about the spatial relationship between two surfaces that are near,...
Definition Contact.h:85
This subclass of Contact represents a contact between two non-conforming surfaces 1 and 2 that initia...
Definition Contact.h:355
This is logically an abstract class, more specialized than "Subsystem" but not yet concrete.
Definition ForceSubsystem.h:36
The job of the MultibodySystem class is to coordinate the activities of various subsystems which can ...
Definition MultibodySystem.h:48
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition State.h:280
const Rotation_< P > & R() const
Return a read-only reference to the contained rotation R_BF.
Definition Transform.h:215
This subclass of Contact is used when one or both of the ContactGeometry objects is a TriangleMesh.
Definition Contact.h:478
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition Assembler.h:37
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition CompliantContactSubsystem.h:387
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition SimTKcommon/include/SimTKcommon/internal/common.h:606