20 #ifndef _FRAME_LINK_H_
21 #define _FRAME_LINK_H_
23 #include "mbsim/links/link.h"
25 #include "mbsim/utils/boost_parameters.h"
26 #include "mbsim/utils/openmbv_utils.h"
53 std::string
getType()
const {
return "Link"; }
58 void initializeUsingXML(xercesc::DOMElement *element);
60 void updateh(
int i=0);
67 virtual void updatedhdqRef(
const fmatvec::Mat& ref,
int i=0);
69 virtual void updatedhdtRef(
const fmatvec::Vec& ref,
int i=0);
85 virtual void updatePositions();
86 virtual void updateVelocities();
87 void updateGeneralizedPositions();
88 void updateGeneralizedVelocities();
89 void updateGeneralizedForces();
91 void updateForceDirections();
93 virtual void updatelaF() { }
94 virtual void updatelaM() { }
95 const fmatvec::Vec3& evalGlobalRelativePosition() {
if(updPos) updatePositions();
return WrP0P1; }
96 const fmatvec::Vec3& evalGlobalRelativeVelocity() {
if(updVel) updateVelocities();
return WvP0P1; }
97 const fmatvec::Vec3& evalGlobalRelativeAngularVelocity() {
if(updVel) updateVelocities();
return WomP0P1; }
98 const fmatvec::Mat3xV& evalGlobalForceDirection() {
if(updFD) updateForceDirections();
return DF; }
99 const fmatvec::Vec3& evalForce() {
if(updF) updateForce();
return F; }
100 const fmatvec::Mat3xV& evalRF() {
if(updRMV) updateR();
return RF; }
101 const fmatvec::VecV& evallaF() {
if(updlaF) updatelaF();
return lambdaF; }
102 const fmatvec::VecV& evallaM() {
if(updlaM) updatelaM();
return lambdaM; }
105 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))) {
106 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
107 setOpenMBVForce(ombv.createOpenMBV());
109 void setOpenMBVForce(
const std::shared_ptr<OpenMBV::Arrow> &arrow) { openMBVArrowF = arrow; }
123 fmatvec::VecV lambdaF, lambdaM;
135 std::shared_ptr<OpenMBV::Group> openMBVForceGrp;
136 std::shared_ptr<OpenMBV::Arrow> openMBVArrowF;
137 std::shared_ptr<OpenMBV::Arrow> openMBVArrowM;
139 bool updPos, updVel, updFD, updF, updRMV, updlaF, updlaM;
142 std::string saved_ref1, saved_ref2;
general link to one or more objects
Definition: link.h:46
std::vector< Frame * > frame
array in which all frames are listed, connecting bodies via a link
Definition: frame_link.h:133
virtual void closePlot()
closes plot file
Definition: frame_link.cc:75
std::string getType() const
Definition: frame_link.h:53
Definition: openmbv_utils.h:54
FrameLink(const std::string &name)
constructor
Definition: frame_link.cc:37
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)))
Visualize a force arrow.
Definition: frame_link.h:105
virtual void updaterRef(const fmatvec::Vec &ref, int i=0)
references to nonsmooth force vector of dynamic system parent
Definition: frame_link.cc:119
fmatvec::RangeV iF
indices of forces and torques
Definition: frame_link.h:128
fmatvec::Vec3 WrP0P1
difference vector of position, velocity and angular velocity
Definition: frame_link.h:115
virtual void init(InitStage stage)
plots time series header
Definition: frame_link.cc:175
virtual void updateWRef(const fmatvec::Mat &ref, int i=0)
references to contact force direction matrix of dynamic system parent
Definition: frame_link.cc:81
InitStage
The stages of the initialization.
Definition: element.h:97
std::string name
name of element
Definition: element.h:298
virtual void plot()
plots time dependent data
Definition: frame_link.cc:55
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
frame link
Definition: frame_link.h:42
virtual void updateVRef(const fmatvec::Mat &ref, int i=0)
references to condensed contact force direction matrix of dynamic system parent
Definition: frame_link.cc:89
void connect(Frame *frame0, Frame *frame1)
Definition: frame_link.h:77
virtual void updatehRef(const fmatvec::Vec &hRef, int i=0)
references to complete and link smooth force vector of dynamic system parent
Definition: frame_link.cc:97