Program listing for file kernel/src/simulationTools/FrictionContact.hpp#
Return to documentation for this file
1#ifndef FrictionContact_H
2#define FrictionContact_H
3
4#include "LinearOSNS.hpp"
5
6#include <FrictionContactProblem.h>
7#include <Friction_cst.h>
8
9typedef int (*Driver)(FrictionContactProblem *, double *, double *,
10 SolverOptions *);
11TYPEDEF_SPTR(FrictionContactProblem)
12
13
14class FrictionContact : public LinearOSNS {
15protected:
16
17 ACCEPT_SERIALIZATION(FrictionContact);
18
19
20 int _contactProblemDim;
21
22
23 SP::MuStorage _mu;
24
25
26 Driver _frictionContact_driver;
27
28 FrictionContactProblem _numerics_problem;
29
30public:
31
32 FrictionContact(int dimPb = 3,
33 int numericsSolverId = SICONOS_FRICTION_3D_NSGS);
34
35
36 FrictionContact(int dimPb, SP::SolverOptions options);
37
38
39 virtual ~FrictionContact(){};
40
41
42
43
44 inline int getFrictionContactDim() const { return _contactProblemDim; }
45
46
47
48 inline const MuStorage getMu() const { return *_mu; }
49
50
51
52 inline SP::MuStorage mu() const { return _mu; }
53
54
55 inline double getMu(unsigned int i) const { return (*_mu)[i]; }
56
57
58 void updateMu();
59
60
61 inline void setNumericsDriver(Driver newFunction)
62 {
63 _frictionContact_driver = newFunction;
64 };
65
66
67
68
69 void initialize(SP::Simulation simulation) override;
70
71
72 SP::FrictionContactProblem frictionContactProblem();
73
74
75 FrictionContactProblem *frictionContactProblemPtr();
76
77
78 int solve(SP::FrictionContactProblem problem = SP::FrictionContactProblem());
79
80
81 int compute(double time) override;
82
83
84 void display() const override;
85
86
87 bool checkCompatibleNSLaw(NonSmoothLaw &nslaw) override;
88
89 ACCEPT_STD_VISITORS();
90};
91
92#endif