22 #include "mbsim/link_mechanics.h"
23 #include <mbsim/frame.h>
24 #include "mbsim/functions/function.h"
26 #ifdef HAVE_OPENMBVCPPINTERFACE
27 #include "mbsim/utils/boost_parameters.h"
28 #include "mbsim/utils/openmbv_utils.h"
34 class FrictionForceLaw;
40 Function<double(double)> *laN;
41 std::vector<RigidBody*> body;
45 void updateh(
double,
int i=0);
46 void updateg(
double) { }
47 void updategd(
double);
52 std::string
getType()
const {
return "GeneralizedFriction"; }
58 void setGeneralizedNormalForceFunction(Function<
double(
double)> *laN_) {
63 void setRigidBodyFirstSide(RigidBody* body_) { body[0] = body_; }
64 void setRigidBodySecondSide(RigidBody* body_) { body[1] = body_; }
66 void plot(
double t,
double dt=1);
67 void initializeUsingXML(xercesc::DOMElement *element);
71 #ifdef HAVE_OPENMBVCPPINTERFACE
73 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVForce, 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))) {
74 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
75 std::vector<bool> which; which.resize(2,
true);
76 LinkMechanics::setOpenMBVForceArrow(ombv.createOpenMBV(), which);
80 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVMoment, 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))) {
81 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toDoubleHead,referencePoint,scaleLength,scaleSize);
82 std::vector<bool> which; which.resize(2,
true);
83 LinkMechanics::setOpenMBVMomentArrow(ombv.createOpenMBV(), which);
87 std::string saved_body1, saved_body2;
Definition: friction.h:36
virtual bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: friction.h:51
InitStage
The stages of the initialization.
Definition: element.h:97
basic friction force law on acceleration level for constraint description
Definition: constitutive_laws.h:308
bool gActiveChanged()
Definition: friction.h:50
std::string name
name of element
Definition: element.h:290
void setGeneralizedFrictionForceLaw(FrictionForceLaw *func_)
Set the function for the torque calculation.
Definition: friction.cc:134
general link to one or more objects
Definition: link_mechanics.h:48
void updatehRef(const fmatvec::Vec &hParent, int j=0)
references to complete and link smooth force vector of dynamic system parent
Definition: friction.cc:58
bool isActive() const
Definition: friction.h:49
void plot(double t, double dt=1)
plots time dependent data
Definition: friction.cc:139
void init(InitStage stage)
plots time series header
Definition: friction.cc:97
std::string getType() const
Definition: friction.h:52