mbsim  4.0.0
MBSim Kernel
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
tyre_contact.h
1 /* Copyright (C) 2004-2022 MBSim Development Team
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Contact: martin.o.foerg@googlemail.com
18  */
19 
20 #ifndef _TYRE_CONTACT_H
21 #define _TYRE_CONTACT_H
22 
23 #include "mbsim/links/contour_link.h"
24 
25 namespace MBSim {
26 
27  class TyreModel;
28 
29  class TyreContact : public ContourLink {
30  public:
31  TyreContact(const std::string &name="");
32  ~TyreContact();
33 
34  void setTyreModel(TyreModel *model_);
35  TyreModel* getTyreModel() { return model; }
36 
37  void init(InitStage stage, const InitConfigSet &config) override;
38  void initializeUsingXML(xercesc::DOMElement *element) override;
39  void plot() override;
40 
41  void calcSize() override;
42  void calcxSize() override;
43  void calcisSize() override;
44 
45  const fmatvec::Vec3& evalForwardVelocity() { if(updfvel) updateForwardVelocity(); return RvC; }
46  fmatvec::Vec3& getForwardVelocity(bool check=true) { assert((not check) or (not updfvel)); return RvC; }
47  void updatePositions(Frame *frame) override;
48  void updateGeneralizedPositions() override;
49  void updateGeneralizedVelocities() override;
50  void updateForceDirections() override;
51  void updateForwardVelocity();
52  void updateGeneralizedForces() override;
53  void updateh(int i=0) override;
54 
55  void updatexd() override;
56 
57  bool isActive() const override { return false; }
58  bool gActiveChanged() override { return false; }
59  bool isSingleValued() const override { return true; }
60 
61  void setInitialGuess(const fmatvec::Vec2 &zeta0_) { zeta0 = zeta0_; }
62  void setTolerance(double tol_) { tol = tol_; }
63 
64  void resetUpToDate() override;
65 
66  protected:
67  TyreModel *model{nullptr};
68  fmatvec::Vec3 RvC;
69  bool plane;
70  fmatvec::Vec2 zeta0;
71  double tol{1e-10};
72  bool updfvel{true};
73  };
74 
75 }
76 
77 #endif
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: tyre_contact.cc:86
bool isActive() const override
Definition: tyre_contact.h:57
bool gActiveChanged() override
Definition: tyre_contact.h:58
InitStage
The stages of the initialization.
Definition: element.h:62
Definition: tyre_model.h:27
std::string name
name of element
Definition: element.h:260
void plot() override
plots time dependent data
Definition: tyre_contact.cc:127
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
Definition: tyre_contact.h:29
bool isSingleValued() const override
asks the link if it contains single valued force laws that contribute to the right-hand side vector h...
Definition: tyre_contact.h:59