File kernel/src/simulationTools/FrictionContact.hpp

Go to the source code of this file

Fricton-Contact Non-Smooth Problem.

Typedefs

typedef int (*Driver)(FrictionContactProblem *, double *, double *, SolverOptions *)

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

class FrictionContact : public LinearOSNS
#include <FrictionContact.hpp>

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.

With:

  • \(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:

Usage:

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

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

Public Functions

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

constructor (solver id and dimension)

Parameters

FrictionContact(int dimPb, SP::SolverOptions options)

constructor from a pre-defined solver options set.

Parameters

virtual ~FrictionContact()

destructor

ACCEPT_STD_VISITORS()

visitors hook

virtual int compute(double time)

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

Return

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

Parameters
  • time: the current time

void display() const

print the data to the screen

SP::FrictionContactProblem frictionContactProblem()

Return

the friction contact problem from Numerics

FrictionContactProblem *frictionContactProblemPtr()

Return

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

int getFrictionContactDim() const

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

Return

an int (2 or 3)

const MuStorage getMu() const

get the vector mu, list of the friction coefficients

Return

a vector of double

double getMu(unsigned int i) const

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

Return

double value of mu

Parameters
  • i: the component number (starting from 0)

virtual void initialize(SP::Simulation simulation)

initialize the FrictionContact problem(compute topology …)

Parameters
  • simulation: the simulation, owner of this OSNSPB

SP::MuStorage mu() const

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

Return

pointer on a std::vector<double>

void setNumericsDriver(Driver newFunction)

set the driver-function used to solve the problem

Parameters
  • newFunction: function of prototype Driver

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

solve a friction contact problem

Return

info solver information result

Parameters
  • problem: the friction contact problem

void updateMu()

update mu vector

Protected Functions

ACCEPT_SERIALIZATION(FrictionContact)

serialization hooks

Protected Attributes

int _contactProblemDim

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

Driver _frictionContact_driver

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

SP::MuStorage _mu

  • friction coefficients

FrictionContactProblem _numerics_problem