mbsim  4.0.0
MBSim Kernel
generalized_transmission.h
1/* Copyright (C) 2004-2026 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 _GENERALIZED_TRANSMISSION_H_
20#define _GENERALIZED_TRANSMISSION_H_
21
22#include "mbsim/links/dual_rigid_body_link.h"
23#include "mbsim/functions/function.h"
24
25namespace MBSim {
26
27 class FrictionForceLaw;
28 class FrictionImpactLaw;
29
31 protected:
32 Function<double(double)> *g{nullptr};
33 fmatvec::VecV i;
34 double sForce{1};
35 bool iSync{false};
36 unsigned int active{1};
37 fmatvec::Vec gdn, gdd;
38 int i0{0};
39 int gdDir{1};
40 int rootID{0};
41 public:
42 GeneralizedTransmission(const std::string &name="") : DualRigidBodyLink(name), gdn(1), gdd(1) { }
43 ~GeneralizedTransmission() override;
44 void updateGeneralizedForces() override;
45 void updateh(int i=0) override;
46 void updateW(int i=0) override;
47 void updatewb() override;
48 void updateg() override { }
49 void updategd() override;
50 const double& evalgdn();
51 const double& evalgdd();
52 bool isActive() const override { return true; }
53 bool gActiveChanged() override { return false; }
54 bool isSetValued() const override { return true; }
55 bool isSingleValued() const override { return true; }
56 void plot() override;
57 void init(InitStage stage, const InitConfigSet &config) override;
58
59 void setTransmissions(const fmatvec::VecV i_) { i <<= i_; }
60 void setGearFunction(Function<double(double)> *g_) {
61 g = g_;
62 g->setParent(this);
63 }
64 void setGeneralizedSynchronizationForce(double sForce_) { sForce = sForce_; }
65 void setImpulsiveSynchronization(bool iSync_) { iSync = iSync_; }
66
67 void updateTransmission();
68
69 void updateStopVector() override;
70 void calclaSize(int j) override;
71 void calcgSize(int j) override;
72 void calcgdSize(int j) override;
73 void calcrFactorSize(int j) override;
74 void calcsvSize() override;
75 void checkActive(int j) override;
76 void calccorrSize(int j) override;
77 void updatecorr(int j) override;
78 void checkRoot() override;
79 void updaterFactors() override;
80 void solveConstraintsFixpointSingle() override;
81 void solveImpactsFixpointSingle() override;
82 void solveImpactsGaussSeidel() override;
83 void checkConstraintsForTermination() override;
84 void checkImpactsForTermination() override;
85
86 void initializeUsingXML(xercesc::DOMElement *element) override;
87 };
88
89}
90
91#endif
InitStage
The stages of the initialization.
Definition: element.h:63
std::string name
name of element
Definition: element.h:263
Definition: function.h:53
Definition: generalized_transmission.h:30
void calcrFactorSize(int j) override
calculates size of rfactors
Definition: generalized_transmission.cc:154
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: generalized_transmission.cc:93
bool isSingleValued() const override
asks the link if it contains single valued force laws that contribute to the right-hand side vector h
Definition: generalized_transmission.h:55
void checkImpactsForTermination() override
verify underlying force laws on velocity level concerning given tolerances
Definition: generalized_transmission.cc:322
void calcgSize(int j) override
calculates size of relative distances
Definition: generalized_transmission.cc:139
void calcsvSize() override
calculates size of stopvector (root function for event driven integration)
Definition: generalized_transmission.cc:162
void checkConstraintsForTermination() override
verify underlying force laws concerning given tolerances
Definition: generalized_transmission.cc:302
void checkActive(int j) override
check if set-valued contacts are active and set corresponding attributes
Definition: generalized_transmission.cc:167
void calclaSize(int j) override
calculates size of contact force parameters
Definition: generalized_transmission.cc:129
void solveImpactsGaussSeidel() override
Definition: generalized_transmission.cc:285
void calcgdSize(int j) override
calculates size of gap velocities
Definition: generalized_transmission.cc:144
void plot() override
plots time dependent data
Definition: generalized_transmission.cc:113
bool isSetValued() const override
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: generalized_transmission.h:54
void solveImpactsFixpointSingle() override
Definition: generalized_transmission.cc:268
bool gActiveChanged() override
Definition: generalized_transmission.h:53
bool isActive() const override
Definition: generalized_transmission.h:52
void solveConstraintsFixpointSingle() override
Definition: generalized_transmission.cc:251
void updaterFactors() override
update relaxation factors for contact equations
Definition: generalized_transmission.cc:229
namespace MBSim
Definition: bilateral_constraint.cc:30