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

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

 1#ifndef TIMESTEPPINGDIRECTPROJECTION_H
 2#define TIMESTEPPINGDIRECTPROJECTION_H
 3
 4#include "TimeStepping.hpp"
 5
 6
 7class TimeSteppingDirectProjection : public TimeStepping {
 8protected:
 9  ACCEPT_SERIALIZATION(TimeSteppingDirectProjection);
10
11
12  unsigned int _indexSetLevelForProjection;
13
14
15  unsigned int _nbProjectionIteration;
16
17
18  double _constraintTol;
19
20
21  double _constraintTolUnilateral;
22
23
24  double _maxViolationUnilateral;
25
26
27  double _maxViolationEquality;
28
29
30  unsigned int _projectionMaxIteration;
31
32
33  unsigned int _doProj;
34  unsigned int _doOnlyProj;
35
36public:
37
38  TimeSteppingDirectProjection(SP::NonSmoothDynamicalSystem nsds,
39                               SP::TimeDiscretisation td,
40                               SP::OneStepIntegrator osi,
41                               SP::OneStepNSProblem osnspb_velo,
42                               SP::OneStepNSProblem osnspb_pos,
43                               unsigned int _level = 1);
44
45  void initializeOneStepNSProblem() override;
46
47
48  TimeSteppingDirectProjection(){};
49
50  virtual ~TimeSteppingDirectProjection() noexcept = default;
51
52  void updateWorldFromDS() override {}
53
54
55  inline unsigned int nbProjectionIteration() { return _nbProjectionIteration; }
56
57  inline void setConstraintTol(double v) { _constraintTol = v; }
58
59  inline void setConstraintTolUnilateral(double v)
60  {
61    _constraintTolUnilateral = v;
62  }
63
64  inline double maxViolationUnilateral() { return _maxViolationUnilateral; }
65
66  inline double maxViolationEquality() { return _maxViolationEquality; }
67
68  inline void setProjectionMaxIteration(unsigned int v)
69  {
70    _projectionMaxIteration = v;
71  }
72
73  inline void setDoProj(unsigned int v) { _doProj = v; }
74  inline void setDoOnlyProj(unsigned int v) { _doOnlyProj = v; }
75
76  void advanceToEvent() override;
77
78  void nextStep() override;
79
80  void computeCriteria(bool *runningProjection);
81
82  void newtonSolve(double criterion, unsigned int maxStep) override;
83
84  ACCEPT_STD_VISITORS();
85};
86
87DEFINE_SPTR(TimeSteppingDirectProjection)
88
89#endif