21 #ifndef FUNCTIONS_CONTACT_H_
22 #define FUNCTIONS_CONTACT_H_
24 #include <mbsim/contour.h>
25 #include <mbsim/contours/contour1s.h>
26 #include <mbsim/contours/point.h>
27 #include "mbsim/contours/line.h"
28 #include <mbsim/contours/circle_solid.h>
29 #include "mbsim/contours/circle_hollow.h"
30 #include "mbsim/contours/circle.h"
31 #include "mbsim/contours/frustum2d.h"
32 #include "mbsim/contours/edge.h"
33 #include "mbsim/contours/face.h"
34 #include "mbsim/contours/frustum.h"
35 #include "mbsim/contours/plane.h"
36 #include "mbsim/contours/planewithfrustum.h"
37 #include "mbsim/contours/contour_interpolation.h"
38 #include "mbsim/contours/contour_quad.h"
39 #include "mbsim/contours/cuboid.h"
40 #include "mbsim/contours/compound_contour.h"
41 #include "mbsim/utils/function.h"
42 #include "mbsim/mbsim_event.h"
51 template<
class Ret,
class Arg>
59 virtual Ret
operator()(
const Arg& x,
const void * =NULL) = 0;
71 virtual fmatvec::Vec
computeWrD(
const Arg& x) = 0;
92 double operator()(
const double &alpha,
const void * =NULL) {
94 fmatvec::Vec Wt =
cp.getFrameOfReference().getOrientation().col(1);
100 cp.getLagrangeParameterPosition()(0) = alpha;
102 contour->computeRootFunctionFirstTangent(
cp);
104 return point->getFrame()->getPosition() -
cp.getFrameOfReference().getPosition();
140 return circle->getReferenceOrientation().col(2).T()*Wd;
145 cp.getLagrangeParameterPosition()(0) = alpha;
148 return circle->getFrame()->getPosition() -
cp.getFrameOfReference().getPosition();
181 fmatvec::Vec
operator()(
const fmatvec::Vec &alpha,
const void * =NULL) {
182 fmatvec::Mat Wt =
contour->computeWt(alpha);
183 fmatvec::Vec WrOC[2];
184 WrOC[0] = point->getFrame()->getPosition();
185 WrOC[1] =
contour->computeWrOC(alpha);
186 return Wt.T() * ( WrOC[1] - WrOC[0] );
190 return contour->computeWrOC(alpha) - point->getFrame()->getPosition();
228 virtual double operator()(
const double &phi,
const void * =NULL) = 0;
230 virtual fmatvec::Vec
computeWrD(
const double &phi) = 0;
234 void setDiffVec(fmatvec::Vec d_);
236 void setSectionCOS(fmatvec::Vec b1_,fmatvec::Vec b2_);
261 inline void FuncPairConeSectionCircle::setDiffVec(fmatvec::Vec d_) {
d=d_; }
262 inline void FuncPairConeSectionCircle::setSectionCOS(fmatvec::Vec b1_,fmatvec::Vec b2_) {
b1=b1_; b2=b2_; }
292 double operator()(
const double &phi,
const void * =NULL);
297 void setEllipseCOS(fmatvec::Vec b1e_,fmatvec::Vec b2e_);
301 inline void FuncPairEllipseCircle::setEllipseCOS(fmatvec::Vec b1e_,fmatvec::Vec b2e_) {setSectionCOS(b1e_,b2e_);}
331 double operator()(
const double &phi,
const void * =NULL);
354 void setDiffVec(fmatvec::Vec d_);
355 void setSectionCOS(fmatvec::Vec b1_,fmatvec::Vec b2_);
375 inline void JacobianPairConeSectionCircle::setDiffVec(fmatvec::Vec d_) {
d=d_; }
376 inline void JacobianPairConeSectionCircle::setSectionCOS(fmatvec::Vec b1_,fmatvec::Vec b2_) {
b1=b1_; b2=b2_; }
393 double operator()(
const double &phi,
const void * =NULL);
414 double operator()(
const double &phi,
const void * =NULL);
436 virtual double operator()(
const double &s,
const void * =NULL) {
437 throw MBSimError(
"ERROR (FuncPairContour1sLine::operator): Not implemented!");
444 throw MBSimError(
"ERROR (FuncPairContour1sLine::computeWrD): Not implemented!");
477 cp.getLagrangeParameterPosition() = fmatvec::Vec(1, fmatvec::INIT, alpha);
484 cp.getLagrangeParameterPosition() = fmatvec::Vec(1, fmatvec::INIT, alpha);
486 contour->computeRootFunctionFirstTangent(
cp);
488 WrOC[0] = circle->getFrame()->getPosition() - circle->getRadius()*
cp.getFrameOfReference().getOrientation().col(0);
489 WrOC[1] =
cp.getFrameOfReference().getPosition();
541 void setInitialValue(
const double &s0_ ) {
s0=s0_; }
542 void setNodes(
const fmatvec::Vec &nodes_) {
nodes=nodes_;}
543 void setSearchAll(
bool searchAll_) {
searchAll=searchAll_; }
552 void setEqualSpacing(
const int &n,
const double &x0,
const double &dx);