preCICE v3.1.2
|
Used to test CompositionalCouplingScheme. More...
#include <DummyCouplingScheme.hpp>
Public Member Functions | |
DummyCouplingScheme (int numberIterations, int maxTimeWindows) | |
Constructor. | |
void | initialize (double startTime, int startTimeWindows) override final |
Destructor, empty. | |
bool | isInitialized () const override final |
Not implemented. | |
bool | sendsInitializedData () const override final |
Not implemented. | |
bool | addComputedTime (double timeToAdd) override final |
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 |
void | finalize () override final |
Finalizes the coupling and disconnects communication. | |
std::vector< std::string > | getCouplingPartners () const override final |
Returns list of all coupling partners. | |
std::string | localParticipant () const override final |
Returns the name of the local participant. | |
bool | willDataBeExchanged (double lastSolverTimeStepSize) const override final |
Not implemented. | |
bool | hasDataBeenReceived () const override final |
Not implemented. | |
double | getTime () const override final |
Not implemented. | |
double | getTimeWindowStart () const override final |
int | getTimeWindows () const override final |
Not implemented. | |
bool | hasTimeWindowSize () const override final |
Returns true, if time window size is prescribed by the cpl scheme. | |
double | getTimeWindowSize () const override final |
Not implemented. | |
double | getNextTimeStepMaxSize () const override final |
Not implemented. | |
bool | isCouplingOngoing () const override final |
Not implemented. | |
bool | isTimeWindowComplete () const override final |
Not implemented. | |
bool | isActionRequired (Action action) const override final |
Not implemented. | |
bool | isActionFulfilled (Action action) const override final |
Returns true, if the given action has already been performed by the accessor. | |
void | markActionFulfilled (Action action) override final |
Not implemented. | |
int | getCheckpointTimestepInterval () const |
Not implemented. | |
void | requireAction (Action action) override final |
Not implemented. | |
std::string | printCouplingState () const override final |
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 override final |
Returns true if any send data of the scheme requires substeps. | |
ImplicitData | implicitDataToReceive () const override final |
Returns a vector of implicit data to receive in the next advance. | |
Public Member Functions inherited from precice::cplscheme::CouplingScheme | |
CouplingScheme & | operator= (CouplingScheme &&)=delete |
virtual | ~CouplingScheme () |
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 | |
Public Types inherited from precice::cplscheme::CouplingScheme | |
enum struct | Action { InitializeData , ReadCheckpoint , WriteCheckpoint } |
Actions that are required by CouplingSchemes. More... | |
using | ChangedMeshes = std::vector<MeshID> |
Static Public Member Functions inherited from precice::cplscheme::CouplingScheme | |
static std::string | toString (Action action) |
Static Public Attributes inherited from precice::cplscheme::CouplingScheme | |
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 16 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 40 of file DummyCouplingScheme.cpp.
|
finaloverridevirtual |
Finalizes the coupling and disconnects communication.
Implements precice::cplscheme::CouplingScheme.
Definition at line 106 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Exchanges the first set of data.
Implements precice::cplscheme::CouplingScheme.
Definition at line 61 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 53 of file DummyCouplingScheme.cpp.
|
inline |
Not implemented.
Definition at line 184 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns list of all coupling partners.
Implements precice::cplscheme::CouplingScheme.
Definition at line 82 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 143 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 27 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 122 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 135 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 32 of file DummyCouplingScheme.cpp.
|
overridevirtual |
Returns false if the scheme is implicit and hasn't converged.
Implements precice::cplscheme::CouplingScheme.
Definition at line 143 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 106 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns true, if time window size is prescribed by the cpl scheme.
Implements precice::cplscheme::CouplingScheme.
Definition at line 127 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns a vector of implicit data to receive in the next advance.
Implements precice::cplscheme::CouplingScheme.
Definition at line 218 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 168 of file DummyCouplingScheme.hpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 120 of file DummyCouplingScheme.cpp.
|
finaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 112 of file DummyCouplingScheme.cpp.
|
inlineoverridevirtual |
Returns true if the scheme or one subscheme is implicit.
Implements precice::cplscheme::CouplingScheme.
Definition at line 206 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 44 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 157 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns the name of the local participant.
Implements precice::cplscheme::CouplingScheme.
Definition at line 88 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 176 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Empty.
Implements precice::cplscheme::CouplingScheme.
Definition at line 201 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 193 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Returns true if any send data of the scheme requires substeps.
Implements precice::cplscheme::CouplingScheme.
Definition at line 213 of file DummyCouplingScheme.hpp.
|
finalvirtual |
Exchanges the second set of data.
This concludes the step of the coupling scheme
Implements precice::cplscheme::CouplingScheme.
Definition at line 74 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 67 of file DummyCouplingScheme.cpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 53 of file DummyCouplingScheme.hpp.
|
inlinefinaloverridevirtual |
Not implemented.
Implements precice::cplscheme::CouplingScheme.
Definition at line 97 of file DummyCouplingScheme.hpp.
|
private |
False, if iterations are left to be performed.
Definition at line 245 of file DummyCouplingScheme.hpp.
|
private |
True, if initialize has been called.
Definition at line 239 of file DummyCouplingScheme.hpp.
|
private |
True, if timesteps are left to be performed.
Definition at line 242 of file DummyCouplingScheme.hpp.
|
private |
Performed iterations in the current time window.
Definition at line 230 of file DummyCouplingScheme.hpp.
|
mutableprivate |
Definition at line 224 of file DummyCouplingScheme.hpp.
|
private |
Maximal number of time windows to be performed.
Definition at line 233 of file DummyCouplingScheme.hpp.
|
private |
Number of iterations performed per time window. 1 --> explicit.
Definition at line 227 of file DummyCouplingScheme.hpp.
|
private |
Performed number of time windows.
Definition at line 236 of file DummyCouplingScheme.hpp.