Simbody  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
33 namespace SimTK {
34 
35 class MultibodySystem;
36 class SimbodyMatterSubsystem;
37 class ContactTrackerSubsystem;
38 class ContactForceGenerator;
39 class Contact;
40 class ContactForce;
41 class ContactPatch;
42 
43 
44 
45 //==============================================================================
46 // COMPLIANT CONTACT SUBSYSTEM
47 //==============================================================================
54 public:
57 
65 
67 Real getTransitionVelocity() const;
69 void setTransitionVelocity(Real vt);
71 Real getOOTransitionVelocity() const;
72 
81 void setTrackDissipatedEnergy(bool shouldTrack);
86 bool getTrackDissipatedEnergy() const;
87 
92 int getNumContactForces(const State& state) const;
99 const ContactForce& getContactForce(const State& state, int n) const;
107 const ContactForce& getContactForceById(const State& state, ContactId id) const;
108 
136 bool calcContactPatchDetailsById(const State& state,
137  ContactId id,
138  ContactPatch& patch) const;
139 
170 Real getDissipatedEnergy(const State& state) const;
171 
192 void setDissipatedEnergy(State& state, Real energy) const;
193 
194 
199 void adoptForceGenerator(ContactForceGenerator* generator);
200 
205 void adoptDefaultForceGenerator(ContactForceGenerator* generator);
206 
209 bool hasForceGenerator(ContactTypeId contact) const;
210 
214 bool hasDefaultForceGenerator() const;
215 
219 const ContactForceGenerator&
220  getContactForceGenerator(ContactTypeId contact) const;
221 
224 const ContactForceGenerator& getDefaultForceGenerator() const;
225 
230 const ContactTrackerSubsystem& getContactTrackerSubsystem() const;
231 
236 const MultibodySystem& getMultibodySystem() const;
237  // don't show in Doxygen docs
239 SimTK_PIMPL_DOWNCAST(CompliantContactSubsystem, ForceSubsystem);
242 //--------------------------------------------------------------------------
243  private:
244 class CompliantContactSubsystemImpl& updImpl();
245 const CompliantContactSubsystemImpl& getImpl() const;
246 };
247 
248 
249 
250 //==============================================================================
251 // CONTACT FORCE
252 //==============================================================================
302 public:
304 ContactForce() {} // invalid
305 
310 ContactForce(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 
318 ContactId getContactId() const {return m_contactId;}
322 const Vec3& getContactPoint() const {return m_contactPt;}
326 const SpatialVec& getForceOnSurface2() const {return m_forceOnSurface2;}
329 Real getPotentialEnergy() const {return m_potentialEnergy;}
333 Real getPowerDissipation() const {return m_powerLoss;}
334 
340 void 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 
350 void setContactId(ContactId id) {m_contactId=id;}
352 void setContactPoint(const Vec3& contactPt) {m_contactPt=contactPt;}
355 void setForceOnSurface2(const SpatialVec& forceOnSurface2)
356 { m_forceOnSurface2=forceOnSurface2; }
358 void setPotentialEnergy(Real potentialEnergy)
359 { m_potentialEnergy=potentialEnergy; }
361 void setPowerDissipation(Real powerLoss) {m_powerLoss=powerLoss;}
362 
365 void clear() {m_contactId.invalidate();}
367 bool isValid() const {return m_contactId.isValid();}
368 
373 void 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 
378 private:
379 ContactId m_contactId; // Which Contact produced this force?
380 Vec3 m_contactPt; // In some frame A
381 SpatialVec m_forceOnSurface2; // at contact pt, in A; neg. for Surf1
382 Real m_potentialEnergy; // > 0 when due to compression
383 Real m_powerLoss; // > 0 means dissipation
384 };
385 
386 // For debugging.
387 inline 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 //==============================================================================
465 public:
468 const Vec3& getContactPoint() const {return m_contactPt;}
472 const UnitVec3& getContactNormal() const {return m_patchNormal;}
476 const Vec3& getSlipVelocity() const {return m_slipVelocity;}
479 const Vec3& getForceOnSurface2() const {return m_forceOnSurface2;}
485 Real getDeformation() const {return m_deformation;}
491 Real getDeformationRate() const {return m_deformationRate;}
493 Real getPatchArea() const {return m_patchArea;}
497 Real getPeakPressure() const {return m_peakPressure;}
500 Real getPotentialEnergy() const {return m_potentialEnergy;}
504 Real getPowerDissipation() const {return m_powerLoss;}
505 
506 
510 void 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); // "
526  m_forceOnSurface2 = R_BA*(-m_forceOnSurface2); // "
527 }
528 
529 Vec3 m_contactPt; // location of contact point C in A
530 UnitVec3 m_patchNormal; // points outwards from body 1, exp. in A
531 Vec3 m_slipVelocity; // material slip rate, perp. to normal, in A
532 Vec3 m_forceOnSurface2; // applied at C, -force to surf1
533 Real m_deformation; // total normal compression (approach)
534 Real m_deformationRate; // d/dt deformation, w.r.t. A frame
535 Real m_patchArea; // >= 0
536 Real m_peakPressure; // > 0 in compression
537 Real m_potentialEnergy; // > 0 when due to compression
538 Real m_powerLoss; // > 0 means dissipation
539 };
540 
541 // For debugging.
542 inline 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 //==============================================================================
582 public:
583 void clear() {m_resultant.clear(); m_elements.clear();}
584 bool isValid() const {return m_resultant.isValid();}
585 const ContactForce& getContactForce() const {return m_resultant;}
586 int getNumDetails() const {return (int)m_elements.size();}
587 const ContactDetail& getContactDetail(int n) const {return m_elements[n];}
588 
592 void 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 //==============================================================================
616 public:
617 class ElasticFoundation; // for TriangleMeshContact
618 class HertzCircular; // for PointContact
619 class HertzElliptical; // for EllipticalPointContact
620 
621 // These are for response to unknown ContactTypeIds.
622 class DoNothing; // do nothing if called
623 class ThrowError; // throw an error if called
624 
626 explicit ContactForceGenerator(ContactTypeId type): m_contactType(type) {}
627 
631 ContactTypeId getContactTypeId() const {return m_contactType;}
632 
634 { assert(m_compliantContactSubsys); return *m_compliantContactSubsys; }
636 { m_compliantContactSubsys = sub; }
637 
640 
651 virtual void calcContactForce
652  (const State& state,
653  const Contact& overlapping,
654  const SpatialVec& V_S1S2, // relative surface velocity (S2 in S1)
655  ContactForce& contactForce) const = 0;
656 
663 virtual void calcContactPatch
664  (const State& state,
665  const Contact& overlapping,
666  const SpatialVec& V_S1S2, // relative surface velocity (S2 in S1)
667  ContactPatch& patch) const = 0;
668 
669 
670 //--------------------------------------------------------------------------
671 private:
672  // This generator should be called only for Contact objects of the
673  // indicated type id.
674  ContactTypeId m_contactType;
675  // This is a reference to the owning CompliantContactSubsystem if any;
676  // don't delete on destruction.
677  const CompliantContactSubsystem* m_compliantContactSubsys;
678 };
679 
680 
681 
682 
683 //==============================================================================
684 // HERTZ CIRCULAR GENERATOR
685 //==============================================================================
686 
693 : public ContactForceGenerator {
694 public:
696 : ContactForceGenerator(CircularPointContact::classTypeId()) {}
697 
698 virtual ~HertzCircular() {}
699 virtual void calcContactForce
700  (const State& state,
701  const Contact& overlapping,
702  const SpatialVec& V_S1S2,
703  ContactForce& contactForce) const;
704 
705 virtual void calcContactPatch
706  (const State& state,
707  const Contact& overlapping,
708  const SpatialVec& V_S1S2,
709  ContactPatch& patch) const;
710 };
711 
712 
713 
714 //==============================================================================
715 // HERTZ ELLIPTICAL GENERATOR
716 //==============================================================================
717 
724 : public ContactForceGenerator {
725 public:
728 
729 virtual ~HertzElliptical() {}
730 virtual void calcContactForce
731  (const State& state,
732  const Contact& overlapping,
733  const SpatialVec& V_S1S2,
734  ContactForce& contactForce) const;
735 
736 virtual void calcContactPatch
737  (const State& state,
738  const Contact& overlapping,
739  const SpatialVec& V_S1S2,
740  ContactPatch& patch) const;
741 };
742 
743 
744 
745 //==============================================================================
746 // ELASTIC FOUNDATION GENERATOR
747 //==============================================================================
752 : public ContactForceGenerator {
753 public:
755 : ContactForceGenerator(TriangleMeshContact::classTypeId()) {}
756 virtual ~ElasticFoundation() {}
757 virtual void calcContactForce
758  (const State& state,
759  const Contact& overlapping,
760  const SpatialVec& V_S1S2,
761  ContactForce& contactForce) const;
762 
763 virtual void calcContactPatch
764  (const State& state,
765  const Contact& overlapping,
766  const SpatialVec& V_S1S2,
767  ContactPatch& patch) const;
768 
769 private:
770 void calcContactForceAndDetails
771  (const State& state,
772  const Contact& overlapping,
773  const SpatialVec& V_S1S2,
774  ContactForce& contactForce,
775  Array_<ContactDetail>* contactDetails) const;
776 
777 void calcWeightedPatchCentroid
778  (const ContactGeometry::TriangleMesh& mesh,
779  const std::set<int>& insideFaces,
780  Vec3& weightedPatchCentroid,
781  Real& patchArea) const;
782 
783 void processOneMesh
784  (const State& state,
785  const ContactGeometry::TriangleMesh& mesh,
786  const std::set<int>& insideFaces,
787  const Transform& X_MO,
788  const SpatialVec& V_MO,
789  const ContactGeometry& other,
790  Real meshDeformationFraction, // 0..1
791  Real areaScaleFactor, // >= 0
792  Real k, Real c, Real us, Real ud, Real uv,
793  const Vec3& resultantPt_M, // where to apply forces
794  SpatialVec& resultantForceOnOther_M, // at resultant pt
795  Real& potentialEnergy,
796  Real& powerLoss,
797  Vec3& weightedCenterOfPressure_M, // COP
798  Real& sumOfAllPressureMoments, // COP weight
799  Array_<ContactDetail>* contactDetails) const;
800 };
801 
802 
803 
804 
805 //==============================================================================
806 // DO NOTHING FORCE GENERATOR
807 //==============================================================================
812 : public ContactForceGenerator {
813 public:
815 : ContactForceGenerator(type) {}
816 virtual ~DoNothing() {}
817 virtual void calcContactForce
818  (const State& state,
819  const Contact& overlapping,
820  const SpatialVec& V_S1S2,
821  ContactForce& contactForce) const
822 { SimTK_ASSERT_ALWAYS(!"implemented",
823  "ContactForceGenerator::DoNothing::calcContactForce() not implemented yet."); }
824 virtual void calcContactPatch
825  (const State& state,
826  const Contact& overlapping,
827  const SpatialVec& V_S1S2,
828  ContactPatch& patch) const
829 { SimTK_ASSERT_ALWAYS(!"implemented",
830  "ContactForceGenerator::DoNothing::calcContactPatch() not implemented yet."); }
831 };
832 
833 
834 
835 //==============================================================================
836 // THROW ERROR FORCE GENERATOR
837 //==============================================================================
843 : public ContactForceGenerator {
844 public:
846 : ContactForceGenerator(type) {}
847 virtual ~ThrowError() {}
848 virtual void calcContactForce
849  (const State& state,
850  const Contact& overlapping,
851  const SpatialVec& V_S1S2,
852  ContactForce& contactForce) const
853 { SimTK_ASSERT_ALWAYS(!"implemented",
854  "ContactForceGenerator::ThrowError::calcContactForce() not implemented yet."); }
855 virtual void calcContactPatch
856  (const State& state,
857  const Contact& overlapping,
858  const SpatialVec& V_S1S2,
859  ContactPatch& patch) const
860 { SimTK_ASSERT_ALWAYS(!"implemented",
861  "ContactForceGenerator::ThrowError::calcContactPatch() not implemented yet."); }
862 };
863 
864 } // namespace SimTK
865 
866 #endif // SimTK_SIMBODY_COMPLIANT_CONTACT_SUBSYSTEM_H_
This is a simple class containing the basic force information for a single contact between deformable...
Definition: CompliantContactSubsystem.h:301
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
void setCompliantContactSubsystem(const CompliantContactSubsystem *sub)
Definition: CompliantContactSubsystem.h:635
virtual ~HertzElliptical()
Definition: CompliantContactSubsystem.h:729
Real getPowerDissipation() const
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this...
Definition: CompliantContactSubsystem.h:333
void setContactPoint(const Vec3 &contactPt)
Change the contact point contained in this ContactForce object.
Definition: CompliantContactSubsystem.h:352
void setPotentialEnergy(Real potentialEnergy)
Change the value stored for potential energy in this ContactForce object.
Definition: CompliantContactSubsystem.h:358
Array_< ContactDetail > m_elements
Definition: CompliantContactSubsystem.h:599
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 getDeformation() const
Get the total normal material deformation at the contact point; this is the sum of the deformations o...
Definition: CompliantContactSubsystem.h:485
virtual ~ContactForceGenerator()
Base class destructor is virtual but does nothing.
Definition: CompliantContactSubsystem.h:639
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
#define SimTK_ASSERT_ALWAYS(cond, msg)
Definition: ExceptionMacros.h:349
This ContactForceGenerator handles contact between a TriangleMesh and a variety of other geometric ob...
Definition: CompliantContactSubsystem.h:751
ContactForce()
Default constructor has invalid contact id, other fields garbage.
Definition: CompliantContactSubsystem.h:304
This is a small integer that serves as the unique typeid for each type of concrete Contact class...
Real m_patchArea
Definition: CompliantContactSubsystem.h:535
Real m_potentialEnergy
Definition: CompliantContactSubsystem.h:537
ContactForce(ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)
Construct with values for all fields.
Definition: CompliantContactSubsystem.h:310
Real m_powerLoss
Definition: CompliantContactSubsystem.h:538
This provides deformed geometry and force details for one element of a contact patch that may be comp...
Definition: CompliantContactSubsystem.h:464
Every Simbody header and source file should include this header before any other Simbody header...
This is a unique integer Id assigned to each contact pair when we first begin to track it...
bool isValid() const
Return true if this contact force contains a valid ContactId.
Definition: CompliantContactSubsystem.h:367
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
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_deformation
Definition: CompliantContactSubsystem.h:533
This is the handle class for the hidden State implementation.
Definition: State.h:264
This subclass of Contact is used when one or both of the ContactGeometry objects is a TriangleMesh...
Definition: Contact.h:415
This ContactForceGenerator handles contact between non-conforming objects that meet at a point and ge...
Definition: CompliantContactSubsystem.h:723
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:510
ElasticFoundation()
Definition: CompliantContactSubsystem.h:754
int getNumDetails() const
Definition: CompliantContactSubsystem.h:586
void changeFrameAndSwitchSurfacesInPlace(const Transform &X_BA)
Assuming that this object is currently reporting surface 2 information in frame A, here we want to both change the frame to B and swap which surface is to be considered as surface 2.
Definition: CompliantContactSubsystem.h:521
HertzCircular()
Definition: CompliantContactSubsystem.h:695
Real m_peakPressure
Definition: CompliantContactSubsystem.h:536
This is a force subsystem that implements a compliant contact model to respond to Contact objects as ...
Definition: CompliantContactSubsystem.h:53
This ContactGeometry subclass represents an arbitrary shape described by a mesh of triangular faces...
Definition: ContactGeometry.h:1104
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
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 clear()
Restore the ContactForce object to its default-constructed state with an invalid contact id and garba...
Definition: CompliantContactSubsystem.h:365
A ContactGeometry object describes the shape of all or part of the boundary of a solid object...
Definition: ContactGeometry.h:110
const ContactForce & getContactForce() const
Definition: CompliantContactSubsystem.h:585
This subsystem identifies and tracks potential contacts between bodies of a multibody system...
Definition: ContactTrackerSubsystem.h:147
Real getPatchArea() const
This is the surface area represented by this contact element.
Definition: CompliantContactSubsystem.h:493
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
The job of the MultibodySystem class is to coordinate the activities of various subsystems which can ...
Definition: MultibodySystem.h:48
ContactForce m_resultant
Definition: CompliantContactSubsystem.h:598
This subclass of Contact represents a contact between two non-conforming surfaces 1 and 2 that initia...
Definition: Contact.h:256
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
Real getPotentialEnergy() const
Get the amount of potential energy currently stored in the deformation of this contact element...
Definition: CompliantContactSubsystem.h:500
This ContactForceGenerator handles contact between non-conforming objects that meet at a point and ge...
Definition: CompliantContactSubsystem.h:692
This is logically an abstract class, more specialized than "Subsystem" but not yet concrete...
Definition: ForceSubsystem.h:36
HertzElliptical()
Definition: CompliantContactSubsystem.h:726
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
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition: CompliantContactSubsystem.h:387
bool isValid() const
Definition: CompliantContactSubsystem.h:584
This subclass of Contact represents a contact between two non-conforming surfaces 1 and 2 that initia...
Definition: Contact.h:351
Real getPotentialEnergy() const
Get the amount of potential energy currently stored in the deformation of this contact patch...
Definition: CompliantContactSubsystem.h:329
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
DoNothing(ContactTypeId type=ContactTypeId(0))
Definition: CompliantContactSubsystem.h:814
ThrowError(ContactTypeId type=ContactTypeId(0))
Definition: CompliantContactSubsystem.h:845
void setPowerDissipation(Real powerLoss)
Change the value stored for power loss in this ContactForce object.
Definition: CompliantContactSubsystem.h:361
virtual ~ThrowError()
Definition: CompliantContactSubsystem.h:847
ContactForceGenerator(ContactTypeId type)
Base class constructor for use by the concrete classes.
Definition: CompliantContactSubsystem.h:626
This ContactForceGenerator throws an error if it is every invoked.
Definition: CompliantContactSubsystem.h:842
ContactTypeId getContactTypeId() const
Return the ContactTypeId handled by this force generator.
Definition: CompliantContactSubsystem.h:631
virtual ~HertzCircular()
Definition: CompliantContactSubsystem.h:698
Vec3 m_slipVelocity
Definition: CompliantContactSubsystem.h:531
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
Real getPowerDissipation() const
Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this...
Definition: CompliantContactSubsystem.h:504
const ContactDetail & getContactDetail(int n) const
Definition: CompliantContactSubsystem.h:587
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72
UnitVec3 m_patchNormal
Definition: CompliantContactSubsystem.h:530
void setContactId(ContactId id)
Change the ContactId contained in this ContactForce object.
Definition: CompliantContactSubsystem.h:350
A Contact contains information about the spatial relationship between two surfaces that are near...
Definition: Contact.h:81
ContactId getContactId() const
Return the ContactId of the Contact that generated this ContactForce.
Definition: CompliantContactSubsystem.h:318
const CompliantContactSubsystem & getCompliantContactSubsystem() const
Definition: CompliantContactSubsystem.h:633
virtual ~DoNothing()
Definition: CompliantContactSubsystem.h:816
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
Real m_deformationRate
Definition: CompliantContactSubsystem.h:534
Vec3 m_forceOnSurface2
Definition: CompliantContactSubsystem.h:532
virtual ~ElasticFoundation()
Definition: CompliantContactSubsystem.h:756
This ContactForceGenerator silently does nothing.
Definition: CompliantContactSubsystem.h:811
CompliantContactSubsystem()
Default constructor creates an empty handle.
Definition: CompliantContactSubsystem.h:56
const Rotation_< P > & R() const
Return a read-only reference to the contained rotation R_BF.
Definition: Transform.h:215
A ContactForceGenerator implements an algorithm for responding to overlaps or potential overlaps betw...
Definition: CompliantContactSubsystem.h:615
Vec3 m_contactPt
Definition: CompliantContactSubsystem.h:529
void clear()
Definition: CompliantContactSubsystem.h:583