20 #ifndef _KINEMATIC_EXCITATION_H_
21 #define _KINEMATIC_EXCITATION_H_
23 #include "mbsim/link_mechanics.h"
24 #include "mbsim/rigid_body.h"
25 #include "mbsim/frame.h"
27 #ifdef HAVE_OPENMBVCPPINTERFACE
28 #include "mbsim/utils/boost_parameters.h"
29 #include "mbsim/utils/openmbv_utils.h"
36 Function<fmatvec::VecV(fmatvec::VecV,fmatvec::VecV)> *func;
41 void updateh(
double,
int i=0);
42 void updateW(
double,
int i=0);
43 void updateJacobians(
double t,
int j=0);
46 void setDependentBody(
RigidBody* body_) {body = body_;}
56 void setForceFunction(Function<fmatvec::VecV(fmatvec::VecV,fmatvec::VecV)> *func_) {
58 func->setParent(
this);
59 func->setName(
"Force");
62 void plot(
double t,
double dt=1);
64 #ifdef HAVE_OPENMBVCPPINTERFACE
66 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))) {
67 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
68 FArrow=ombv.createOpenMBV();
70 void setOpenMBVForce(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) { FArrow=arrow; }
73 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))) {
74 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
75 MArrow=ombv.createOpenMBV();
77 void setOpenMBVMoment(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) { MArrow=arrow; }
81 #ifdef HAVE_OPENMBVCPPINTERFACE
82 boost::shared_ptr<OpenMBV::Arrow> FArrow, MArrow;
89 Function<fmatvec::VecV(double)> *f;
95 void updatexd(
double t);
96 void updateg(
double t);
97 void updategd(
double t);
98 void updatewb(
double t,
int i=0);
100 std::string
getType()
const {
return "GeneralizedPositionExcitation"; }
102 void setExcitationFunction(Function<fmatvec::VecV(
double)>* f_) {
105 f->setName(
"Excitation");
116 Function<fmatvec::VecV(fmatvec::VecV,double)> *f;
122 void updatexd(
double t);
123 void updateg(
double t);
124 void updategd(
double t);
125 void updatewb(
double t,
int i=0);
127 std::string
getType()
const {
return "GeneralizedVelocityExcitation"; }
129 void setExcitationFunction(Function<fmatvec::VecV(fmatvec::VecV,
double)>* f_) {
132 f->setName(
"Excitation");
134 void setExcitationFunction(Function<fmatvec::VecV(fmatvec::VecV)>* f_) {
135 setExcitationFunction(
new StateDependentFunction<fmatvec::VecV>(f_));
137 void setExcitationFunction(Function<fmatvec::VecV(
double)>* f_) {
138 setExcitationFunction(
new TimeDependentFunction<fmatvec::VecV>(f_));
144 Function<fmatvec::VecV(fmatvec::VecV,double)> *f;
150 void updatexd(
double t);
151 void updateg(
double t);
152 void updategd(
double t);
153 void updatewb(
double t,
int i=0);
155 std::string
getType()
const {
return "GeneralizedAccelerationExcitation"; }
157 void setExcitationFunction(Function<fmatvec::VecV(fmatvec::VecV,
double)>* f_) {
160 f->setName(
"Excitation");
162 void setExcitationFunction(Function<fmatvec::VecV(fmatvec::VecV)>* f_) {
163 setExcitationFunction(
new StateDependentFunction<fmatvec::VecV>(f_));
165 void setExcitationFunction(Function<fmatvec::VecV(
double)>* f_) {
166 setExcitationFunction(
new TimeDependentFunction<fmatvec::VecV>(f_));
std::string getType() const
Definition: kinematic_excitation.h:127
Definition: kinematic_excitation.h:87
void plot(double t, double dt=1)
plots time dependent data
Definition: kinematic_excitation.cc:145
Definition: kinematic_excitation.h:142
void init(Element::InitStage stage)
plots time series header
Definition: kinematic_excitation.h:169
bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: kinematic_excitation.cc:93
void calclaSize(int j)
calculates size of contact force parameters
Definition: kinematic_excitation.cc:34
void init(Element::InitStage stage)
plots time series header
Definition: kinematic_excitation.h:108
InitStage
The stages of the initialization.
Definition: element.h:97
Definition: kinematic_excitation.h:34
void calcgSize(int j)
calculates size of relative distances
Definition: kinematic_excitation.cc:37
std::string name
name of element
Definition: element.h:290
bool isActive() const
Definition: kinematic_excitation.h:48
Definition: kinematic_excitation.h:114
void init(InitStage stage)
plots time series header
Definition: kinematic_excitation.cc:97
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
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: kinematic_excitation.cc:72
void updateWRef(const fmatvec::Mat &WParent, int j=0)
references to contact force direction matrix of dynamic system parent
Definition: kinematic_excitation.cc:63
bool gActiveChanged()
Definition: kinematic_excitation.h:49
std::string getType() const
Definition: kinematic_excitation.h:155
std::string getType() const
Definition: kinematic_excitation.h:100
rigid bodies with arbitrary kinematics
Definition: rigid_body.h:53
void calcgdSize(int j)
calculates size of gap velocities
Definition: kinematic_excitation.cc:40