# File kernel/src/simulationTools/GlobalFrictionContact.hpp¶

Go to the source code of this file

Primal Fricton-Contact Non-Smooth Problem

Typedefs

typedef int (*GFC3D_Driver)(GlobalFrictionContactProblem*, double*, double*, double*, SolverOptions*)

Pointer to function of the type used for drivers for GlobalFrictionContact problems in Numerics.

class GlobalFrictionContact : public LinearOSNS
#include <>

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.

With:

• $$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.

Construction:

• 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. Functions: 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 postCompute().

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

Subclassed by GlobalRollingFrictionContact

Public Functions

GlobalFrictionContact(int dimPb, int numericsSolverId = SICONOS_GLOBAL_FRICTION_3D_NSGS)

constructor (solver id and dimension)

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

• numericsSolverId – id of the solver to be used, optional, default : SICONOS_GLOBAL_FRICTION_3D_NSGS

GlobalFrictionContact(int dimPb, SP::SolverOptions options)

constructor from a pre-defined solver options set

Parameters

options – the options set

inline virtual ~GlobalFrictionContact()

destructor

inline int getGlobalFrictionContactDim() const

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

Returns

an int (2 or 3)

inline size_t getGlobalSizeOutput() const

get dimension of the problem

Returns

an unsigned ing

inline SP::SiconosVector globalVelocities() const

get globalVelocities

Returns

pointer on a SiconosVector

inline void setGlobalVelocities(SP::SiconosVector newPtr)

set globalVelocities to pointer newPtr

Parameters

newPtr – the new vector

inline SP::MuStorage mu() const

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

Returns

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

Returns

the friction coefficient for the ith contact

void initVectorsMemory()

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

virtual void initialize(SP::Simulation sim)

initialize the GlobalFrictionContact problem(compute topology …)

Parameters

sim – the simulation, owner of this OSNSPB

SP::GlobalFrictionContactProblem globalFrictionContactProblem()
Returns

the friction contact problem from Numerics

GlobalFrictionContactProblem *globalFrictionContactProblemPtr()
Returns

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

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

solve a friction contact problem

Parameters

problem – the friction contact problem

Returns

info solver information result

virtual bool preCompute(double time)

Construction of the problem.

Parameters

time – current time

virtual int compute(double time)

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

Parameters

time – current time

virtual void postCompute()

post-treatment of output from Numerics solver: set values of the unknowns of Interactions using (velocity,reaction)

virtual bool checkCompatibleNSLaw(NonSmoothLaw &nslaw)
void updateMu()
virtual void display() const

print the data to the screen

Protected Functions

GlobalFrictionContact() = default

default constructor

ACCEPT_SERIALIZATION(GlobalFrictionContact)

Protected Attributes

int _contactProblemDim = 3

Type (dimension) of the contact problem (2D or 3D)

size_t _sizeGlobalOutput = 0

size of the local problem to solve

SP::SiconosVector _globalVelocities

contains the vector globalVelocities of a GlobalFrictionContact system

SP::SiconosVector _b

contains the impact contributions

SP::MuStorage _mu

friction coefficients

GFC3D_Driver _gfc_driver

Pointer to the function used to call the Numerics driver to solve the problem.

GlobalFrictionContactProblem _numerics_problem