mbsim  4.0.0
MBSim Kernel
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
25namespace MBSim {
26
27 class TyreModel;
28 class RigidContour;
29
30 class TyreContact : public ContourLink {
31 public:
32 TyreContact(const std::string &name="");
34
35 void setTyreModel(TyreModel *model_);
36 TyreModel* getTyreModel() { return model; }
37
38 void init(InitStage stage, const InitConfigSet &config) override;
39 void initializeUsingXML(xercesc::DOMElement *element) override;
40 void plot() override;
41
42 void calcSize() override;
43 void calcxSize() override;
44 void calcisSize() override;
45
46 const fmatvec::Vec3& evalForwardVelocity() { if(updfvel) updateForwardVelocity(); return RvC; }
47 fmatvec::Vec3& getForwardVelocity(bool check=true) { assert((not check) or (not updfvel)); return RvC; }
48 void updatePositions(Frame *frame) override;
49 void updateGeneralizedPositions() override;
50 void updateGeneralizedVelocities() override;
51 void updateForceDirections() override;
52 void updateForwardVelocity();
53 void updateGeneralizedForces() override;
54 void updateh(int i=0) override;
55
56 void updatexd() override;
57
58 bool isActive() const override { return false; }
59 bool gActiveChanged() override { return false; }
60 bool isSingleValued() const override { return true; }
61
62 void setInitialGuess(const fmatvec::MatV &zeta0_) { zeta0 <<= zeta0_; }
63 void setTolerance(double tol_) { tol = tol_; }
64
65 void resetUpToDate() override;
66
67 RigidContour* getRigidContour(int i);
68
69 protected:
70 TyreModel *model{nullptr};
71 fmatvec::Vec3 RvC;
72 fmatvec::MatV zeta0;
73 double tol{1e-10};
74 bool updfvel{true};
75 };
76
77}
78
79#endif
InitStage
The stages of the initialization.
Definition: element.h:62
std::string name
name of element
Definition: element.h:260
cartesian frame on bodies used for application of e.g. links and loads
Definition: frame.h:39
Definition: tyre_contact.h:30
bool gActiveChanged() override
Definition: tyre_contact.h:59
void plot() override
plots time dependent data
Definition: tyre_contact.cc:123
bool isActive() const override
Definition: tyre_contact.h:58
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:60
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: tyre_contact.cc:87
Definition: tyre_model.h:29
namespace MBSim
Definition: bilateral_constraint.cc:30