Program listing for file kernel/src/simulationTools/MoreauJeanBilbaoOSI.hpp#
Return to documentation for this file
1#ifndef MoreauJeanBilbaoOSI_H
2#define MoreauJeanBilbaoOSI_H
3
4#include "OneStepIntegrator.hpp"
5
6#include <limits>
7
8
9class MoreauJeanBilbaoOSI : public OneStepIntegrator {
10protected:
11
12 ACCEPT_SERIALIZATION(MoreauJeanBilbaoOSI);
13
14
15 struct _NSLEffectOnFreeOutput;
16
17 friend struct _NSLEffectOnFreeOutput;
18
19public:
20 enum MoreauJeanBilbaoOSI_ds_workVector_id {
21 TWO_DT_SIGMA_STAR,
22 ONE_MINUS_THETA,
23 VFREE,
24 WORK_LENGTH
25 };
26
27 enum MoreauJeanBilbaoOSI_interaction_workVector_id {
28 OSNSP_RHS,
29 WORK_INTERACTION_LENGTH
30 };
31
32 enum MoreauJeanBilbaoOSI_interaction_workBlockVector_id {
33 xfree,
34 BLOCK_WORK_LENGTH
35 };
36
37
38 MoreauJeanBilbaoOSI();
39
40
41 virtual ~MoreauJeanBilbaoOSI(){};
42
43
44 void initializeWorkVectorsForDS(double t, SP::DynamicalSystem ds) override;
45
46
47 void initializeWorkVectorsForInteraction(Interaction &inter,
48 InteractionProperties &interProp,
49 DynamicalSystemsGraph &DSG) override;
50
51 void _initialize_iteration_matrix(SP::DynamicalSystem ds);
52
53
54 void initialize_nonsmooth_problems() override;
55
56
57 unsigned int numberOfIndexSets() const override { return 2; };
58
59 void compute_parameters(double time_step, double omega, double sigma,
60 double &theta, double &sigma_star);
61
62
63 inline SP::SimpleMatrix iteration_matrix(SP::DynamicalSystem ds)
64 {
65 return _dynamicalSystemsGraph
66 ->properties(_dynamicalSystemsGraph->descriptor(ds))
67 .W;
68 }
69
70
71 void integrate(double &tinit, double &tend, double &tout, int &idid) override;
72
73
74 double computeResidu() override;
75
76
77 void computeFreeState() override;
78
79
80 void computeFreeOutput(InteractionsGraph::VDescriptor &vertex_inter,
81 OneStepNSProblem *osnsp) override;
82
83
84 SiconosVector& osnsp_rhs(InteractionsGraph::VDescriptor& vertex_inter, InteractionsGraph& indexSet) override
85 {
86 return *(*indexSet.properties(vertex_inter).workVectors)[MoreauJeanBilbaoOSI::OSNSP_RHS];
87 };
88
89
90 void updatePosition(DynamicalSystem &ds);
91
92
93 void updateState(const unsigned int level) override;
94
95
96 void display() override;
97
98 void prepareNewtonIteration(double time) override;
99
100
101 bool addInteractionInIndexSet(SP::Interaction inter, unsigned int i) override;
102
103
104 bool removeInteractionFromIndexSet(SP::Interaction inter,
105 unsigned int i) override;
106
107 ACCEPT_STD_VISITORS();
108};
109
110#endif