Program listing for file kernel/src/simulationTools/Relay.hpp

Program listing for file kernel/src/simulationTools/Relay.hpp#

 1#ifndef Relay_H
 2#define Relay_H
 3
 4#include "LinearOSNS.hpp"
 5
 6#include <relay_cst.h>
 7#include <RelayProblem.h>
 8TYPEDEF_SPTR(RelayProblem)
 9
10
11class Relay : public LinearOSNS
12{
13
14protected:
15
16  ACCEPT_SERIALIZATION(Relay);
17
18
19
20  SP::SiconosVector _lb;
21
22
23  SP::SiconosVector _ub;
24
25
26  SP::RelayProblem _numerics_problem;
27
28
29
30  struct _BoundsNSLEffect;
31  friend struct _BoundsNSLEffect;
32
33
34
35public:
36
37
38  Relay(int numericsSolverId = SICONOS_RELAY_AVI_CAOFERRIS);
39
40
41  Relay(SP::SolverOptions options);
42
43
44  ~Relay(){};
45
46
47
48  inline const SiconosVector& getLb() const
49  {
50    return *_lb;
51  }
52
53
54  inline SP::SiconosVector lb() const
55  {
56    return _lb;
57  }
58
59
60  inline void setLb(SP::SiconosVector newLb)
61  {
62    _lb = newLb;
63  }
64
65
66
67
68  inline const SiconosVector& getUb() const
69  {
70    return *_ub;
71  }
72
73
74  inline SP::SiconosVector ub() const
75  {
76    return _ub;
77  }
78
79
80  inline void setUb(SP::SiconosVector newUb)
81  {
82    _ub = newUb;
83  }
84
85  void initialize(SP::Simulation sim);
86
87
88  int compute(double time);
89
90
91  bool checkCompatibleNSLaw(NonSmoothLaw& nslaw);
92
93
94
95  void display() const;
96
97};
98
99#endif