20#ifndef _SINGLE_CONTACT_H_
21#define _SINGLE_CONTACT_H_
23#include <mbsim/links/contour_link.h>
27 class GeneralizedForceLaw;
28 class GeneralizedImpactLaw;
29 class FrictionForceLaw;
30 class FrictionImpactLaw;
58 void resetUpToDate()
override;
60 bool isSticking()
const;
62 const double& evalGeneralizedNormalForce() {
if(updlaN) updateGeneralizedNormalForce();
return lambdaN; }
63 const fmatvec::VecV& evalGeneralizedTangentialForce() {
if(updlaT) updateGeneralizedTangentialForce();
return lambdaT; }
65 double& getGeneralizedNormalForce(
bool check=
true) { assert((not check) or (not updlaN));
return lambdaN; }
67 const double& evallaN();
68 const fmatvec::Vec& evallaT();
70 const double& evalLaN();
71 const fmatvec::Vec& evalLaT();
73 const double& evalgdnN();
74 const fmatvec::Vec& evalgdnT();
76 const double& evalgddN();
77 const fmatvec::Vec& evalgddT();
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 void updateGeneralizedForces()
override;
91 void updateGeneralizedPositions()
override;
92 void updateGeneralizedVelocities()
override;
93 void updatePositions(Frame *frame)
override;
94 void updateg()
override;
95 void updategd()
override;
96 void updateh(
int i=0)
override;
97 void updateW(
int i=0)
override;
98 void updateV(
int i=0)
override;
99 void updatewb()
override;
100 void updateStopVector()
override;
101 void updateStopVectorParameters()
override;
108 void calcSize()
override;
116 void init(
InitStage stage,
const InitConfigSet &config)
override;
119 void updateLinkStatus()
override;
120 void updateLinkStatusReg()
override;
136 void LinearImpactEstimation(
double t, fmatvec::Vec &gInActive_,fmatvec::Vec &gdInActive_,
int *IndInActive_,fmatvec::Vec &gAct_,
int *IndActive_)
override;
145 void setNormalForceLaw(GeneralizedForceLaw *fcl_) {
fcl = fcl_; }
146 GeneralizedForceLaw * getNormalForceLaw()
const {
return fcl; }
147 void setNormalImpactLaw(GeneralizedImpactLaw *fnil_) {
fnil = fnil_; }
148 void setTangentialForceLaw(FrictionForceLaw *fdf_) {
fdf = fdf_; }
149 FrictionForceLaw * getTangentialForceLaw()
const {
return fdf; }
150 void setTangentialImpactLaw(FrictionImpactLaw *ftil_) {
ftil = ftil_; }
158 void calccorrSize(
int j)
override;
159 void updatecorr(
int j)
override;
161 void checkRoot()
override;
163 bool isNormalForceLawSetValued()
const;
164 bool isTangentialForceLawSetValued()
const;
165 bool isNormalForceLawSetValuedAndActive()
const {
return isNormalForceLawSetValued() and
gdActive[normal]; }
166 bool isTangentialForceLawSetValuedAndActive()
const {
return isTangentialForceLawSetValued() and
gdActive[tangential]; }
252 fmatvec::VecV lambdaT;
254 bool updlaN{
true}, updlaT{
true};
contour link
Definition: contour_link.h:34
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
basic friction force law on acceleration level for constraint description
Definition: friction_force_law.h:34
basic friction force law on velocity level for constraint description
Definition: friction_impact_law.h:32
basic force law on acceleration level for constraint description
Definition: generalized_force_law.h:34
basic force law on velocity level for constraint description
Definition: generalized_impact_law.h:32
namespace MBSim
Definition: bilateral_constraint.cc:30