mbsim 4.0.0 MBSim Kernel

generalized_friction.h
1 /* Copyright (C) 2004-2009 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_FRICTION_H_
20 #define _GENERALIZED_FRICTION_H_
21
22 #include "mbsim/links/dual_rigid_body_link.h"
23 #include "mbsim/functions/function.h"
24
25 namespace MBSim {
26
27 class FrictionForceLaw;
28 class FrictionImpactLaw;
29
30 class GeneralizedFriction : public DualRigidBodyLink {
31 protected:
32 FrictionForceLaw *laT{nullptr};
33 FrictionImpactLaw *LaT{nullptr};
34 Function<double(double)> *laN{nullptr};
35 unsigned int gdActive{1};
36 unsigned int gddActive{1};
37 fmatvec::Vec gdn, gdd;
38 int gdDir;
39 int rootID{0};
40 public:
41 GeneralizedFriction(const std::string &name="") : DualRigidBodyLink(name), gdn(1), gdd(1) { }
42 ~GeneralizedFriction() override;
43 void updateGeneralizedForces() override;
44 void updateh(int i=0) override;
45 void updateW(int i=0) override;
46 void updatewb() override;
47 void updateg() override { }
48 void updategd() override;
49 const double& evalgdn();
50 const double& evalgdd();
51
52 bool isActive() const override { return true; }
53 bool gActiveChanged() override { return false; }
54 bool isSetValued() const override;
55 bool isSingleValued() const override { return true; }
56 void init(InitStage stage, const InitConfigSet &config) override;
57 void plot() override;
58
59 void setGeneralizedFrictionForceLaw(FrictionForceLaw *laT_);
60 void setGeneralizedFrictionImpactLaw(FrictionImpactLaw *LaT_);
61 void setGeneralizedNormalForceFunction(Function<double(double)> *laN_) {
62 laN = laN_;
63 laN->setParent(this);
64 }
65
66 void updateStopVector() override;
67 void calclaSize(int j) override;
68 void calcgSize(int j) override;
69 void calcgdSize(int j) override;
70 void calcrFactorSize(int j) override;
71 void calcsvSize() override;
72 void checkActive(int j) override;
73 void calccorrSize(int j) override;
74 void updatecorr(int j) override;
75 void checkRoot() override;
76 void updaterFactors() override;
77 void solveConstraintsFixpointSingle() override;
78 void solveImpactsFixpointSingle() override;
79 void checkConstraintsForTermination() override;
80 void checkImpactsForTermination() override;
81
82 void initializeUsingXML(xercesc::DOMElement *element) override;
83 };
84
85 }
86
87 #endif
MBSim::GeneralizedFriction::solveImpactsFixpointSingle
void solveImpactsFixpointSingle() override
Definition: generalized_friction.cc:317
MBSim::GeneralizedFriction::solveConstraintsFixpointSingle
void solveConstraintsFixpointSingle() override
Definition: generalized_friction.cc:300
MBSim::GeneralizedFriction
Definition: generalized_friction.h:30
MBSim::DualRigidBodyLink
Definition: dual_rigid_body_link.h:27
MBSim::GeneralizedFriction::calclaSize
void calclaSize(int j) override
calculates size of contact force parameters
Definition: generalized_friction.cc:137
MBSim::GeneralizedFriction::isSingleValued
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_friction.h:55
MBSim::GeneralizedFriction::checkConstraintsForTermination
void checkConstraintsForTermination() override
verify underlying force laws concerning given tolerances
Definition: generalized_friction.cc:334
MBSim::FrictionImpactLaw
basic friction force law on velocity level for constraint description
Definition: friction_impact_law.h:32
MBSim::GeneralizedFriction::gActiveChanged
bool gActiveChanged() override
Definition: generalized_friction.h:53
MBSim::Element::InitStage
InitStage
The stages of the initialization.
Definition: element.h:62
MBSim::FrictionForceLaw
basic friction force law on acceleration level for constraint description
Definition: friction_force_law.h:34
MBSim::GeneralizedFriction::calcgSize
void calcgSize(int j) override
calculates size of relative distances
Definition: generalized_friction.cc:149
MBSim::Function
Definition: contact_kinematics.h:32
MBSim::Element::name
std::string name
name of element
Definition: element.h:260
MBSim::GeneralizedFriction::plot
void plot() override
plots time dependent data
Definition: generalized_friction.cc:112
MBSim::GeneralizedFriction::calcgdSize
void calcgdSize(int j) override
calculates size of gap velocities
Definition: generalized_friction.cc:154
MBSim::GeneralizedFriction::calcsvSize
void calcsvSize() override
calculates size of stopvector (root function for event driven integration)
Definition: generalized_friction.cc:174
MBSim::GeneralizedFriction::checkActive
void checkActive(int j) override
check if set-valued contacts are active and set corresponding attributes
Definition: generalized_friction.cc:179
MBSim::GeneralizedFriction::checkImpactsForTermination
void checkImpactsForTermination() override
verify underlying force laws on velocity level concerning given tolerances
Definition: generalized_friction.cc:354
MBSim::GeneralizedFriction::init
void init(InitStage stage, const InitConfigSet &config) override
plots time series header
Definition: generalized_friction.cc:91
MBSim::GeneralizedFriction::isActive
bool isActive() const override
Definition: generalized_friction.h:52
MBSim::GeneralizedFriction::calcrFactorSize
void calcrFactorSize(int j) override
calculates size of rfactors
Definition: generalized_friction.cc:166
MBSim::GeneralizedFriction::isSetValued
bool isSetValued() const override
asks the link if it contains force laws that contribute to the lagrange multiplier and is therefore s...
Definition: generalized_friction.cc:42
MBSim::GeneralizedFriction::updaterFactors
void updaterFactors() override
update relaxation factors for contact equations
Definition: generalized_friction.cc:278
MBSim
namespace MBSim
Definition: bilateral_constraint.cc:30