23 #include "mbsim/link_mechanics.h"
24 #include "mbsim/frame.h"
26 #ifdef HAVE_OPENMBVCPPINTERFACE
27 #include "mbsim/utils/boost_parameters.h"
28 #include "mbsim/utils/openmbv_utils.h"
33 class GeneralizedForceLaw;
34 class GeneralizedImpactLaw;
35 class FrictionForceLaw;
36 class FrictionImpactLaw;
62 virtual void updatewb(
double t,
int i = 0);
63 virtual void updateW(
double t,
int i = 0);
64 virtual void updateh(
double t,
int i = 0);
65 virtual void updateg(
double t);
66 virtual void updategd(
double t);
67 virtual void updateJacobians(
double t,
int j = 0);
71 virtual void updatexd(
double t);
72 virtual void updatedx(
double t,
double dt);
73 virtual void calcxSize();
82 virtual void calccorrSize(
int j);
105 virtual void plot(
double t,
double dt = 1);
138 virtual void initializeUsingXML(xercesc::DOMElement *element);
139 virtual xercesc::DOMElement* writeXMLFile(xercesc::DOMNode *element);
145 #ifdef HAVE_OPENMBVCPPINTERFACE
147 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))) {
148 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toHead,referencePoint,scaleLength,scaleSize);
149 setOpenMBVForce(ombv.createOpenMBV());
151 void setOpenMBVForce(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) {
152 std::vector<bool> which; which.resize(2,
false);
154 LinkMechanics::setOpenMBVForceArrow(arrow, which);
158 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))) {
159 OpenMBVArrow ombv(diffuseColor,transparency,OpenMBV::Arrow::toDoubleHead,referencePoint,scaleLength,scaleSize);
160 setOpenMBVMoment(ombv.createOpenMBV());
162 void setOpenMBVMoment(
const boost::shared_ptr<OpenMBV::Arrow> &arrow) {
163 std::vector<bool> which; which.resize(2,
false);
165 LinkMechanics::setOpenMBVMomentArrow(arrow, which);
189 fmatvec::Mat3xV
Wf, Wm;
232 std::string saved_ref1, saved_ref2;
238 virtual void updateb(
double t);
240 void setBody(
Body* body_) {
virtual void solveConstraintsFixpointSingle()
Definition: joint.cc:306
basic force law on acceleration level for constraint description
Definition: constitutive_laws.h:41
Joint(const std::string &name="")
constructor
Definition: joint.cc:39
virtual void updaterFactors()
update relaxation factors for contact equations
Definition: joint.cc:483
void setForceDirection(const fmatvec::Mat3xV &fd)
Definition: joint.cc:576
virtual void checkImpactsForTermination(double dt)
verify underlying force laws on velocity level concerning given tolerances
Definition: joint.cc:506
virtual ~Joint()
destructor
Definition: joint.cc:43
virtual void solveConstraintsGaussSeidel()
Definition: joint.cc:354
fmatvec::Mat3xV Wf
global force and moment direction
Definition: joint.h:189
virtual void jacobianConstraints()
computes JACOBIAN and mass action matrix of nonlinear contact equations
Definition: joint.cc:426
virtual void init(InitStage stage)
plots time series header
Definition: joint.cc:153
fmatvec::Mat3xV JT
translational JACOBIAN (not empty for e.g. prismatic joints)
Definition: joint.h:194
fmatvec::Vec3 WrP0P1
difference vector of position, velocity and angular velocity
Definition: joint.h:199
void setMomentDirection(const fmatvec::Mat3xV &md)
Definition: joint.cc:584
virtual bool gActiveChanged()
Definition: joint.h:88
fmatvec::Index IT
indices of forces and torques
Definition: joint.h:179
GeneralizedForceLaw * ffl
Definition: joint.h:204
virtual void init(InitStage stage)
plots time series header
Definition: joint.cc:692
class for connections: constraints on frames
Definition: joint.h:48
virtual void solveImpactsGaussSeidel(double dt)
Definition: joint.cc:330
GeneralizedForceLaw * fml
Definition: joint.h:209
fmatvec::Mat3xV forceDir
local force and moment direction
Definition: joint.h:184
virtual void connect(Frame *frame1, Frame *frame2)
second frame to connect
Definition: joint.cc:62
virtual void jacobianImpacts()
computes JACOBIAN and mass action matrix of nonlinear contact equations on velocity level ...
Definition: joint.cc:455
virtual void plot(double t, double dt=1)
plots time dependent data
Definition: joint.cc:592
void setFrameOfReferenceID(int ID)
The frame of reference ID for the force/moment direction vectors. If ID=0 (default) the first frame...
Definition: joint.h:134
InitStage
The stages of the initialization.
Definition: element.h:97
void calcbSize()
calculates size of rfactors
Definition: joint.cc:681
virtual bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: joint.h:244
Frame C
own frame located in second partner with same orientation as first partner
Definition: joint.h:229
virtual std::string getType() const
Definition: joint.h:141
virtual void solveImpactsRootFinding(double dt)
Definition: joint.cc:378
GeneralizedImpactLaw * fiml
Definition: joint.h:219
virtual bool isSetValued() const
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: joint.cc:260
basic force law on velocity level for constraint description
Definition: constitutive_laws.h:213
GeneralizedImpactLaw * fifl
Definition: joint.h:214
virtual void solveImpactsFixpointSingle(double dt)
Definition: joint.cc:282
std::string name
name of element
Definition: element.h:290
Frame * refFrame
frame of reference the force is defined in
Definition: joint.h:173
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
virtual void calcgdSize(int j)
calculates size of gap velocities
Definition: joint.cc:245
virtual void calclaSize(int j)
calculates size of contact force parameters
Definition: joint.cc:235
virtual void solveConstraintsRootFinding()
Definition: joint.cc:402
virtual bool isActive() const
Definition: joint.h:85
virtual void calcrFactorSize(int j)
calculates size of rfactors
Definition: joint.cc:250
virtual void calcgSize(int j)
calculates size of relative distances
Definition: joint.cc:240
virtual bool isSingleValued() const
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: joint.cc:270
fmatvec::Vec gdn
relative velocity and acceleration after an impact for event driven scheme summarizing all possible c...
Definition: joint.h:224
virtual void checkConstraintsForTermination()
verify underlying force laws concerning given tolerances
Definition: joint.cc:536
base class for all mechanical bodies with mass and generalised coordinates
Definition: body.h:52