Class GlobalFrictionContact

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

class GlobalFrictionContact : public LinearOSNS

Formalization and Resolution of a Friction-Contact Problem.

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

\[\begin{split}M velocity = q + H reaction \\ globalVelocities = H^T velocity + tildeGlobalVelocities\end{split}\]

and \(globalVelocities, reaction\) belongs to the Coulomb friction law with unilateral contact.


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

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

  • \(globalVelocities \in R^{m} \) and \(reaction \in R^{m} \) the unknowns,

  • \(tildeGlobalVelocities \in R^{m} \) is the modified local velocity ( \( e U_{N,k}\))

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

  • \(H \in R^{n \times m } \)

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


  • Constructor from data (inputs = Simulations*, id, SP::NonSmoothSolver) - The solver is optional. Main functions:

Main functions:

  • formalization of the problem: computes M,q using the set of “active” Interactions from the simulation and

    the interactionBlock-matrices saved in the field interactionBlocks.


    initialize(), computeInteractionBlock(), preCompute()

  • solving of the GlobalFrictionContact problem: function compute(), used to call solvers from Numerics through

    the frictionContact2D_driver() or frictionContact3D_driver() interface of Numerics.

  • post-treatment of data: set values of y/lambda variables of the active Interaction (ie Interactions) using

    ouput results from the solver (velocity,reaction); function


Public Functions

GlobalFrictionContact(int dimPb, int numericsSolverId = SICONOS_GLOBAL_FRICTION_3D_NSGS)

constructor (solver id and dimension)


GlobalFrictionContact(int dimPb, SP::SolverOptions options)

constructor from a pre-defined solver options set.


virtual ~GlobalFrictionContact()


virtual int compute(double time)

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

  • time: current time

void display() const

print the data to the screen

int getGlobalFrictionContactDim() const

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


an int (2 or 3)

unsigned int getGlobalSizeOutput() const

get dimension of the problem


an unsigned ing

double getMu(unsigned int i) const

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


the friction coefficient for the ith contact

SP::GlobalFrictionContactProblem globalFrictionContactProblem()


the friction contact problem from Numerics

GlobalFrictionContactProblem *globalFrictionContactProblemPtr()


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

SP::SiconosVector globalVelocities() const

get globalVelocities


pointer on a SiconosVector

SP::OSNSMatrix H() const

get H


pointer on a OSNSMatrix

virtual void initialize(SP::Simulation sim)

initialize the GlobalFrictionContact problem(compute topology …)

  • sim: the simulation, owner of this OSNSPB

virtual void initOSNSMatrix()

initialize the _M and _H matrix

void initVectorsMemory()

Memory allocation or resizing for z,w,q,b, globalVelocities.

SP::MuStorage mu() const

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


pointer on a std::vector<double>

virtual void postCompute()

post-treatment of output from Numerics solver:

set values of the unknowns of Interactions using (velocity,reaction)

virtual bool preCompute(double time)

Construction of the problem.

  • time: current time

void setGlobalVelocities(SP::SiconosVector newPtr)

set globalVelocities to pointer newPtr

  • newPtr: the new vector

void setH(SP::OSNSMatrix H)

set the value of H

  • H: the new matrix

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

solve a friction contact problem


info solver information result

  • problem: the friction contact problem