23 #include <mbsim/link_mechanics.h>
24 #include <mbsim/single_contact.h>
27 #ifdef HAVE_OPENMBVCPPINTERFACE
28 #include "mbsim/utils/boost_parameters.h"
29 #include "mbsim/utils/openmbv_utils.h"
34 class ContactKinematics;
35 class GeneralizedForceLaw;
36 class GeneralizedImpactLaw;
37 class FrictionForceLaw;
38 class FrictionImpactLaw;
69 #ifdef HAVE_OPENMBVCPPINTERFACE
70 boost::shared_ptr<OpenMBV::Group> getOpenMBVGrp();
75 virtual void updatewb(
double t,
int i = 0);
76 virtual void updateW(
double t,
int i = 0);
77 virtual void updateV(
double t,
int i = 0);
78 virtual void updateh(
double t,
int i = 0);
79 virtual void updateg(
double t);
80 virtual void updategd(
double t);
81 virtual void updateStopVector(
double t);
82 virtual void updateJacobians(
double t,
int j = 0);
99 virtual void calcxSize();
110 virtual void updateLinkStatus(
double dt);
111 virtual void updateLinkStatusReg(
double dt);
128 virtual void setlaTol(
double tol);
129 virtual void setLaTol(
double tol);
130 virtual void setgTol(
double tol);
131 virtual void setgdTol(
double tol);
132 virtual void setgddTol(
double tol);
133 virtual void setrMax(
double rMax_);
134 virtual void setLinkStatusInd(
int LinkStatusInd_);
135 virtual void setLinkStatusRegInd(
int LinkStatusRegInd_);
136 virtual void setsvInd(
int svInd_);
137 virtual void setlaInd(
int laInd_);
138 virtual void setgInd(
int gInd_);
139 virtual void setgdInd(
int gdInd_);
140 virtual void setrFactorInd(
int rFactorInd_);
144 virtual void updatecorr(
int j);
145 virtual void calccorrSize(
int j);
146 virtual void setcorrInd(
int corrInd_);
147 virtual void checkRoot();
149 #ifdef HAVE_OPENMBVCPPINTERFACE
150 boost::shared_ptr<OpenMBV::Frame>& getOpenMBVFrame() {
return openMBVFrame;}
151 boost::shared_ptr<OpenMBV::Arrow>& getOpenMBVNormalForceArrow() {
return contactArrow;}
152 boost::shared_ptr<OpenMBV::Arrow>& getOpenMBVTangentialForceArrow() {
return frictionArrow;}
160 virtual void plot(
double t,
double dt = 1);
164 #ifdef HAVE_OPENMBVCPPINTERFACE
171 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVContactPoints, tag, (optional (size,(
double),1)(offset,(
double),1)(transparency,(
double),0))) {
172 OpenMBVFrame ombv(size,offset,
"[-1;1;1]",transparency);
173 openMBVFrame=ombv.createOpenMBV();
181 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVNormalForce, 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))) {
182 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
183 contactArrow=ombv.createOpenMBV();
193 BOOST_PARAMETER_MEMBER_FUNCTION( (
void), enableOpenMBVTangentialForce, 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))) {
194 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
195 frictionArrow=ombv.createOpenMBV();
201 void setNormalForceLaw(GeneralizedForceLaw *fcl_);
202 GeneralizedForceLaw * getNormalForceLaw()
const {
return fcl; }
203 void setNormalImpactLaw(GeneralizedImpactLaw *fnil_);
204 void setTangentialForceLaw(FrictionForceLaw *fdf_);
205 void setTangentialImpactLaw(FrictionImpactLaw *ftil_);
206 void setContactKinematics(ContactKinematics* ck,
size_t index = 0) {
210 ContactKinematics* getContactKinematics(
size_t index = 0)
const {
215 ContactKinematics* findContactKinematics(std::string cKName)
const {
217 if (pos < static_cast<int>(
ckNames.size())) {
220 throw MBSimError(
"Name of contact Kinematics is not valid");
224 const std::vector<std::vector<SingleContact> > & getSubcontacts()
const {
245 void computeCurvatures(
fmatvec::Vec &
r,
int contactKinematicsIndex)
const;
247 virtual void initializeUsingXML(xercesc::DOMElement *element);
248 virtual xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *element);
295 #ifdef HAVE_OPENMBVCPPINTERFACE
299 boost::shared_ptr<OpenMBV::Group> openMBVGrp;
304 boost::shared_ptr<OpenMBV::Frame> openMBVFrame;
309 boost::shared_ptr<OpenMBV::Arrow> contactArrow, frictionArrow;
316 std::string contourPairingName;
318 std::vector<saved_references> saved_ref;
basic force law on acceleration level for constraint description
Definition: constitutive_laws.h:41
virtual void connect(Frame *frame_)
Definition: link_mechanics.cc:226
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:49
basic friction force law on velocity level for constraint description
Definition: constitutive_laws.h:547
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
std::vector< fmatvec::Vec > r[2]
nonsmooth right hand side
Definition: link.h:570
basic force law on velocity level for constraint description
Definition: constitutive_laws.h:213
std::string name
name of element
Definition: element.h:290
general link to one or more objects
Definition: link_mechanics.h:48
PlotFeatureStatus
Plot feature status.
Definition: element.h:61
PlotFeature
Plot Features.
Definition: element.h:74