20 #ifndef _SINGLE_CONTACT_H_
21 #define _SINGLE_CONTACT_H_
23 #include <mbsim/links/contour_link.h>
27 class ContactKinematics;
28 class GeneralizedForceLaw;
29 class GeneralizedImpactLaw;
30 class FrictionForceLaw;
31 class FrictionImpactLaw;
60 const double& evalGeneralizedNormalForce() {
if(updlaN) updateGeneralizedNormalForce();
return lambdaN; }
61 const fmatvec::VecV& evalGeneralizedTangentialForce() {
if(updlaT) updateGeneralizedTangentialForce();
return lambdaT; }
63 double& getGeneralizedNormalForce(
bool check=
true) { assert((not check) or (not updlaN));
return lambdaN; }
65 const double& evallaN();
68 const double& evalLaN();
71 const double& evalgdnN();
74 const double& evalgddN();
78 virtual void updatewb();
79 virtual void updateV(
int i=0);
80 void updateGeneralizedNormalForce() { (this->*updateGeneralizedNormalForce_)(); updlaN =
false; }
81 void updateGeneralizedTangentialForce() { (this->*updateGeneralizedTangentialForce_)(); updlaT =
false; }
82 void updateGeneralizedNormalForceS();
83 void updateGeneralizedNormalForceM();
84 void updateGeneralizedNormalForceP();
85 void updateGeneralizedTangentialForceS();
86 void updateGeneralizedTangentialForceM();
87 void updateGeneralizedTangentialForce0() { }
90 virtual void updateGeneralizedForces();
91 virtual void updateGeneralizedPositions();
92 virtual void updateGeneralizedVelocities();
93 virtual void updatePositions();
94 virtual void updatePositions(
Frame *frame);
95 virtual void updateVelocities();
96 virtual void updateg();
97 virtual void updategd();
98 virtual void updateh(
int i=0);
99 virtual void updateW(
int i=0);
100 virtual void updateStopVector();
107 virtual void calcxSize();
118 virtual void updateLinkStatus();
119 virtual void updateLinkStatusReg();
141 virtual std::string
getType()
const {
return "Contact"; }
154 setOpenMBVContactPoints(ombv.createOpenMBV());
156 void setOpenMBVContactPoints(
const std::shared_ptr<OpenMBV::Frame> &frame) {
166 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVNormalForce, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBV::Arrow::ReferencePoint),OpenMBV::Arrow::toPoint)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0))) {
167 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
170 void setOpenMBVNormalForce(
const std::shared_ptr<OpenMBV::Arrow> &arrow) {
contactArrow=arrow; }
179 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVTangentialForce, tag, (optional (scaleLength,(
double),1)(scaleSize,(
double),1)(referencePoint,(OpenMBV::Arrow::ReferencePoint),OpenMBV::Arrow::toPoint)(diffuseColor,(
const fmatvec::Vec3&),
"[-1;1;1]")(transparency,(
double),0))) {
180 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
181 frictionArrow=ombv.createOpenMBV();
183 void setOpenMBVTangentialForce(
const std::shared_ptr<OpenMBV::Arrow> &arrow) { frictionArrow=arrow; }
186 void setNormalForceLaw(GeneralizedForceLaw *fcl_);
187 GeneralizedForceLaw * getNormalForceLaw()
const {
return fcl; }
188 void setNormalImpactLaw(GeneralizedImpactLaw *fnil_);
189 void setTangentialForceLaw(FrictionForceLaw *fdf_);
190 void setTangentialImpactLaw(FrictionImpactLaw *ftil_);
211 void calccorrSize(
int j);
212 void updatecorr(
int j);
310 fmatvec::VecV lambdaT;
basic force law on acceleration level for constraint description
Definition: generalized_force_law.h:32
Definition: openmbv_utils.h:54
Definition: openmbv_utils.h:66
basic friction force law on velocity level for constraint description
Definition: friction_impact_law.h:32
InitStage
The stages of the initialization.
Definition: element.h:97
basic friction force law on acceleration level for constraint description
Definition: friction_force_law.h:32
contour link
Definition: contour_link.h:42
basic force law on velocity level for constraint description
Definition: generalized_impact_law.h:32
std::string name
name of element
Definition: element.h:298
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
static std::shared_ptr< CreateType > create()