preCICE v3.2.0
|
Used to test CompositionalCouplingScheme. More...
#include <DummyCouplingScheme.hpp>
Public Member Functions | |
DummyCouplingScheme (int numberIterations, int maxTimeWindows) | |
Constructor. | |
void | initialize () final override |
Destructor, empty. | |
void | reinitialize () final override |
Reinitializes the coupling scheme, coupling data, and acceleration schemes. | |
bool | isInitialized () const final override |
Not implemented. | |
bool | sendsInitializedData () const final override |
Not implemented. | |
bool | addComputedTime (double timeToAdd) final override |
Always assumes we reached the end of a time window. | |
ChangedMeshes | firstSynchronization (const ChangedMeshes &changes) override |
void | firstExchange () override |
ChangedMeshes | secondSynchronization () override |
void | secondExchange () final override |
void | finalize () final override |
Finalizes the coupling and disconnects communication. | |
std::vector< std::string > | getCouplingPartners () const final override |
Returns list of all coupling partners. | |
std::string | localParticipant () const final override |
Returns the name of the local participant. | |
bool | willDataBeExchanged (double lastSolverTimeStepSize) const final override |
Not implemented. | |
bool | hasDataBeenReceived () const final override |
Not implemented. | |
double | getTime () const final override |
Not implemented. | |
double | getTimeWindowStart () const final override |
int | getTimeWindows () const final override |
Not implemented. | |
bool | hasTimeWindowSize () const final override |
Returns true, if time window size is prescribed by the cpl scheme. | |
double | getTimeWindowSize () const final override |
Not implemented. | |
double | getNextTimeStepMaxSize () const final override |
Not implemented. | |
bool | isCouplingOngoing () const final override |
Not implemented. | |
bool | isTimeWindowComplete () const final override |
Not implemented. | |
bool | isActionRequired (Action action) const final override |
Not implemented. | |
bool | isActionFulfilled (Action action) const final override |
Returns true, if the given action has already been performed by the accessor. | |
void | markActionFulfilled (Action action) final override |
Not implemented. | |
int | getCheckpointTimestepInterval () const |
Not implemented. | |
void | requireAction (Action action) final override |
Not implemented. | |
std::string | printCouplingState () const final override |
Empty. | |
bool | isImplicitCouplingScheme () const override |
Returns true if the scheme or one subscheme is implicit. | |
bool | hasConverged () const override |
Returns false if the scheme is implicit and hasn't converged. | |
bool | requiresSubsteps () const final override |
Returns true if any send data of the scheme requires substeps. | |
ImplicitData | implicitDataToReceive () const final override |
Returns a vector of implicit data to receive in the next advance. | |
![]() | |
CouplingScheme & | operator= (CouplingScheme &&)=delete |
virtual | ~CouplingScheme ()=default |
Private Attributes | |
logging::Logger | _log {"cplscheme::tests::DummyCouplingScheme"} |
int | _numberIterations |
Number of iterations performed per time window. 1 --> explicit. | |
int | _iterations = 0 |
Performed iterations in the current time window. | |
int | _maxTimeWindows |
Maximal number of time windows to be performed. | |
int | _timeWindows = 0 |
Performed number of time windows. | |
bool | _isInitialized = false |
True, if initialize has been called. | |
bool | _isOngoing = false |
True, if timesteps are left to be performed. | |
bool | _hasConverged = false |
False, if iterations are left to be performed. | |
Additional Inherited Members | |
![]() | |
enum struct | Action { InitializeData , ReadCheckpoint , WriteCheckpoint } |
Actions that are required by CouplingSchemes. More... | |
using | ChangedMeshes = std::vector<MeshID> |
![]() | |
static std::string | toString (Action action) |
![]() | |
static const double | UNDEFINED_MAX_TIME = -1.0 |
Does not define a time limit for the coupled simulation. | |
static const int | UNDEFINED_TIME_WINDOWS = -1 |
Does not define limit on time windows for the coupled simulation. | |
static const double | UNDEFINED_TIME_WINDOW_SIZE = -1.0 |
To be used, when the time window size is determined dynamically during the coupling. | |
static const int | UNDEFINED_MAX_ITERATIONS = -1 |
To be used, when the number of max iterations is not defined (for explicit coupling). | |
static const int | UNDEFINED_MIN_ITERATIONS = -1 |
To be used, when the number of min iterations is not defined (for explicit coupling). | |
static const int | INFINITE_MAX_ITERATIONS = -2 |
To be used, when the number of max iterations is infinite (for implicit coupling). | |
Used to test CompositionalCouplingScheme.
Definition at line 14 of file DummyCouplingScheme.hpp.
precice::cplscheme::tests::DummyCouplingScheme::DummyCouplingScheme | ( | int | numberIterations, |
int | maxTimeWindows ) |
Constructor.
[in] | numberIterations | If 1, models an explicit coupling scheme, otherwise an implicit one. |
[in] | maxTimeWindows | Number of time windows this DummyCouplingScheme has to perform. |
Definition at line 8 of file DummyCouplingScheme.cpp.
|
finaloverridevirtual |
Always assumes we reached the end of a time window.
Implements precice::cplscheme::CouplingScheme.
Definition at line 38 of file DummyCouplingScheme.cpp.
|
finaloverridevirtual |
Finalizes the coupling and disconnects communication.
Implements precice::cplscheme::CouplingScheme.
Definition at line 104 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Exchanges the first set of data.
Implements precice::cplscheme::CouplingScheme.
Definition at line 59 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Synchronizes mesh changes with remote participants.
At this point, both participants may have changed the meshes. Thus, we need to send local changes and receive remote changes.
[in] | changes | MeshIDs of locally changed meshes |
Implements precice::cplscheme::CouplingScheme.
Definition at line 51 of file DummyCouplingScheme.cpp.
|
inline |
Not implemented.
Definition at line 182 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns list of all coupling partners.
Implements precice::cplscheme::CouplingScheme.
Definition at line 80 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 141 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 25 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 120 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 133 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Returns the time window start time of the current time window For compositional schemes, this returns the earliest start of an active time window
Implements precice::cplscheme::CouplingScheme.
Definition at line 30 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Returns false if the scheme is implicit and hasn't converged.
Implements precice::cplscheme::CouplingScheme.
Definition at line 141 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 104 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns true, if time window size is prescribed by the cpl scheme.
Implements precice::cplscheme::CouplingScheme.
Definition at line 125 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns a vector of implicit data to receive in the next advance.
Implements precice::cplscheme::CouplingScheme.
Definition at line 216 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Destructor, empty.
Implements precice::cplscheme::CouplingScheme.
Definition at line 16 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Returns true, if the given action has already been performed by the accessor.
Implements precice::cplscheme::CouplingScheme.
Definition at line 166 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 118 of file DummyCouplingScheme.cpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 110 of file DummyCouplingScheme.cpp.
|
inlineoverridevirtual |
Returns true if the scheme or one subscheme is implicit.
Implements precice::cplscheme::CouplingScheme.
Definition at line 204 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 42 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 155 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns the name of the local participant.
Implements precice::cplscheme::CouplingScheme.
Definition at line 86 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 174 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Empty.
Implements precice::cplscheme::CouplingScheme.
Definition at line 199 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Reinitializes the coupling scheme, coupling data, and acceleration schemes.
Implements precice::cplscheme::CouplingScheme.
Definition at line 37 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 191 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns true if any send data of the scheme requires substeps.
Implements precice::cplscheme::CouplingScheme.
Definition at line 211 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Exchanges the second set of data.
This concludes the step of the coupling scheme
Implements precice::cplscheme::CouplingScheme.
Definition at line 72 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Receive mesh changes from remote participants in the second step.
At this point, the remote participant may have changed the meshes if it is using a serial coupling scheme. In contrast, the local participant has already communicated local changes to the remote participant during firstSynchronization(). Hence we only need to receive remote changes here.
Implements precice::cplscheme::CouplingScheme.
Definition at line 65 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 51 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 95 of file DummyCouplingScheme.hpp.
|
private |
False, if iterations are left to be performed.
Definition at line 243 of file DummyCouplingScheme.hpp.
|
private |
True, if initialize has been called.
Definition at line 237 of file DummyCouplingScheme.hpp.
|
private |
True, if timesteps are left to be performed.
Definition at line 240 of file DummyCouplingScheme.hpp.
|
private |
Performed iterations in the current time window.
Definition at line 228 of file DummyCouplingScheme.hpp.
|
mutableprivate |
Definition at line 222 of file DummyCouplingScheme.hpp.
|
private |
Maximal number of time windows to be performed.
Definition at line 231 of file DummyCouplingScheme.hpp.
|
private |
Number of iterations performed per time window. 1 --> explicit.
Definition at line 225 of file DummyCouplingScheme.hpp.
|
private |
Performed number of time windows.
Definition at line 234 of file DummyCouplingScheme.hpp.