mbsim  4.0.0
MBSim Kernel
linear_regularized_coulomb_friction.h
1/* Copyright (C) 2004-2009 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: markus.ms.schneider@gmail.com
18 */
19
20#ifndef _LINEAR_REGULARIZED_COULOMB_FRICTION_H_
21#define _LINEAR_REGULARIZED_COULOMB_FRICTION_H_
22
23#include "mbsim/functions/function.h"
24
25namespace MBSim {
26
34 class LinearRegularizedCoulombFriction : public Function<fmatvec::Vec(fmatvec::Vec,double)> {
35 public:
40
46 LinearRegularizedCoulombFriction(double mu_, double gdLim_=0.01) : mu(mu_), gdLim(gdLim_) {}
47
48 /* INHERITED INTERFACE OF FUNCTION2 */
49 fmatvec::Vec operator()(const fmatvec::Vec &gd, const double& laN) override;
50 fmatvec::Vec parDer2(const fmatvec::Vec &gd, const double& laN) override;
51 void initializeUsingXML(xercesc::DOMElement *element) override;
52 /***************************************************/
53
54 /* GETTER / SETTER */
55 void setFrictionCoefficient(double mu_) { mu=mu_; }
56 void setMarginalVelocity(double gdLim_) { gdLim=gdLim_; }
57 /***************************************************/
58
59 protected:
63 double mu{0}, gdLim{0.01};
64 };
65
66}
67
68#endif
Definition: function.h:53
function describing a linear regularized relationship between the input relative velocity and the out...
Definition: linear_regularized_coulomb_friction.h:34
double mu
friction coefficient, border with respect to the relative velocity for the linear regularized increas...
Definition: linear_regularized_coulomb_friction.h:63
LinearRegularizedCoulombFriction(double mu_, double gdLim_=0.01)
constructor
Definition: linear_regularized_coulomb_friction.h:46
LinearRegularizedCoulombFriction()
constructor
Definition: linear_regularized_coulomb_friction.h:39
namespace MBSim
Definition: bilateral_constraint.cc:30