23 #include "mbsim/link_mechanics.h"
24 #include "mbsim/rigid_body.h"
26 #ifdef HAVE_OPENMBVCPPINTERFACE
27 #include "mbsim/utils/boost_parameters.h"
28 #include "mbsim/utils/openmbv_utils.h"
37 Function<double(double,double)> *func;
38 std::vector<RigidBody*> body;
39 std::vector<double> ratio;
41 std::string saved_DependentBody;
42 std::vector<std::string> saved_IndependentBody;
45 void updateh(
double,
int i=0);
46 void updateW(
double,
int i=0);
48 void updategd(
double);
49 void updateJacobians(
double t,
int j=0);
50 void updatewb(
double t,
int i=0);
53 void setDependentBody(
RigidBody* body_) {body[0] = body_;}
58 std::string
getType()
const {
return "Gear"; }
66 void setGeneralizedForceFunction(Function<
double(
double,
double)> *func_) {
68 func->setParent(
this);
69 func->setName(
"GeneralizedForce");
72 void plot(
double t,
double dt=1);
74 void initializeUsingXML(xercesc::DOMElement * element);
76 #ifdef HAVE_OPENMBVCPPINTERFACE
78 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))) {
79 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
80 setOpenMBVForce(ombv.createOpenMBV());
82 void setOpenMBVForce(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) { FArrow[0]=arrow; }
85 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))) {
86 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
87 setOpenMBVMoment(ombv.createOpenMBV());
89 void setOpenMBVMoment(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) { MArrow[0]=arrow; }
93 #ifdef HAVE_OPENMBVCPPINTERFACE
94 std::vector<boost::shared_ptr<OpenMBV::Arrow> > FArrow, MArrow;
void plot(double t, double dt=1)
plots time dependent data
Definition: gear.cc:229
virtual void calcgSize(int j)
calculates size of relative distances
Definition: gear.cc:50
bool gActiveChanged()
Definition: gear.h:57
Definition: constraint.h:49
std::string getType() const
Definition: gear.h:58
void updatehRef(const fmatvec::Vec &hParent, int j=0)
references to complete and link smooth force vector of dynamic system parent
Definition: gear.cc:104
void init(InitStage stage)
plots time series header
Definition: gear.cc:151
bool isActive() const
Definition: gear.h:56
virtual void calclaSize(int j)
calculates size of contact force parameters
Definition: gear.cc:47
InitStage
The stages of the initialization.
Definition: element.h:97
void updateWRef(const fmatvec::Mat &WParent, int j=0)
references to contact force direction matrix of dynamic system parent
Definition: gear.cc:93
std::string name
name of element
Definition: element.h:290
general link to one or more objects
Definition: link_mechanics.h:48
bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: gear.h:61
bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: gear.cc:142
virtual void calcgdSize(int j)
calculates size of gap velocities
Definition: gear.cc:53
rigid bodies with arbitrary kinematics
Definition: rigid_body.h:53