20 #ifndef _FLOATING_FRAME_LINK_H_
21 #define _FLOATING_FRAME_LINK_H_
23 #include "mbsim/links/link.h"
24 #include "mbsim/frames/floating_relative_frame.h"
26 #include "mbsim/utils/boost_parameters.h"
27 #include "mbsim/utils/openmbv_utils.h"
52 virtual void updatedhdz();
60 std::string
getType()
const {
return "Link"; }
69 void calccorrSize(
int j);
71 void initializeUsingXML(xercesc::DOMElement *element);
73 void updateW(
int i = 0);
74 void updateh(
int i = 0);
82 virtual void updatedhdqRef(
const fmatvec::Mat& ref,
int i=0);
84 virtual void updatedhdtRef(
const fmatvec::Vec& ref,
int i=0);
93 Frame* getFrame(
int i) {
return frame[i]; }
100 void resetUpToDate();
102 virtual void updatePositions();
103 virtual void updateVelocities();
104 void updateGeneralizedPositions();
105 void updateGeneralizedVelocities();
106 void updateGeneralizedForces();
109 void updateForceDirections();
111 virtual void updatelaF() { }
112 virtual void updatelaM() { }
113 const fmatvec::Vec3& evalGlobalRelativePosition() {
if(updPos) updatePositions();
return WrP0P1; }
114 const fmatvec::Vec3& evalGlobalRelativeVelocity() {
if(updVel) updateVelocities();
return WvP0P1; }
115 const fmatvec::Vec3& evalGlobalRelativeAngularVelocity() {
if(updVel) updateVelocities();
return WomP0P1; }
116 const fmatvec::Mat3xV& evalGlobalForceDirection() {
if(updFD) updateForceDirections();
return DF; }
117 const fmatvec::Mat3xV& evalGlobalMomentDirection() {
if(updFD) updateForceDirections();
return DM; }
118 const fmatvec::Vec3& evalForce() {
if(updF) updateForce();
return F; }
119 const fmatvec::Vec3& evalMoment() {
if(updM) updateMoment();
return M; }
120 const fmatvec::Mat3xV& evalRF() {
if(updRMV) updateR();
return RF; }
121 const fmatvec::Mat3xV& evalRM() {
if(updRMV) updateR();
return RM; }
122 const fmatvec::VecV& evallaF() {
if(updlaF) updatelaF();
return lambdaF; }
123 const fmatvec::VecV& evallaM() {
if(updlaM) updatelaM();
return lambdaM; }
126 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))) {
127 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
128 setOpenMBVForce(ombv.createOpenMBV());
131 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))) {
132 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toDoubleHead,referencePoint,scaleLength,scaleSize);
133 setOpenMBVMoment(ombv.createOpenMBV());
135 void setOpenMBVForce(
const std::shared_ptr<OpenMBV::Arrow> &arrow) { openMBVArrowF = arrow; }
136 void setOpenMBVMoment(
const std::shared_ptr<OpenMBV::Arrow> &arrow) { openMBVArrowM = arrow; }
144 fmatvec::Mat3xV DF, DM;
148 fmatvec::Mat3xV RF, RM;
155 fmatvec::VecV lambdaF, lambdaM;
160 fmatvec::RangeV
iF, iM;
167 std::shared_ptr<OpenMBV::Group> openMBVForceGrp;
168 std::shared_ptr<OpenMBV::Arrow> openMBVArrowF;
169 std::shared_ptr<OpenMBV::Arrow> openMBVArrowM;
171 bool updPos, updVel, updFD, updF, updM, updRMV, updlaF, updlaM;
185 std::string saved_ref1, saved_ref2;
void calcgdSize(int j)
calculates size of gap velocities
Definition: floating_frame_link.cc:64
floating frame link
Definition: floating_frame_link.h:43
virtual void init(InitStage stage)
plots time series header
Definition: floating_frame_link.cc:245
fmatvec::Vec3 WrP0P1
difference vector of position, velocity and angular velocity
Definition: floating_frame_link.h:142
void calclaSize(int j)
calculates size of contact force parameters
Definition: floating_frame_link.cc:54
general link to one or more objects
Definition: link.h:46
FloatingFrameLink(const std::string &name)
constructor
Definition: floating_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: floating_frame_link.h:126
Definition: openmbv_utils.h:54
cartesian frame on rigid bodies
Definition: floating_relative_frame.h:31
fmatvec::RangeV iF
indices of forces and torques
Definition: floating_frame_link.h:160
void setFrameOfReferenceID(int ID)
The frame of reference ID for the force/moment direction vectors. If ID=0 (default) the first frame...
Definition: floating_frame_link.h:98
virtual void updatehRef(const fmatvec::Vec &hRef, int i=0)
references to complete and link smooth force vector of dynamic system parent
Definition: floating_frame_link.cc:199
virtual void updaterRef(const fmatvec::Vec &ref, int i=0)
references to nonsmooth force vector of dynamic system parent
Definition: floating_frame_link.cc:221
std::vector< Frame * > frame
array in which all frames are listed, connecting bodies via a link
Definition: floating_frame_link.h:165
void calcgSize(int j)
calculates size of relative distances
Definition: floating_frame_link.cc:59
FloatingRelativeFrame C
own frame located in second partner with same orientation as first partner
Definition: floating_frame_link.h:182
virtual void closePlot()
closes plot file
Definition: floating_frame_link.cc:117
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)))
Visualize a moment arrow.
Definition: floating_frame_link.h:131
void calcrFactorSize(int j)
calculates size of rfactors
Definition: floating_frame_link.cc:69
fmatvec::Mat3xV forceDir
directions of force and moment in frame of reference
Definition: floating_frame_link.h:153
InitStage
The stages of the initialization.
Definition: element.h:97
virtual void plot()
plots time dependent data
Definition: floating_frame_link.cc:83
std::string getType() const
Definition: floating_frame_link.h:60
Frame * refFrame
frame of reference the force is defined in
Definition: floating_frame_link.h:176
std::string name
name of element
Definition: element.h:298
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:37
virtual void updateWRef(const fmatvec::Mat &ref, int i=0)
references to contact force direction matrix of dynamic system parent
Definition: floating_frame_link.cc:183
virtual void updateVRef(const fmatvec::Mat &ref, int i=0)
references to condensed contact force direction matrix of dynamic system parent
Definition: floating_frame_link.cc:191