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.

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)

Parameters:
  • 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

Parameters:

options – the options set

inline virtual ~FrictionContact()

destructor

inline int getFrictionContactDim() const

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

Returns:

an int (2 or 3)

inline const MuStorage getMu() const

get the vector mu, list of the friction coefficients

Returns:

a vector of double

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

Parameters:

i – the component number (starting from 0)

Returns:

double value of mu

void updateMu()

update mu vector

inline void setNumericsDriver(Driver newFunction)

set the driver-function used to solve the problem

Parameters:

newFunction – function of prototype Driver

virtual void initialize(SP::Simulation simulation) override

initialize the FrictionContact problem(compute topology …)

Parameters:

simulation – the simulation, owner of this OSNSPB

SP::FrictionContactProblem frictionContactProblem()
Returns:

the friction contact problem from Numerics

FrictionContactProblem *frictionContactProblemPtr()
Returns:

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

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

solve a friction contact problem

Parameters:

problem – the friction contact problem

Returns:

info solver information result

virtual int compute(double time) override

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

Parameters:

time – the current time

Returns:

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

virtual void display() const override

print the data to the screen

virtual bool checkCompatibleNSLaw(NonSmoothLaw &nslaw) override#
ACCEPT_STD_VISITORS()#

Protected Functions

ACCEPT_SERIALIZATION(FrictionContact)#

Protected Attributes

int _contactProblemDim#

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

SP::MuStorage _mu#

  • friction coefficients

Driver _frictionContact_driver#

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

FrictionContactProblem _numerics_problem#