23 #include <mbsimtinyxml/tinyxml-src/tinyxml.h>
24 #include <mbsim/element.h>
25 #include <mbsim/utils/eps.h>
36 template<
class Ret,
class Arg>
50 virtual Ret
operator()(
const Arg& x,
const void * =NULL)=0;
65 template<
class Ret,
class Arg1,
class Arg2>
79 virtual Ret
operator()(
const Arg1& p1,
const Arg2& p2,
const void * =NULL)=0;
94 template<
class Ret,
class Arg1,
class Arg2,
class Arg3>
108 virtual Ret
operator()(
const Arg1& p1,
const Arg2& p2,
const Arg3& p3,
const void * =NULL)=0;
138 virtual Ret
operator()(
const double& x,
const void * =NULL) {
177 e=element->FirstChildElement(MBSIMNS
"orderOfDerivative");
196 template<
class Ret,
class Arg>
211 virtual Ret
operator()(
const Arg& p,
const void * =NULL) {
return c; }
215 e=element->FirstChildElement(MBSIMNS
"value");
221 void setValue(Ret c_) {
c=c_; }
251 virtual double operator()(
const Arg& p,
const void * =NULL) {
return c; }
255 e=element->FirstChildElement(MBSIMNS
"value");
256 c=Element::getDouble(e);
261 void setValue(
double c_) {
c=c_; }
276 template<
class Ret,
class Arg1,
class Arg2>
291 virtual Ret
operator()(
const Arg1& p1,
const Arg2& p2,
const void * =NULL) {
return c; }
295 e=element->FirstChildElement(MBSIMNS
"value");
301 void setValue(Ret c_) {
c=c_; }
333 virtual double operator()(
const double& g,
const double& gd,
const void * =NULL) {
return c*(g-l0) + d*gd; }
338 void setParameters(
double c_,
double d_,
double l0_) {
c=c_; d=d_; l0=l0_; }
369 virtual double operator()(
const double& g,
const double& gd,
const void * =NULL) {
return (*
gForceFun)(g)(0) + (*gdForceFun)(gd)(0); }
394 template<
class Arg1,
class Arg2>
408 virtual double operator()(
const Arg1& p1,
const Arg2& p2,
const void * =NULL) {
return c; }
412 e=element->FirstChildElement(MBSIMNS
"value");
413 c=Element::getDouble(e);
418 void setValue(
double c_) {
c=c_; }
446 virtual double operator()(
const double& g,
const double& gd,
const void * =NULL) {
458 void setParameter(
double c_,
double d_) {
c=c_; d=d_; }
489 virtual double operator()(
const double& g,
const double& gd,
const void * =NULL) {
496 void setParameter(
double c_,
double d_) {
c=c_; d=d_; }
528 virtual fmatvec::Vec
operator()(
const fmatvec::Vec &gd,
const double& laN,
const void * =NULL);
533 void setFrictionCoefficient(
double mu_) {
mu=mu_; }
534 void setMarginalVelocity(
double gdLim_) { gdLim=gdLim_; }
566 virtual fmatvec::Vec
operator()(
const fmatvec::Vec &gd,
const double& laN,
const void * =NULL);
572 void setMarginalVelocity(
double gdLim_) {
gdLim=gdLim_; }
592 InfluenceFunction(
const std::string& firstContourName_,
const std::string& secondContourName_) :
596 virtual double operator()(
const fmatvec::Vec& firstContourLagrangeParameter,
const fmatvec::Vec& secondContourLagrangeParameter,
const void * = NULL)=0;
598 throw MBSimError(
"InfluenceFuntion::initializeUsingXML : Method not implemented");
603 std::string getFirstContourName() {
606 std::string getSecondContourName() {
634 virtual double operator()(
const fmatvec::Vec& firstContourLagrangeParameter,
const fmatvec::Vec& secondContourLagrangeParameter,
const void * = NULL) {
635 if(nrm2(firstContourLagrangeParameter - secondContourLagrangeParameter) < macheps())
651 ConstantInfluenceFunction(
const std::string& firstContourName_,
const std::string& secondContourName_,
const double & couplingValue_) :
652 InfluenceFunction(firstContourName_, secondContourName_), couplingValue(couplingValue_) {
656 virtual double operator()(
const fmatvec::Vec& firstContourLagrangeParameter,
const fmatvec::Vec& secondContourLagrangeParameter,
const void * = NULL) {
657 return couplingValue;
662 double couplingValue;