Class FrictionContact

Defined in Program listing for file kernel/src/simulationTools/FrictionContact.hpp

class FrictionContact : public LinearOSNS

Formalization and Resolution of a Friction-Contact Problem.

This class is devoted to the formalization and the resolution of friction contact problems defined by :

\[\begin{split} velocity = q + M reaction \\ \\ velocity \geq 0, reaction \geq 0, reaction^{T} velocity =0 \end{split}\]

and a Coulomb friction law.


  • \( velocity \in R^{n} \) and \( reaction \in R^{n} \) the unknowns,

  • \( M \in R^{n \times n } \) and \( q \in R^{n} \)

The dimension of the problem (2D or 3D) is given by the variable contactProblemDim and the proper Numerics driver will be called according to this value.

Construction: just set Numerics Solver id

Main functions:


  • compute(time) formalize, solve and post-process the problem.

pre- and post-pro are common to all LinearOSNS and defined in this class.

For details regarding the available options, see Nonsmooth problems formulations and available solvers in users’ guide.

Public Functions

FrictionContact(int dimPb = 3, int numericsSolverId = SICONOS_FRICTION_3D_NSGS)

constructor (solver id and dimension)

  • dimPb – dimension (2D or 3D) of the friction-contact problem (default: 3)

  • numericsSolverId – id of the solver to be used default (default: SICONOS_FRICTION_3D_NSGS)

FrictionContact(int dimPb, SP::SolverOptions options)

constructor from a pre-defined solver options set


options – the options set

inline virtual ~FrictionContact()


inline int getFrictionContactDim() const

get the type of FrictionContact problem (2D or 3D)


an int (2 or 3)

inline const MuStorage getMu() const

get the vector mu, list of the friction coefficients


a vector of double

inline SP::MuStorage mu() const

get a pointer to mu, the list of the friction coefficients


pointer on a std::vector<double>

inline double getMu(unsigned int i) const

get the value of the component number i of mu, the vector of the friction coefficients


i – the component number (starting from 0)


double value of mu

void updateMu()

update mu vector

inline void setNumericsDriver(Driver newFunction)

set the driver-function used to solve the problem


newFunction – function of prototype Driver

virtual void initialize(SP::Simulation simulation) override

initialize the FrictionContact problem(compute topology …)


simulation – the simulation, owner of this OSNSPB

SP::FrictionContactProblem frictionContactProblem()

the friction contact problem from Numerics

FrictionContactProblem *frictionContactProblemPtr()

the friction contact problem from Numerics (raw ptr, do not free)

int solve(SP::FrictionContactProblem problem = SP::FrictionContactProblem())

solve a friction contact problem


problem – the friction contact problem


info solver information result

virtual int compute(double time) override

Compute the unknown reaction and velocity and update the Interaction (y and lambda )


time – the current time


int information about the solver convergence (0: ok, >0 problem, see Numerics documentation)

virtual void display() const override

print the data to the screen