Program listing for file kernel/src/modelingTools/Relation.hpp#
Return to documentation for this file
1#ifndef RELATION_H
2#define RELATION_H
3#include "RelationNamespace.hpp"
4#include "SiconosAlgebraTypeDef.hpp"
5#include "SiconosFwd.hpp"
6#include "SiconosSerialization.hpp"
7#include "SiconosVisitor.hpp"
8
9
10class Relation {
11
12protected:
13
14 ACCEPT_SERIALIZATION(Relation);
15
16
17 SP::PluggedObject _pluginh{nullptr};
18
19
20 SP::PluggedObject _pluginJachx{nullptr};
21
22 SP::PluggedObject _pluginJachz{nullptr};
23
24 SP::PluggedObject _pluginJachlambda{nullptr};
25
26
27 SP::PluggedObject _pluging{nullptr};
28
29
30 SP::PluggedObject _pluginJacglambda{nullptr};
31
32
33 SP::PluggedObject _pluginJacgx{nullptr};
34
35
36 SP::PluggedObject _pluginf{nullptr};
37
38
39 SP::PluggedObject _plugine{nullptr};
40
41
42 virtual void _zeroPlugin();
43
44
45 RELATION::TYPES _relationType;
46
47
48 RELATION::SUBTYPES _subType;
49
50
51 Relation(RELATION::TYPES type, RELATION::SUBTYPES subtype);
52
53private:
54
55 Relation(const Relation &) = delete;
56 Relation &operator=(const Relation &) = delete;
57 Relation &operator=(const Relation &&) = delete;
58
59protected:
60 Relation() = default;
61
62public:
63
64 virtual ~Relation() noexcept = default;
65
66
67 inline RELATION::TYPES getType() const { return _relationType; }
68
69
70 inline RELATION::SUBTYPES getSubType() const { return _subType; }
71
72
73 void setComputehFunction(const std::string &pluginPath,
74 const std::string &functionName);
75
76
77 void setComputeJachxFunction(const std::string &pluginPath,
78 const std::string &functionName);
79
80
81 void setComputeJachzFunction(const std::string &pluginPath,
82 const std::string &functionName);
83
84
85 void setComputeJachlambdaFunction(const std::string &pluginPath,
86 const std::string &functionName);
87
88
89 void setComputegFunction(const std::string &pluginPath,
90 const std::string &functionName);
91
92 void setComputeFFunction(const std::string &pluginPath,
93 const std::string &functionName);
94
95
96 void setComputeEFunction(const std::string &pluginPath,
97 const std::string &functionName);
98
99
100 void setComputeJacgxFunction(const std::string &pluginPath,
101 const std::string &functionName);
102
103
104 void setComputeJacglambdaFunction(const std::string &pluginPath,
105 const std::string &functionName);
106
107
108 virtual void initialize(Interaction &inter) = 0;
109
110
111 virtual void checkSize(Interaction &inter) = 0;
112
113
114 virtual void computeJach(double time, Interaction &inter) = 0;
115
116
117 virtual void computeJacg(double time, Interaction &inter) = 0;
118
119
120 virtual void computeOutput(double time, Interaction &inter,
121 unsigned int derivativeNumber = 0) = 0;
122
123 virtual void computeInput(double time, Interaction &inter,
124 unsigned int level = 0) = 0;
125
126 virtual SP::SimpleMatrix C() const = 0;
127
128 virtual SP::SimpleMatrix H() const = 0;
129
130
131 virtual bool isLinear() { return false; }
132
133
134 virtual bool requireResidu() { return false; }
135
136
137 virtual void display() const;
138
139
140 inline SP::PluggedObject getPluginh() const { return _pluginh; };
141
142
143 inline SP::PluggedObject getPluginJachx() const { return _pluginJachx; };
144
145
146 inline SP::PluggedObject getPluginJachlambda() const {
147 return _pluginJachlambda;
148 };
149
150
151 inline SP::PluggedObject getPluging() const { return _pluging; };
152
153
154 inline SP::PluggedObject getPluginJacLg() const { return _pluginJacglambda; };
155
156
157 inline SP::PluggedObject getPluginf() const { return _pluginf; };
158
159
160 inline SP::PluggedObject getPlugine() const { return _plugine; };
161
162 VIRTUAL_ACCEPT_VISITORS(Relation);
163};
164
165#endif