mbsim 4.0.0 MBSim Kernel

dynamic_system.h
1 /* Copyright (C) 2004-2014 MBSim Development Team
2 * This library is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU Lesser General Public
4 * License as published by the Free Software Foundation; either
5 * version 2.1 of the License, or (at your option) any later version.
6 *
7 * This library is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 * Lesser General Public License for more details.
11 *
12 * You should have received a copy of the GNU Lesser General Public
13 * License along with this library; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15 *
16 * Contact: martin.o.foerg@googlemail.com
17 */
18
19 #ifndef _DYNAMIC_SYSTEM_H_
20 #define _DYNAMIC_SYSTEM_H_
21
22 #include "mbsim/element.h"
23 #include "mbsim/mbsim_event.h"
24
25 namespace H5 {
26 class Group;
27 }
28
29 namespace MBSim {
30 class Frame;
31 class FixedRelativeFrame;
32 class Contour;
33 class RigidContour;
34 class Object;
35 class Link;
36 class Constraint;
37 class ModellingInterface;
38 class Contact;
39 class Observer;
40
58 class DynamicSystem : public Element {
59 public:
63 DynamicSystem(const std::string &name);
64
68 ~DynamicSystem() override;
69
70 /* INTERFACE FOR DERIVED CLASSES */
71 virtual void updateT();
72 virtual void updateh(int k=0);
73 virtual void updateM();
74 virtual void updateLLM();
75 virtual void updatedq();
76 virtual void updatedu();
77 virtual void updatedx();
78 virtual void updatezd();
79 virtual void updatewb();
80 virtual void updateW(int j=0);
81 virtual void updateV(int j=0);
82 virtual void updater(int j=0);
83 virtual void updateJrla(int j=0);
84 virtual void updateg();
85 virtual void updategd();
86 virtual void updateStopVector();
87 virtual void updateStopVectorParameters();
88 virtual void updateLinkStatus();
89 virtual void updateLinkStatusReg();
90 virtual void updateWInverseKinetics();
91 virtual void updatebInverseKinetics();
92 virtual void sethSize(int hSize_, int j=0);
93 virtual int gethSize(int i=0) const { return hSize[i]; }
94 virtual int getqSize() const { return qSize; }
95 virtual int getuSize(int i=0) const { return uSize[i]; }
96 virtual void calcqSize();
97 virtual void calcuSize(int j=0);
98 virtual int getuInd(int i=0) { return uInd[i]; }
99 virtual void setqInd(int qInd_);
100 virtual void setuInd(int uInd_, int j=0);
101 virtual void sethInd(int hInd_, int j=0);
102 virtual void setxInd(int xInd_);
103 virtual const fmatvec::Vec& getq() const { return q; };
104 virtual fmatvec::Vec& getq() { return q; };
105 virtual const fmatvec::Vec& getu() const { return u; };
106 virtual fmatvec::Vec& getu() { return u; };
107 void setq(const fmatvec::Vec& q_) { q = q_; }
108 void setu(const fmatvec::Vec& u_) { u = u_; }
109 void setx(const fmatvec::Vec& x_) { x = x_; }
110 void setjsv(const fmatvec::VecInt& jsv_) { jsv = jsv_; }
111 void setInternalState(const fmatvec::Vec& internalState) { curis = internalState; nextis = internalState; }
112 virtual H5::GroupBase *getPlotGroup() { return plotGroup; }
113 std::shared_ptr<OpenMBV::Group> getOpenMBVGrp() override { return openMBVGrp; }
114 std::shared_ptr<OpenMBV::Group> getFramesOpenMBVGrp() override { return framesOpenMBVGrp; }
115 std::shared_ptr<OpenMBV::Group> getContoursOpenMBVGrp() override { return contoursOpenMBVGrp; }
116 std::shared_ptr<OpenMBV::Group> getGroupsOpenMBVGrp() override { return groupsOpenMBVGrp; }
117 std::shared_ptr<OpenMBV::Group> getObjectsOpenMBVGrp() override { return objectsOpenMBVGrp; }
118 std::shared_ptr<OpenMBV::Group> getLinksOpenMBVGrp() override { return linksOpenMBVGrp; }
119 std::shared_ptr<OpenMBV::Group> getConstraintsOpenMBVGrp() override { return constraintsOpenMBVGrp; }
120 std::shared_ptr<OpenMBV::Group> getObserversOpenMBVGrp() override { return observersOpenMBVGrp; }
121
122 virtual void calcxSize();
123 const fmatvec::Vec& getx() const { return x; };
124 fmatvec::Vec& getx() { return x; };
125 int getxSize() const { return xSize; }
126 void updatexRef(fmatvec::Vec &xParent);
127 void updatexdRef(fmatvec::Vec &xdParent);
128 void updatedxRef(fmatvec::Vec &dxParent);
129 void init(InitStage stage, const InitConfigSet &config) override;
130 virtual void initz();
131 virtual void writez(H5::GroupBase *parent);
132 virtual void readz0(H5::GroupBase *parent);
133 /*****************************************************/
134
135 /* INHERITED INTERFACE OF ELEMENT */
137 void setDynamicSystemSolver(DynamicSystemSolver* sys) override;
138 void plot() override;
139 void plotAtSpecialEvent() override;
140 /*****************************************************/
141
146 virtual int solveConstraintsFixpointSingle();
147
153 virtual int solveImpactsFixpointSingle();
154
159 virtual int solveConstraintsGaussSeidel();
160
166 virtual int solveImpactsGaussSeidel();
167
172 virtual int solveConstraintsRootFinding();
173
179 virtual int solveImpactsRootFinding();
180
184 virtual int jacobianConstraints();
185
189 virtual int jacobianImpacts();
190
194 virtual void checkConstraintsForTermination();
195
199 virtual void checkImpactsForTermination();
200
204 virtual void updaterFactors();
205
211 virtual Frame* getFrame(const std::string &name, bool check=true) const;
212
218 virtual Contour* getContour(const std::string &name, bool check=true) const;
219 /*****************************************************/
220
221 /* GETTER / SETTER */
222 void setFrameOfReference(Frame *frame) { R = frame; };
223 const Frame* getFrameOfReference() const { return R; };
224
225 const fmatvec::Mat& getT(bool check=true) const;
226 const fmatvec::Vec& geth(int i=0, bool check=true) const;
227 const fmatvec::SymMat& getM(bool check=true) const;
228 const fmatvec::SymMat& getLLM(bool check=true) const;
229 const fmatvec::Vec& getdq(bool check=true) const;
230 const fmatvec::Vec& getdu(bool check=true) const;
231 const fmatvec::Vec& getdx(bool check=true) const;
232 const fmatvec::Mat& getW(int i=0, bool check=true) const;
233 const fmatvec::Mat& getV(int i=0, bool check=true) const;
234 const fmatvec::Vec& getla(bool check=true) const;
235 const fmatvec::Vec& getLa(bool check=true) const;
236 const fmatvec::Vec& getg(bool check=true) const;
237 const fmatvec::Vec& getgd(bool check=true) const;
238 fmatvec::Vec& getla(bool check=true);
239 fmatvec::Vec& getLa(bool check=true);
240 void setla(const fmatvec::Vec &la_) { la = la_; }
241 void setLa(const fmatvec::Vec &La_) { La = La_; }
242 fmatvec::VecInt& getjsv() { return jsv; }
243 const fmatvec::VecInt& getjsv() const { return jsv; }
244 fmatvec::Mat& getW(int i=0, bool check=true);
245 fmatvec::SymMat& getLLM(bool check=true);
246 fmatvec::Vec& getdq(bool check=true);
247 fmatvec::Vec& getdu(bool check=true);
248 fmatvec::Vec& getdx(bool check=true);
249
250 fmatvec::VecInt& getLinkStatus() { return LinkStatus; }
251 fmatvec::VecInt& getLinkStatusReg() { return LinkStatusReg; }
252 const fmatvec::VecInt& getLinkStatus() const { return LinkStatus; }
253 const fmatvec::VecInt& getLinkStatusReg() const { return LinkStatusReg; }
254
255 const fmatvec::Mat& evalT();
256 const fmatvec::Vec& evalh(int i=0);
257 const fmatvec::SymMat& evalM();
258 const fmatvec::SymMat& evalLLM();
259 const fmatvec::Mat& evalW(int i=0);
260 const fmatvec::Mat& evalV(int i=0);
261 const fmatvec::Vec& evalwb();
262 const fmatvec::Vec& evalr(int i=0);
263 const fmatvec::Mat& evalJrla(int i=0);
264 const fmatvec::Vec& evalrdt();
265 const fmatvec::Vec& evalg();
266 const fmatvec::Vec& evalgd();
267 const fmatvec::Mat& evalWInverseKinetics();
268 const fmatvec::Mat& evalbInverseKinetics();
269
270 void setqd(const fmatvec::Vec& qd_) { qd = qd_; }
271 void setud(const fmatvec::Vec& ud_) { ud = ud_; }
272 void setxd(const fmatvec::Vec& xd_) { xd = xd_; }
273
274 int getxInd() { return xInd; }
275 int getlaInd() const { return laInd; }
276
277 int gethInd(int i=0) { return hInd[i]; }
278 void setlaInd(int ind) { laInd = ind; }
279 void setisInd(int ind) { isInd = ind; }
280 void setgInd(int ind) { gInd = ind; }
281 void setgdInd(int ind) { gdInd = ind; }
282 void setrFactorInd(int ind) { rFactorInd = ind; }
283 virtual void setsvInd(int svInd_);
284 void setLinkStatusInd(int LinkStatusInd_) {LinkStatusInd = LinkStatusInd_;};
285 void setLinkStatusRegInd(int LinkStatusRegInd_) {LinkStatusRegInd = LinkStatusRegInd_;};
286
287 void setqSize(int qSize_) { qSize = qSize_; }
288 void setuSize(int uSize_, int i=0) { uSize[i] = uSize_; }
289 void setxSize(int xSize_) { xSize = xSize_; }
290
291 int getisSize() const { return isSize; }
292 int getlaSize() const { return laSize; }
293 int getgSize() const { return gSize; }
294 int getgdSize() const { return gdSize; }
295 int getrFactorSize() const { return rFactorSize; }
296 int getsvSize() const { return svSize; }
297 int getLinkStatusSize() const { return LinkStatusSize; }
298 int getLinkStatusRegSize() const { return LinkStatusRegSize; }
299 /*****************************************************/
300
301 const std::vector<Object*>& getObjects() const { return object; }
302 const std::vector<Link*>& getLinks() const { return link; }
303 const std::vector<DynamicSystem*>& getDynamicSystems() const { return dynamicsystem; }
304 const std::vector<Frame*>& getFrames() const { return frame; }
305 const std::vector<Contour*>& getContours() const { return contour; }
306 const std::vector<Link*>& getSetValuedLinks() const { return linkSetValued; }
307
312 void updateqRef(fmatvec::Vec &qParent);
313
318 void updateqdRef(fmatvec::Vec &qdParent);
319
320 void updatedqRef(fmatvec::Vec &dqParent);
321
326 void updateuRef(fmatvec::Vec &uParent);
327
332 void updateuallRef(fmatvec::Vec &uParent);
333
338 void updateudRef(fmatvec::Vec &udParent);
339
340 void updateduRef(fmatvec::Vec &duParent);
341
346 void updateudallRef(fmatvec::Vec &udParent);
347
355 void updatehRef(fmatvec::Vec &hParent, int j=0);
356
361 void updaterRef(fmatvec::Vec &rParent, int j=0);
362
363 void updateJrlaRef(fmatvec::Mat &rParent, int j=0);
364
369 void updaterdtRef(fmatvec::Vec &rdtParent);
370
375 void updateTRef(fmatvec::Mat &TParent);
376
382 void updateMRef(fmatvec::SymMat &MParent);
383
389 void updateLLMRef(fmatvec::SymMat &LLMParent);
390
394 virtual void updateInternalStateRef(fmatvec::Vec &curisParent, fmatvec::Vec &nextisParent);
395
400 virtual void updategRef(fmatvec::Vec &gParent);
401
406 virtual void updategdRef(fmatvec::Vec &gdParent);
407
412 void updatelaRef(fmatvec::Vec &laParent);
413
418 void updateLaRef(fmatvec::Vec &LaParent);
419
420 void updatelaInverseKineticsRef(fmatvec::Vec &laParent);
421 void updatebInverseKineticsRef(fmatvec::Mat &bParent);
422
427 virtual void updatewbRef(fmatvec::Vec &wbParent);
428
434 virtual void updateWRef(fmatvec::Mat &WParent, int j=0);
435
441 void updateWInverseKineticsRef(fmatvec::Mat &WParent);
442
448 virtual void updateVRef(fmatvec::Mat &VParent, int j=0);
449
454 void updatesvRef(fmatvec::Vec& svParent);
455
460 void updatejsvRef(fmatvec::VecInt &jsvParent);
461
466 void updateLinkStatusRef(fmatvec::VecInt &LinkStatusParent);
467
472 void updateLinkStatusRegRef(fmatvec::VecInt &LinkStatusRegParent);
473
478 void updateresRef(fmatvec::Vec &resParent);
479
484 void updaterFactorRef(fmatvec::Vec &rFactorParent);
485
486 void clearElementLists();
487
492 void buildListOfDynamicSystems(std::vector<DynamicSystem*> &sys);
493
498 void buildListOfObjects(std::vector<Object*> &obj);
499
504 void buildListOfLinks(std::vector<Link*> &lnk);
505
510 void buildListOfConstraints(std::vector<Constraint*> &crt);
511
516 void buildListOfFrames(std::vector<Frame*> &frm);
517
522 void buildListOfContours(std::vector<Contour*> &cnt);
523
528 void buildListOfModels(std::vector<ModellingInterface*> &modelList);
529
534 void buildListOfInverseKineticsLinks(std::vector<Link*> &iklnk);
535
540 void buildListOfObservers(std::vector<Observer*> &obsrv);
541
545 void setUpInverseKinetics();
546
550 void setUpLinks();
551
555 bool gActiveChanged();
556
560 bool gActiveChangedReg();
561
565 bool detectImpact();
566
570 void calcsvSize();
571
575 void calclaSize(int j);
576
580 void calcLinkStatusSize();
581
585 void calcLinkStatusRegSize();
586
590 void calclaInverseKineticsSize();
591
595 void calcbInverseKineticsSize();
596
597 void calcisSize();
598
604 virtual void aboutToUpdateInternalState();
605
606 virtual void postprocessing();
607
611 void calcgSize(int j);
612
623 void calcgdSize(int j);
624
628 void calcrFactorSize(int j);
629
633 void setUpObjectsWithNonConstantMassMatrix();
634
638 void setUpActiveLinks();
639
654 void checkActive(int j);
655
659 virtual void setGeneralizedRelativePositionTolerance(double tol);
660
664 virtual void setGeneralizedRelativeVelocityTolerance(double tol);
665
669 virtual void setGeneralizedRelativeAccelerationTolerance(double tol);
670
674 virtual void setGeneralizedForceTolerance(double tol);
675
679 virtual void setGeneralizedImpulseTolerance(double tol);
680
683 virtual void setGeneralizedRelativePositionCorrectionValue(double corr);
684
688 virtual void setGeneralizedRelativeVelocityCorrectionValue(double corr);
689
693 void setrMax(double rMax);
694
699 int frameIndex(const Frame *frame_) const;
700
701 void addFrame(FixedRelativeFrame *frame);
702
703 void addContour(RigidContour *contour);
704
708 void addGroup(DynamicSystem *sys);
709
715 DynamicSystem* getGroup(const std::string &name,bool check=true) const;
716
720 void addObject(Object *obj);
721
727 Object* getObject(const std::string &name,bool check=true) const;
728
732 void addLink(Link *lnk);
733
737 void addConstraint(Constraint *crt);
738
742 void addInverseKineticsLink(Link *lnk);
743
744 Observer* getObserver(const std::string &name,bool check=true) const;
745 void addObserver(Observer *ele);
746
752 Link* getLink(const std::string &name,bool check=true) const;
753
759 Constraint* getConstraint(const std::string &name,bool check=true) const;
760
764 void addModel(ModellingInterface *model_);
765
771 ModellingInterface* getModel(const std::string &name, bool check=true) const;
772
774 Frame *getFrameI() { return I; }
775
776 Element *getChildByContainerAndName(const std::string &container, const std::string &name) const override;
777
778 virtual void updatecorr(int j);
779 void updatecorrRef(fmatvec::Vec &ref);
780 void calccorrSize(int j);
781
782 void checkRoot();
783
784 void resetUpToDate() override;
785
786 void updateStateTable();
787
788 H5::GroupBase *getFramesPlotGroup() override { return framesPlotGroup; }
789 H5::GroupBase *getContoursPlotGroup() override { return contoursPlotGroup; }
790 H5::GroupBase *getGroupsPlotGroup() override { return groupsPlotGroup; }
791 H5::GroupBase *getObjectsPlotGroup() override { return objectsPlotGroup; }
792 H5::GroupBase *getLinksPlotGroup() override { return linksPlotGroup; }
793 H5::GroupBase *getConstraintsPlotGroup() override { return constraintsPlotGroup; }
794 H5::GroupBase *getObserversPlotGroup() override { return observersPlotGroup; }
795
796 private:
797 friend class DynamicSystemSolver;
798 void addFrame(Frame *frame_);
799 void addContour(Contour *contour_);
800
801 protected:
805 Frame *R;
806
810 std::vector<Object*> object;
811 std::vector<Object*> objectWithNonConstantMassMatrix;
812 std::vector<Link*> link;
813 std::vector<Link*> linkSingleValued;
814 std::vector<Link*> linkSetValued;
815 std::vector<Link*> linkSetValuedActive;
816 std::vector<Link*> linkWithStopVector;
817 std::vector<ModellingInterface*> model;
818 std::vector<DynamicSystem*> dynamicsystem;
819 std::vector<Link*> inverseKineticsLink;
820 std::vector<Observer*> observer;
821 std::vector<Constraint*> constraint;
822
826 fmatvec::Mat T;
827
831 fmatvec::SymMat M;
832
836 fmatvec::SymMat LLM;
837
841 fmatvec::Vec q, qd, dq;
842
846 fmatvec::Vec u, ud, du;
847
851 fmatvec::Vec x, xd, dx;
852
856 fmatvec::Vec h[2], r[2], rdt;
857
861 fmatvec::Mat Jrla[2];
862
866 fmatvec::Mat W[2], V[2];
867
871 fmatvec::Vec la, La;
872
873 fmatvec::Vec curis, nextis;
874
878 fmatvec::Vec g, gd;
879
883 fmatvec::Vec wb;
884
888 fmatvec::Vec res;
889
893 fmatvec::Vec rFactor;
894
898 fmatvec::Vec sv;
899
903 fmatvec::VecInt jsv;
904
908 fmatvec::VecInt LinkStatus;
909
913 fmatvec::VecInt LinkStatusReg;
914
918 int qSize, qInd;
919
923 int uSize[2], uInd[2];
924
928 int xSize, xInd;
929
933 int hSize[2], hInd[2];
934
935 int isSize, isInd;
936
940 int gSize, gInd;
941
945 int gdSize, gdInd;
946
950 int laSize, laInd;
951
955 int rFactorSize, rFactorInd;
956
960 int svSize, svInd;
961
965 int LinkStatusSize, LinkStatusInd;
966
970 int LinkStatusRegSize, LinkStatusRegInd;
971
975 std::vector<Frame*> frame;
976 std::vector<Contour*> contour;
977
978 std::shared_ptr<OpenMBV::Group> openMBVGrp;
979 std::shared_ptr<OpenMBV::Group> framesOpenMBVGrp;
980 std::shared_ptr<OpenMBV::Group> contoursOpenMBVGrp;
981 std::shared_ptr<OpenMBV::Group> groupsOpenMBVGrp;
982 std::shared_ptr<OpenMBV::Group> objectsOpenMBVGrp;
983 std::shared_ptr<OpenMBV::Group> linksOpenMBVGrp;
984 std::shared_ptr<OpenMBV::Group> constraintsOpenMBVGrp;
985 std::shared_ptr<OpenMBV::Group> observersOpenMBVGrp;
986 std::shared_ptr<H5::File> hdf5File;
987
989 Frame *I;
990
994 int laInverseKineticsSize, bInverseKineticsSize;
995
996 fmatvec::Mat WInverseKinetics, bInverseKinetics;
997 fmatvec::Vec laInverseKinetics;
998
999 int corrSize, corrInd;
1000 fmatvec::Vec corr;
1001
1002 std::string saved_frameOfReference;
1003
1004 H5::GroupBase *framesPlotGroup;
1005 H5::GroupBase *contoursPlotGroup;
1006 H5::GroupBase *groupsPlotGroup;
1007 H5::GroupBase *objectsPlotGroup;
1008 H5::GroupBase *linksPlotGroup;
1009 H5::GroupBase *constraintsPlotGroup;
1010 H5::GroupBase *observersPlotGroup;
1011 };
1012 }
1013
1014 #endif
1015
MBSim::DynamicSystem::rFactorSize
int rFactorSize
size and local start index of rfactors relative to parent
Definition: dynamic_system.h:955
MBSim::DynamicSystem::addConstraint
void addConstraint(Constraint *crt)
Definition: dynamic_system.cc:1470
MBSim::DynamicSystem::setDynamicSystemSolver
void setDynamicSystemSolver(DynamicSystemSolver *sys) override
Definition: dynamic_system.cc:317
MBSim::DynamicSystem::gActiveChangedReg
bool gActiveChangedReg()
Definition: dynamic_system.cc:1095
MBSim::DynamicSystem::setGeneralizedRelativeAccelerationTolerance
virtual void setGeneralizedRelativeAccelerationTolerance(double tol)
Definition: dynamic_system.cc:1350
MBSim::DynamicSystem::updateLaRef
void updateLaRef(fmatvec::Vec &LaParent)
references to contact impulses of dynamic system parent
Definition: dynamic_system.cc:815
MBSim::DynamicSystem::q
fmatvec::Vec q
positions, differentiated positions, initial positions
Definition: dynamic_system.h:841
MBSim::DynamicSystem::jacobianConstraints
virtual int jacobianConstraints()
compute JACOBIAN of contact equations
Definition: dynamic_system.cc:524
MBSim::RigidContour
basic class for rigid contours
Definition: rigid_contour.h:37
MBSim::DynamicSystem::laInverseKineticsSize
int laInverseKineticsSize
size of contact force parameters of special links relative to parent
Definition: dynamic_system.h:994
MBSim::Link
general link to one or more objects
Definition: link.h:48
MBSim::DynamicSystem::laSize
int laSize
size and local start index of contact force parameters relative to parent
Definition: dynamic_system.h:950
MBSim::DynamicSystemSolver
solver interface for modelling and simulation of dynamic systems
Definition: dynamic_system_solver.h:61
MBSim::DynamicSystem::updateVRef
virtual void updateVRef(fmatvec::Mat &VParent, int j=0)
references to condensed contact force direction matrix of dynamic system parent
Definition: dynamic_system.cc:857
MBSim::DynamicSystem::updateWInverseKineticsRef
void updateWInverseKineticsRef(fmatvec::Mat &WParent)
references to contact force direction matrix of dynamic system parent
Definition: dynamic_system.cc:843
MBSim::DynamicSystem::setUpObjectsWithNonConstantMassMatrix
void setUpObjectsWithNonConstantMassMatrix()
rearrange vector of active setvalued links
Definition: dynamic_system.cc:1312
MBSim::DynamicSystem::getLink
Link * getLink(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:1487
MBSim::DynamicSystem::solveImpactsRootFinding
virtual int solveImpactsRootFinding()
solve impact equations with Newton scheme on velocity level
Definition: dynamic_system.cc:516
MBSim::DynamicSystem::getFrameI
Frame * getFrameI()
Definition: dynamic_system.h:774
MBSim::DynamicSystem::buildListOfObjects
void buildListOfObjects(std::vector< Object * > &obj)
build flat list of objects
Definition: dynamic_system.cc:981
MBSim::DynamicSystem::LLM
fmatvec::SymMat LLM
Cholesky decomposition of mass matrix.
Definition: dynamic_system.h:836
MBSim::DynamicSystem::getObject
Object * getObject(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:1444
MBSim::DynamicSystem::updateuRef
void updateuRef(fmatvec::Vec &uParent)
references to velocities of dynamic system parent
Definition: dynamic_system.cc:616
MBSim::DynamicSystem::buildListOfContours
void buildListOfContours(std::vector< Contour * > &cnt)
build flat list of contours
Definition: dynamic_system.cc:1017
MBSim::DynamicSystem::T
fmatvec::Mat T
linear relation matrix of position and velocity parameters
Definition: dynamic_system.h:826
MBSim::DynamicSystem::updateLinkStatusRegRef
void updateLinkStatusRegRef(fmatvec::VecInt &LinkStatusRegParent)
references to status vector of single valued links
Definition: dynamic_system.cc:908
MBSim::DynamicSystem::LinkStatus
fmatvec::VecInt LinkStatus
status of set-valued links
Definition: dynamic_system.h:908
MBSim::DynamicSystem::setUpLinks
void setUpLinks()
distribute links to set- and single valued container
Definition: dynamic_system.cc:1064
MBSim::DynamicSystem::u
fmatvec::Vec u
velocities, differentiated velocities, initial velocities
Definition: dynamic_system.h:846
MBSim::DynamicSystem::updaterFactors
virtual void updaterFactors()
update relaxation factors for contact equations
Definition: dynamic_system.cc:552
MBSim::DynamicSystem::uSize
int uSize[2]
size and local start index of velocities relative to parent
Definition: dynamic_system.h:923
MBSim::DynamicSystem::x
fmatvec::Vec x
order one parameters, differentiated order one parameters, initial order one parameters
Definition: dynamic_system.h:851
MBSim::FixedRelativeFrame
cartesian frame on rigid bodies
Definition: fixed_relative_frame.h:31
MBSim::DynamicSystem::checkImpactsForTermination
virtual void checkImpactsForTermination()
validate force laws concerning given tolerances on velocity level
Definition: dynamic_system.cc:546
MBSim::DynamicSystem::detectImpact
bool detectImpact()
Definition: dynamic_system.cc:1105
MBSim::DynamicSystem::updatewbRef
virtual void updatewbRef(fmatvec::Vec &wbParent)
references to TODO of dynamic system parent
Definition: dynamic_system.cc:829
MBSim::DynamicSystem::setGeneralizedForceTolerance
virtual void setGeneralizedForceTolerance(double tol)
Definition: dynamic_system.cc:1357
MBSim::DynamicSystem::solveConstraintsRootFinding
virtual int solveConstraintsRootFinding()
solve contact equations with Newton scheme
Definition: dynamic_system.cc:508
MBSim::DynamicSystem::init
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: dynamic_system.cc:382
MBSim::DynamicSystem::buildListOfInverseKineticsLinks
void buildListOfInverseKineticsLinks(std::vector< Link * > &iklnk)
build flat list of inverse kinetics links
Definition: dynamic_system.cc:1035
MBSim::DynamicSystem::getContour
virtual Contour * getContour(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:572
MBSim::DynamicSystem::updateresRef
void updateresRef(fmatvec::Vec &resParent)
references to residuum of contact equations of dynamic system parent
Definition: dynamic_system.cc:884
MBSim::DynamicSystem::setGeneralizedRelativePositionCorrectionValue
virtual void setGeneralizedRelativePositionCorrectionValue(double corr)
Definition: dynamic_system.cc:1371
MBSim::DynamicSystem::LinkStatusSize
int LinkStatusSize
size and local start index of set-valued link status vector relative to parent
Definition: dynamic_system.h:965
MBSim::DynamicSystem::getChildByContainerAndName
Element * getChildByContainerAndName(const std::string &container, const std::string &name) const override
Get the Element named name in the container named container.
Definition: dynamic_system.cc:1562
MBSim::Contour
basic class for contour definition for rigid (which do not know about their shape) and flexible (they...
Definition: contour.h:40
MBSim::Element
basic class of MBSim mainly for plotting
Definition: element.h:56
MBSim::DynamicSystem::updaterFactorRef
void updaterFactorRef(fmatvec::Vec &rFactorParent)
references to relaxation factors for contact equations of dynamic system parent
Definition: dynamic_system.cc:891
MBSim::DynamicSystem::addObject
void addObject(Object *obj)
Definition: dynamic_system.cc:1551
MBSim::DynamicSystem::gSize
int gSize
size and local start index of relative distances relative to parent
Definition: dynamic_system.h:940
MBSim::DynamicSystem::addInverseKineticsLink
void addInverseKineticsLink(Link *lnk)
Definition: dynamic_system.cc:1482
H5::GroupBase
MBSim::DynamicSystem::updateInternalStateRef
virtual void updateInternalStateRef(fmatvec::Vec &curisParent, fmatvec::Vec &nextisParent)
references to internal state of dynamic system parent
Definition: dynamic_system.cc:777
MBSim::DynamicSystem::buildListOfConstraints
void buildListOfConstraints(std::vector< Constraint * > &crt)
build flat list of all constraints
Definition: dynamic_system.cc:999
MBSim::DynamicSystem::gdSize
int gdSize
size and local start index of relative velocities relative to parent
Definition: dynamic_system.h:945
MBSim::DynamicSystem::updateWRef
virtual void updateWRef(fmatvec::Mat &WParent, int j=0)
references to contact force direction matrix of dynamic system parent
Definition: dynamic_system.cc:836
MBSim::DynamicSystem::plotAtSpecialEvent
void plotAtSpecialEvent() override
plots time dependent data at special events
Definition: dynamic_system.cc:363
MBSim::DynamicSystem::h
fmatvec::Vec h[2]
smooth, smooth with respect to objects, smooth with respect to links and nonsmooth
Definition: dynamic_system.h:856
MBSim::DynamicSystem::calcrFactorSize
void calcrFactorSize(int j)
calculates size of relaxation factors for contact equations
Definition: dynamic_system.cc:1302
MBSim::DynamicSystem::calcbInverseKineticsSize
void calcbInverseKineticsSize()
calculates size of contact force parameters
Definition: dynamic_system.cc:1216
MBSim::DynamicSystem::setGeneralizedImpulseTolerance
virtual void setGeneralizedImpulseTolerance(double tol)
Definition: dynamic_system.cc:1364
MBSim::DynamicSystem::frame
std::vector< Frame * > frame
vector of frames and contours
Definition: dynamic_system.h:975
MBSim::DynamicSystem::updaterRef
void updaterRef(fmatvec::Vec &rParent, int j=0)
references to nonsmooth right hand side of dynamic system parent
Definition: dynamic_system.cc:714
MBSim::DynamicSystem::res
fmatvec::Vec res
residuum of nonlinear contact equations for Newton scheme
Definition: dynamic_system.h:888
MBSim::DynamicSystem::updatelaRef
void updatelaRef(fmatvec::Vec &laParent)
references to contact forces of dynamic system parent
Definition: dynamic_system.cc:808
MBSim::DynamicSystem::updateLLMRef
void updateLLMRef(fmatvec::SymMat &LLMParent)
references to Cholesky decomposition of dynamic system parent
Definition: dynamic_system.cc:767
MBSim::DynamicSystem::setGeneralizedRelativePositionTolerance
virtual void setGeneralizedRelativePositionTolerance(double tol)
Definition: dynamic_system.cc:1336
MBSim::DynamicSystem::buildListOfFrames
void buildListOfFrames(std::vector< Frame * > &frm)
build flat list of frames
Definition: dynamic_system.cc:1008
MBSim::DynamicSystem
dynamic system as topmost hierarchical level
Definition: dynamic_system.h:58
MBSim::DynamicSystem::buildListOfObservers
void buildListOfObservers(std::vector< Observer * > &obsrv)
build flat list of observers
Definition: dynamic_system.cc:1044
MBSim::DynamicSystem::I
Frame * I
Definition: dynamic_system.h:989
MBSim::DynamicSystem::R
Frame * R
parent frame
Definition: dynamic_system.h:805
MBSim::DynamicSystem::calclaInverseKineticsSize
void calclaInverseKineticsSize()
calculates size of contact force parameters
Definition: dynamic_system.cc:1206
MBSim::DynamicSystem::calcLinkStatusSize
void calcLinkStatusSize()
calculates size of set-valued link status vector
Definition: dynamic_system.cc:1153
MBSim::DynamicSystem::solveImpactsGaussSeidel
virtual int solveImpactsGaussSeidel()
solve impact equations with Gauss-Seidel scheme on velocity level
Definition: dynamic_system.cc:500
MBSim::DynamicSystem::plot
void plot() override
plots time dependent data
Definition: dynamic_system.cc:344
MBSim::DynamicSystem::LinkStatusReg
fmatvec::VecInt LinkStatusReg
status of single-valued links
Definition: dynamic_system.h:913
MBSim::DynamicSystem::checkActive
void checkActive(int j)
check if set-valued contacts are active and set corresponding attributes
Definition: dynamic_system.cc:1330
MBSim::Element::InitStage
InitStage
The stages of the initialization.
Definition: element.h:62
MBSim::DynamicSystem::updatejsvRef
void updatejsvRef(fmatvec::VecInt &jsvParent)
references to boolean evaluation of stopvector concerning roots of dynamic system parent
Definition: dynamic_system.cc:874
MBSim::DynamicSystem::qSize
int qSize
size and local start index of positions relative to parent
Definition: dynamic_system.h:918
MBSim::DynamicSystem::solveConstraintsGaussSeidel
virtual int solveConstraintsGaussSeidel()
solve contact equations with Gauss-Seidel scheme
Definition: dynamic_system.cc:492
MBSim::DynamicSystem::DynamicSystem
DynamicSystem(const std::string &name)
constructor
Definition: dynamic_system.cc:45
MBSim::DynamicSystem::getModel
ModellingInterface * getModel(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:1526
MBSim::DynamicSystem::setUpActiveLinks
void setUpActiveLinks()
rearrange vector of active setvalued links
Definition: dynamic_system.cc:1320
MBSim::DynamicSystem::addModel
void addModel(ModellingInterface *model_)
Definition: dynamic_system.cc:1515
MBSim::DynamicSystem::buildListOfModels
void buildListOfModels(std::vector< ModellingInterface * > &modelList)
build flat list of models
Definition: dynamic_system.cc:1026
MBSim::DynamicSystem::getGroup
DynamicSystem * getGroup(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:1430
MBSim::DynamicSystem::buildListOfLinks
void buildListOfLinks(std::vector< Link * > &lnk)
build flat list of links
Definition: dynamic_system.cc:990
MBSim::DynamicSystem::updateuallRef
void updateuallRef(fmatvec::Vec &uParent)
references to velocities of dynamic system parent
Definition: dynamic_system.cc:626
MBSim::DynamicSystem::setrMax
void setrMax(double rMax)
Definition: dynamic_system.cc:1385
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::DynamicSystem::updateqdRef
void updateqdRef(fmatvec::Vec &qdParent)
references to differentiated positions of dynamic system parent
Definition: dynamic_system.cc:596
MBSim::DynamicSystem::updatehRef
void updatehRef(fmatvec::Vec &hParent, int j=0)
references to smooth right hand side of dynamic system parent
Definition: dynamic_system.cc:701
MBSim::DynamicSystem::updatesvRef
void updatesvRef(fmatvec::Vec &svParent)
references to stopvector (rootfunction for event driven integrator) of dynamic system parent
Definition: dynamic_system.cc:864
MBSim::DynamicSystem::LinkStatusRegSize
int LinkStatusRegSize
size and local start index of single-valued link status vector relative to parent
Definition: dynamic_system.h:970
MBSim::DynamicSystem::calcgdSize
void calcgdSize(int j)
calculates size of gap velocities
Definition: dynamic_system.cc:1292
MBSim::DynamicSystem::wb
fmatvec::Vec wb
TODO.
Definition: dynamic_system.h:883
MBSim::Constraint
Class for constraints between generalized coordinates of objects.
Definition: constraint.h:30
MBSim::DynamicSystem::getFrame
virtual Frame * getFrame(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:558
MBSim::DynamicSystem::checkConstraintsForTermination
virtual void checkConstraintsForTermination()
validate force laws concerning given tolerances
Definition: dynamic_system.cc:540
MBSim::DynamicSystem::svSize
int svSize
size and local start index of stop vector relative to parent
Definition: dynamic_system.h:960
MBSim::Frame
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
MBSim::ModellingInterface
Interface for models of arbitrary domains, e.g. electrical components.
Definition: modelling_interface.h:35
MBSim::DynamicSystem::rFactor
fmatvec::Vec rFactor
rfactors for relaxation nonlinear contact equations
Definition: dynamic_system.h:893
MBSim::DynamicSystem::getConstraint
Constraint * getConstraint(const std::string &name, bool check=true) const
Definition: dynamic_system.cc:1501
MBSim::DynamicSystem::calcgSize
void calcgSize(int j)
calculates size of relative distances
Definition: dynamic_system.cc:1282
MBSim::DynamicSystem::sv
fmatvec::Vec sv
stop vector (root functions for event driven integration
Definition: dynamic_system.h:898
MBSim::DynamicSystem::updateudRef
void updateudRef(fmatvec::Vec &udParent)
references to differentiated velocities of dynamic system parent
Definition: dynamic_system.cc:634
MBSim::DynamicSystem::solveImpactsFixpointSingle
virtual int solveImpactsFixpointSingle()
solve impact equations with single step fixed point scheme on velocity level
Definition: dynamic_system.cc:484
MBSim::DynamicSystem::updateTRef
void updateTRef(fmatvec::Mat &TParent)
references to linear transformation matrix between differentiated positions and velocities of dynamic...
Definition: dynamic_system.cc:747
MBSim::DynamicSystem::g
fmatvec::Vec g
relative distances and velocities
Definition: dynamic_system.h:878
MBSim::DynamicSystem::calcLinkStatusRegSize
void calcLinkStatusRegSize()
calculates size of single-valued link status vector
Definition: dynamic_system.cc:1168
MBSim::DynamicSystem::gActiveChanged
bool gActiveChanged()
Definition: dynamic_system.cc:1085
MBSim::DynamicSystem::setGeneralizedRelativeVelocityCorrectionValue
virtual void setGeneralizedRelativeVelocityCorrectionValue(double corr)
Definition: dynamic_system.cc:1378
MBSim::DynamicSystem::updateqRef
void updateqRef(fmatvec::Vec &qParent)
references to positions of dynamic system parent
Definition: dynamic_system.cc:586
MBSim::DynamicSystem::updategRef
virtual void updategRef(fmatvec::Vec &gParent)
references to relative distances of dynamic system parent
Definition: dynamic_system.cc:794
MBSim::Element::plotGroup
H5::GroupBase * plotGroup
associated plot group
Definition: element.h:297
MBSim::DynamicSystem::calcsvSize
void calcsvSize()
calculates size of stop vector
Definition: dynamic_system.cc:1183
MBSim::DynamicSystem::setGeneralizedRelativeVelocityTolerance
virtual void setGeneralizedRelativeVelocityTolerance(double tol)
Definition: dynamic_system.cc:1343
MBSim::DynamicSystem::~DynamicSystem
~DynamicSystem() override
destructor
Definition: dynamic_system.cc:61
MBSim::DynamicSystem::object
std::vector< Object * > object
container for possible ingredients
Definition: dynamic_system.h:810
MBSim::DynamicSystem::la
fmatvec::Vec la
contact force parameters
Definition: dynamic_system.h:871
MBSim::DynamicSystem::updateLinkStatusRef
void updateLinkStatusRef(fmatvec::VecInt &LinkStatusParent)
references to status vector of set valued links with piecewise link equations (which piece is valid)
Definition: dynamic_system.cc:898
MBSim::Observer
Definition: observer.h:26
MBSim::DynamicSystem::updateMRef
void updateMRef(fmatvec::SymMat &MParent)
references to mass matrix of dynamic system parent
Definition: dynamic_system.cc:757
MBSim::DynamicSystem::setUpInverseKinetics
void setUpInverseKinetics()
analyse constraints of dynamic systems for usage in inverse kinetics
Definition: dynamic_system.cc:1053
MBSim::DynamicSystem::frameIndex
int frameIndex(const Frame *frame_) const
Definition: dynamic_system.cc:1422
MBSim::DynamicSystem::hSize
int hSize[2]
size and local start index of order smooth right hand side relative to parent
Definition: dynamic_system.h:933
MBSim::DynamicSystem::updaterdtRef
void updaterdtRef(fmatvec::Vec &rdtParent)
references to nonsmooth right hand side of dynamic system parent
Definition: dynamic_system.cc:737
MBSim::DynamicSystem::xSize
int xSize
size and local start index of order one parameters relative to parent
Definition: dynamic_system.h:928
MBSim::DynamicSystem::calclaSize
void calclaSize(int j)
calculates size of contact force parameters
Definition: dynamic_system.cc:1196
MBSim::DynamicSystem::jsv
fmatvec::VecInt jsv
boolean evaluation of stop vector concerning roots
Definition: dynamic_system.h:903
MBSim::DynamicSystem::solveConstraintsFixpointSingle
virtual int solveConstraintsFixpointSingle()
solve contact equations with single step fixed point scheme
Definition: dynamic_system.cc:476
MBSim::DynamicSystem::jacobianImpacts
virtual int jacobianImpacts()
compute JACOBIAN of contact equations on velocity level
Definition: dynamic_system.cc:532
MBSim::DynamicSystem::addLink
void addLink(Link *lnk)
Definition: dynamic_system.cc:1458
MBSim::DynamicSystem::aboutToUpdateInternalState
virtual void aboutToUpdateInternalState()
Definition: dynamic_system.cc:1254
MBSim::DynamicSystem::M
fmatvec::SymMat M
mass matrix
Definition: dynamic_system.h:831
MBSim::DynamicSystem::Jrla
fmatvec::Mat Jrla[2]
Jacobian dr/dla.
Definition: dynamic_system.h:861
MBSim::DynamicSystem::buildListOfDynamicSystems
void buildListOfDynamicSystems(std::vector< DynamicSystem * > &sys)
build flat list of dynamic systems
Definition: dynamic_system.cc:972
MBSim::DynamicSystem::updateudallRef
void updateudallRef(fmatvec::Vec &udParent)
references to velocities of dynamic system parent
Definition: dynamic_system.cc:654
MBSim::DynamicSystem::addGroup
void addGroup(DynamicSystem *sys)
Definition: dynamic_system.cc:1540
MBSim::DynamicSystem::updategdRef
virtual void updategdRef(fmatvec::Vec &gdParent)
references to relative velocities of dynamic system parent
Definition: dynamic_system.cc:801
MBSim::Object
class for all objects having own dynamics and mass
Definition: object.h:42
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30