preCICE v3.1.1
Loading...
Searching...
No Matches
DummyCouplingScheme.cpp
Go to the documentation of this file.
2#include "../Constants.hpp"
5
7
9 int numberIterations,
10 int maxTimeWindows)
11 : _numberIterations(numberIterations),
12 _maxTimeWindows(maxTimeWindows)
13{
14}
15
17 double startTime,
18 int startTimeWindows)
19{
21 _isInitialized = true;
22 _isOngoing = true;
23 _timeWindows = startTimeWindows;
24 _iterations = 1;
25}
26
28{
29 return _timeWindows;
30}
31
33{
34 return _timeWindows;
35}
36
44
50
57
59{
62 // Imagine we compute the convergence measure here
64
65 if (_hasConverged) {
67 _isOngoing = false;
68 }
70 _iterations = 1;
71 } else {
73 }
75 PRECICE_DEBUG("advanced to {}-{}/{} (ongoing {})", _timeWindows, _iterations, _numberIterations, _isOngoing);
76 } else {
77 PRECICE_DEBUG("advanced to {} (ongoing {})", _timeWindows, _isOngoing);
78 }
79}
80
86
88{
91 return true;
92 return false;
93}
94
96 Action action) const
97{
99 PRECICE_DEBUG("return false (explicit)");
100 return false;
101 }
103 if (_iterations == 1) {
104 PRECICE_DEBUG("return true");
105 return true;
106 }
107 }
109 if (_iterations != 1) {
110 PRECICE_DEBUG("return true");
111 return true;
112 }
113 }
114 PRECICE_DEBUG("return false");
115 return false;
116}
117
119{
120 return _hasConverged;
121}
122
123} // namespace precice::cplscheme::tests
#define PRECICE_DEBUG(...)
Definition LogMacros.hpp:64
#define PRECICE_ASSERT(...)
Definition assertion.hpp:87
Action
Actions that are required by CouplingSchemes.
@ WriteCheckpoint
Is the participant required to write a checkpoint?
@ ReadCheckpoint
Is the participant required to read a previously written checkpoint?
bool isActionRequired(Action action) const override final
Not implemented.
bool _hasConverged
False, if iterations are left to be performed.
bool hasConverged() const override
Returns false if the scheme is implicit and hasn't converged.
bool _isOngoing
True, if timesteps are left to be performed.
int _maxTimeWindows
Maximal number of time windows to be performed.
DummyCouplingScheme(int numberIterations, int maxTimeWindows)
Constructor.
int _timeWindows
Performed number of time windows.
double getTime() const override final
Not implemented.
bool isImplicitCouplingScheme() const override
Returns true if the scheme or one subscheme is implicit.
bool isCouplingOngoing() const override final
Not implemented.
ChangedMeshes firstSynchronization(const ChangedMeshes &changes) override
void initialize(double startTime, int startTimeWindows) override final
Destructor, empty.
int _numberIterations
Number of iterations performed per time window. 1 --> explicit.
void finalize() override final
Finalizes the coupling and disconnects communication.
bool _isInitialized
True, if initialize has been called.
int _iterations
Performed iterations in the current time window.
T empty(T... args)