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