preCICE v3.2.0
|
Abstract base class for standard coupling schemes. More...
#include <BaseCouplingScheme.hpp>
Classes | |
struct | ConvergenceMeasureContext |
Holds meta information to perform a convergence measurement. More... | |
Public Types | |
enum | CouplingMode { Explicit , Implicit , Undefined } |
![]() | |
enum struct | Action { InitializeData , ReadCheckpoint , WriteCheckpoint } |
Actions that are required by CouplingSchemes. More... | |
using | ChangedMeshes = std::vector<MeshID> |
Public Member Functions | |
BaseCouplingScheme (double maxTime, int maxTimeWindows, double timeWindowSize, std::string localParticipant, int minIterations, int maxIterations, CouplingMode cplMode, constants::TimesteppingMethod dtMethod) | |
bool | sendsInitializedData () const final override |
Getter for _sendsInitializedData. | |
bool | isInitialized () const final override |
getter for _isInitialized | |
bool | addComputedTime (double timeToAdd) final override |
Adds newly computed time. Has to be called before every advance. | |
bool | willDataBeExchanged (double lastSolverTimeStepSize) const final override |
Returns true, if data will be exchanged when calling advance(). | |
bool | hasDataBeenReceived () const final override |
getter for _hasDataBeenReceived | |
double | getTime () const final override |
getter for _time | |
double | getTimeWindowStart () const final override |
int | getTimeWindows () const final override |
getter for _timeWindows | |
bool | hasTimeWindowSize () const final override |
Function to check whether time window size is defined by coupling scheme. | |
double | getTimeWindowSize () const final override |
Returns the time window size, if one is given by the coupling scheme. | |
double | getNextTimeStepMaxSize () const final override |
Returns the maximal size of the next time step to be computed. | |
bool | isCouplingOngoing () const final override |
Returns true, when the coupled simulation is still ongoing. | |
bool | isTimeWindowComplete () const final override |
Returns true, when the accessor can advance to the next time window. | |
bool | isActionRequired (Action action) const final override |
Returns true, if the given action has to be performed by the accessor. | |
bool | isActionFulfilled (Action action) const final override |
Returns true, if the given action has to be performed by the accessor. | |
void | markActionFulfilled (Action action) final override |
Tells the coupling scheme that the accessor has performed the given action. | |
void | requireAction (Action action) final override |
Sets an action required to be performed by the accessor. | |
std::string | printCouplingState () const override |
Returns coupling state information. | |
void | finalize () final override |
Finalizes the coupling scheme. | |
void | initialize () final override |
Initializes the coupling scheme and establishes a communication connection to the coupling partner. Initializes coupling data. | |
void | reinitialize () final override |
Reinitializes the coupling scheme, coupling data, and acceleration schemes. | |
ChangedMeshes | firstSynchronization (const ChangedMeshes &changes) final override |
void | firstExchange () final override |
ChangedMeshes | secondSynchronization () final override |
void | secondExchange () final override |
void | addConvergenceMeasure (int dataID, bool suffices, bool strict, impl::PtrConvergenceMeasure measure) |
Adds a measure to determine the convergence of coupling iterations. | |
void | setAcceleration (const acceleration::PtrAcceleration &acceleration) |
Set an acceleration technique. | |
bool | doesFirstStep () const |
Getter for _doesFirstStep. | |
virtual bool | hasAnySendData ()=0 |
virtual void | determineInitialDataExchange ()=0 |
Determines which data is initialized and therefore has to be exchanged during initialize. | |
bool | isImplicitCouplingScheme () const override |
Function to determine whether coupling scheme is an implicit coupling scheme. | |
bool | hasConverged () const override |
Checks if the implicit cplscheme has converged. | |
![]() | |
CouplingScheme & | operator= (CouplingScheme &&)=delete |
virtual | ~CouplingScheme ()=default |
virtual std::vector< std::string > | getCouplingPartners () const =0 |
Returns list of all coupling partners. | |
Protected Member Functions | |
void | sendTimes (const m2n::PtrM2N &m2n, precice::span< double const > times) |
void | sendData (const m2n::PtrM2N &m2n, const DataMap &sendData) |
Sends data sendDataIDs given in mapCouplingData with communication. | |
std::vector< double > | receiveTimes (const m2n::PtrM2N &m2n) |
void | receiveData (const m2n::PtrM2N &m2n, const DataMap &receiveData) |
Receives data receiveDataIDs given in mapCouplingData with communication. | |
void | receiveDataForWindowEnd (const m2n::PtrM2N &m2n, const DataMap &receiveData) |
Like receiveData, but temporarily sets window time to end of window. | |
void | initializeWithZeroInitialData (const DataMap &receiveData) |
Initializes storage in receiveData as zero. | |
PtrCouplingData | addCouplingData (const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, CouplingData::Direction direction) |
Adds CouplingData with given properties to this BaseCouplingScheme and returns a pointer to the CouplingData. | |
bool | isExplicitCouplingScheme () const |
Function to determine whether coupling scheme is an explicit coupling scheme. | |
void | setTimeWindowSize (double timeWindowSize) |
Setter for _timeWindowSize. | |
double | getNextTimeWindowSize () const |
Getter for _nextTimeWindowSize. | |
void | setNextTimeWindowSize (double timeWindowSize) |
Setter for _nextTimeWindowSize. | |
void | setDoesFirstStep (bool doesFirstStep) |
Setter for _doesFirstStep. | |
void | notifyDataHasBeenReceived () |
Used to set flag after data has been received using receiveData(). | |
bool | receivesInitializedData () const |
Getter for _receivesInitializedData. | |
void | setTimeWindows (int timeWindows) |
Setter for _timeWindows. | |
void | sendConvergence (const m2n::PtrM2N &m2n) |
sends convergence to other participant via m2n | |
void | receiveConvergence (const m2n::PtrM2N &m2n) |
receives convergence from other participant via m2n | |
void | doImplicitStep () |
perform a coupling iteration | |
void | moveToNextWindow () |
finalizes this window's data and initializes data for next window. | |
void | storeIteration () |
used for storing all Data at end of doImplicitStep for later reference. | |
void | determineInitialSend (DataMap &sendData) |
Sets _sendsInitializedData, if sendData requires initialization. | |
void | determineInitialReceive (DataMap &receiveData) |
Sets _receivesInitializedData, if receiveData requires initialization. | |
bool | reachedEndOfTimeWindow () const |
Function to check whether end of time window is reached. Does not check for convergence. | |
bool | requiresSubsteps () const final override |
Returns true if any send data of the scheme requires substeps. | |
ImplicitData | implicitDataToReceive () const override |
Returns a vector of implicit data to receive in the next advance. | |
std::string | localParticipant () const final override |
Returns the name of the local participant. | |
double | getWindowEndTime () const |
double | getWindowStartTime () const |
Protected Attributes | |
DataMap | _allData |
All send and receive data as a map "data ID -> data". | |
acceleration::PtrAcceleration | _acceleration |
Acceleration method to speedup iteration convergence. | |
Private Member Functions | |
virtual void | initializeReceiveDataStorage ()=0 |
Functions needed for initialize() | |
virtual void | exchangeInitialData ()=0 |
implements functionality for initialize in base class. | |
virtual void | exchangeFirstData ()=0 |
Functions needed for advance() | |
virtual void | exchangeSecondData ()=0 |
Exchanges the second set of data. | |
virtual DataMap & | getAccelerationData ()=0 |
interface to provide accelerated data, depending on coupling scheme being used | |
void | checkCompletenessRequiredActions () |
If any required actions are open, an error message is issued. | |
void | checkCouplingDataAvailable () |
Issues an error if coupling data does not contain stamples. | |
void | initializeTXTWriters () |
Initialize txt writers for iterations and convergence tracking. | |
void | advanceTXTWriters () |
Advance txt writers for iterations and convergence tracking. | |
std::string | printBasicState (int timeWindows, double time) const |
Prints the coupling state. | |
std::string | printActionsState () const |
Prints the action state. | |
bool | measureConvergence () |
Measure whether coupling scheme has converged or not. | |
void | newConvergenceMeasurements () |
Reset all convergence measurements after convergence. | |
bool | anyDataRequiresInitialization (DataMap &dataMap) const |
Checks whether any CouplingData in dataMap requires initialization. | |
Private Attributes | |
CouplingMode | _couplingMode = Undefined |
Coupling mode used by coupling scheme. | |
logging::Logger | _log {"cplscheme::BaseCouplingScheme"} |
double | _maxTime |
Maximum time being computed. End of simulation is reached, if getTime() == _maxTime. | |
int | _maxTimeWindows |
Number of time windows that have to be computed. End of simulation is reached, if _timeWindows == _maxTimeWindows. | |
int | _timeWindows = 0 |
number of completed time windows; _timeWindows <= _maxTimeWindows | |
double | _timeWindowSize = UNDEFINED_TIME_WINDOW_SIZE |
size of time window; _timeWindowSize <= _maxTime | |
double | _nextTimeWindowSize = UNDEFINED_TIME_WINDOW_SIZE |
time window size of next window (acts as buffer for time windows size provided by first participant, if using first participant method) | |
impl::TimeHandler | _time |
Time handler. | |
int | _minIterations = -1 |
Lower limit of iterations during one time window. Prevents convergence if _iterations < _minIterations. | |
int | _maxIterations = -1 |
Limit of iterations during one time window. Continue to next time window, if _iterations == _maxIterations. | |
int | _iterations = -1 |
Number of iterations in current time window. _iterations <= _maxIterations. | |
int | _totalIterations = -1 |
Number of total iterations performed. | |
bool | _doesFirstStep = false |
True, if local participant is the one starting the explicit scheme. | |
bool | _isTimeWindowComplete = false |
True, if _time == _timeWindowStartTime + _timeWindowSize and (coupling has converged or _iterations == _maxIterations) | |
bool | _sendsInitializedData = false |
True, if this participant has to send initialized data. | |
bool | _receivesInitializedData = false |
True, if this participant has to receive initialized data. | |
bool | _hasDataBeenReceived = false |
True, if data has been received from other participant. Flag is used to make sure that coupling scheme is implemented and used correctly. | |
bool | _isInitialized = false |
True, if coupling has been initialized. | |
std::set< Action > | _requiredActions |
std::set< Action > | _fulfilledActions |
bool | _hasConverged = false |
True if implicit scheme converged. | |
std::shared_ptr< io::TXTTableWriter > | _iterationsWriter |
Responsible for monitoring iteration count over time window. | |
std::shared_ptr< io::TXTTableWriter > | _convergenceWriter |
Writes out coupling convergence within all time windows. | |
std::string | _localParticipant = "unknown" |
Local participant name. | |
std::vector< ConvergenceMeasureContext > | _convergenceMeasures |
All convergence measures of coupling iterations. | |
Additional Inherited Members | |
![]() | |
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). | |
Abstract base class for standard coupling schemes.
! General description A coupling scheme computes the actions to be done by the coupled participants (solvers) in time. It provides interface functions to setup, advance and shutdown the coupling scheme and interface functions to query the state of the coupling scheme and required actions of the participants.
! Usage
Definition at line 61 of file BaseCouplingScheme.hpp.
Enumerator | |
---|---|
Explicit | |
Implicit | |
Undefined |
Definition at line 63 of file BaseCouplingScheme.hpp.
precice::cplscheme::BaseCouplingScheme::BaseCouplingScheme | ( | double | maxTime, |
int | maxTimeWindows, | ||
double | timeWindowSize, | ||
std::string | localParticipant, | ||
int | minIterations, | ||
int | maxIterations, | ||
CouplingMode | cplMode, | ||
constants::TimesteppingMethod | dtMethod ) |
|
finaloverridevirtual |
Adds newly computed time. Has to be called before every advance.
timeToAdd | time to be added |
Implements precice::cplscheme::CouplingScheme.
Definition at line 454 of file BaseCouplingScheme.cpp.
void precice::cplscheme::BaseCouplingScheme::addConvergenceMeasure | ( | int | dataID, |
bool | suffices, | ||
bool | strict, | ||
impl::PtrConvergenceMeasure | measure ) |
Adds a measure to determine the convergence of coupling iterations.
Definition at line 694 of file BaseCouplingScheme.cpp.
|
protected |
Adds CouplingData with given properties to this BaseCouplingScheme and returns a pointer to the CouplingData.
If CouplingData with ID of provided data already exists in coupling scheme, no duplicate is created but a pointer to the already existing CouplingData is returned.
data | data the CouplingData is associated with |
mesh | mesh the CouplingData is associated with |
requiresInitialization | true, if CouplingData requires initialization |
exchangeSubsteps | true, if CouplingData exchanges all substeps in send/recv |
direction | is the coupling data send or received? |
Definition at line 228 of file BaseCouplingScheme.cpp.
|
private |
Advance txt writers for iterations and convergence tracking.
Definition at line 802 of file BaseCouplingScheme.cpp.
|
private |
Checks whether any CouplingData in dataMap requires initialization.
dataMap | map containing CouplingData |
Definition at line 867 of file BaseCouplingScheme.cpp.
|
private |
If any required actions are open, an error message is issued.
Definition at line 633 of file BaseCouplingScheme.cpp.
|
private |
Issues an error if coupling data does not contain stamples.
Definition at line 656 of file BaseCouplingScheme.cpp.
|
pure virtual |
Determines which data is initialized and therefore has to be exchanged during initialize.
Calls determineInitialSend and determineInitialReceive for all send and receive data of this coupling scheme.
Implemented in precice::cplscheme::BiCouplingScheme, and precice::cplscheme::MultiCouplingScheme.
|
protected |
Sets _receivesInitializedData, if receiveData requires initialization.
receiveData | CouplingData being checked |
Definition at line 860 of file BaseCouplingScheme.cpp.
|
protected |
Sets _sendsInitializedData, if sendData requires initialization.
sendData | CouplingData being checked |
Definition at line 852 of file BaseCouplingScheme.cpp.
bool precice::cplscheme::BaseCouplingScheme::doesFirstStep | ( | ) | const |
Getter for _doesFirstStep.
Definition at line 680 of file BaseCouplingScheme.cpp.
|
protected |
perform a coupling iteration
This function is called from the child classes
Definition at line 873 of file BaseCouplingScheme.cpp.
|
privatepure virtual |
Functions needed for advance()
Exchanges the first set of data
Implemented in precice::cplscheme::MultiCouplingScheme, precice::cplscheme::ParallelCouplingScheme, and precice::cplscheme::SerialCouplingScheme.
|
privatepure virtual |
implements functionality for initialize in base class.
Implemented in precice::cplscheme::MultiCouplingScheme, precice::cplscheme::ParallelCouplingScheme, and precice::cplscheme::SerialCouplingScheme.
|
privatepure virtual |
Exchanges the second set of data.
Implemented in precice::cplscheme::MultiCouplingScheme, precice::cplscheme::ParallelCouplingScheme, and precice::cplscheme::SerialCouplingScheme.
|
finaloverridevirtual |
Finalizes the coupling scheme.
Implements precice::cplscheme::CouplingScheme.
Definition at line 269 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Exchanges the first set of data.
Implements precice::cplscheme::CouplingScheme.
Definition at line 342 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
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 336 of file BaseCouplingScheme.cpp.
|
privatepure virtual |
interface to provide accelerated data, depending on coupling scheme being used
Implemented in precice::cplscheme::MultiCouplingScheme, precice::cplscheme::ParallelCouplingScheme, and precice::cplscheme::SerialCouplingScheme.
|
finaloverridevirtual |
Returns the maximal size of the next time step to be computed.
If no time window size is prescribed by the coupling scheme, always the maximal double accuracy floating point number value is returned.
Implements precice::cplscheme::CouplingScheme.
Definition at line 524 of file BaseCouplingScheme.cpp.
|
protected |
Getter for _nextTimeWindowSize.
timeWindowSize |
Definition at line 444 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _time
Implements precice::cplscheme::CouplingScheme.
Definition at line 509 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _timeWindows
Implements precice::cplscheme::CouplingScheme.
Definition at line 519 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns the time window size, if one is given by the coupling scheme.
An assertion is thrown, if no valid time window size is given. Check with hasTimeWindowSize().
Implements precice::cplscheme::CouplingScheme.
Definition at line 438 of file BaseCouplingScheme.cpp.
|
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 514 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 918 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 913 of file BaseCouplingScheme.cpp.
|
pure virtual |
Implemented in precice::cplscheme::BiCouplingScheme, and precice::cplscheme::MultiCouplingScheme.
|
overridevirtual |
Checks if the implicit cplscheme has converged.
Implements precice::cplscheme::CouplingScheme.
Definition at line 98 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _hasDataBeenReceived
Implements precice::cplscheme::CouplingScheme.
Definition at line 483 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Function to check whether time window size is defined by coupling scheme.
There are two reasons why a scheme might have a time window size: 1) a fixed time window size is given in the scheme 2) the participant received the time window size from another participant in the scheme
Implements precice::cplscheme::CouplingScheme.
Definition at line 433 of file BaseCouplingScheme.cpp.
|
overrideprotectedvirtual |
Returns a vector of implicit data to receive in the next advance.
Implements precice::cplscheme::CouplingScheme.
Reimplemented in precice::cplscheme::SerialCouplingScheme.
Definition at line 938 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Initializes the coupling scheme and establishes a communication connection to the coupling partner. Initializes coupling data.
Implements precice::cplscheme::CouplingScheme.
Definition at line 276 of file BaseCouplingScheme.cpp.
|
privatepure virtual |
Functions needed for initialize()
Need to initialize receive data
Implemented in precice::cplscheme::BiCouplingScheme, and precice::cplscheme::MultiCouplingScheme.
|
private |
Initialize txt writers for iterations and convergence tracking.
Definition at line 770 of file BaseCouplingScheme.cpp.
|
protected |
Initializes storage in receiveData as zero.
receiveData | DataMap associated with received data |
Definition at line 219 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, if the given action has to be performed by the accessor.
Implements precice::cplscheme::CouplingScheme.
Definition at line 554 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, if the given action has to be performed by the accessor.
Implements precice::cplscheme::CouplingScheme.
Definition at line 548 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, when the coupled simulation is still ongoing.
Implements precice::cplscheme::CouplingScheme.
Definition at line 537 of file BaseCouplingScheme.cpp.
|
protected |
Function to determine whether coupling scheme is an explicit coupling scheme.
Definition at line 253 of file BaseCouplingScheme.cpp.
|
overridevirtual |
Function to determine whether coupling scheme is an implicit coupling scheme.
Implements precice::cplscheme::CouplingScheme.
Definition at line 92 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _isInitialized
Implements precice::cplscheme::CouplingScheme.
Definition at line 449 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, when the accessor can advance to the next time window.
Implements precice::cplscheme::CouplingScheme.
Definition at line 543 of file BaseCouplingScheme.cpp.
|
finaloverrideprotectedvirtual |
Returns the name of the local participant.
Implements precice::cplscheme::CouplingScheme.
Definition at line 954 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Tells the coupling scheme that the accessor has performed the given action.
Implements precice::cplscheme::CouplingScheme.
Definition at line 560 of file BaseCouplingScheme.cpp.
|
private |
Measure whether coupling scheme has converged or not.
Definition at line 709 of file BaseCouplingScheme.cpp.
|
protected |
finalizes this window's data and initializes data for next window.
Definition at line 425 of file BaseCouplingScheme.cpp.
|
private |
Reset all convergence measurements after convergence.
Definition at line 685 of file BaseCouplingScheme.cpp.
|
protected |
Used to set flag after data has been received using receiveData().
Definition at line 493 of file BaseCouplingScheme.cpp.
|
private |
Prints the action state.
Definition at line 624 of file BaseCouplingScheme.cpp.
|
private |
Prints the coupling state.
timeWindows | current number of completed time windows |
time | current time |
Definition at line 594 of file BaseCouplingScheme.cpp.
|
overridevirtual |
Returns coupling state information.
Includes current iteration, max iterations, time, time window and action.
Implements precice::cplscheme::CouplingScheme.
Definition at line 573 of file BaseCouplingScheme.cpp.
|
protected |
Function to check whether end of time window is reached. Does not check for convergence.
Definition at line 829 of file BaseCouplingScheme.cpp.
|
protected |
receives convergence from other participant via m2n
m2n | used for receiving |
Definition at line 905 of file BaseCouplingScheme.cpp.
|
protected |
Receives data receiveDataIDs given in mapCouplingData with communication.
m2n | M2N used for communication |
receiveData | DataMap associated with received data |
Definition at line 167 of file BaseCouplingScheme.cpp.
|
protected |
Like receiveData, but temporarily sets window time to end of window.
This function is only needed for SerialCouplingScheme, if substeps="false". Here, a special situation arises for the second participant, because it receives data for the end of the window from the first participant: If substeps="false" only values without timestamps are exchanged. Therefore, getTime() is used to determine the time associated with the values. However, getTime() of the second participant points to the beginning of the window, if we enter a new window. We need to temporarily modify the return value of getTime() to point to the end of the window to be able to store the values at the correct point in time.
Note: This function could be removed by a) removing the option to turn off exchange of substeps or by b) refactoring the communication such that sent/received values always carry a timestamp.
m2n | M2N used for communication |
receiveData | DataMap associated with received data |
Definition at line 206 of file BaseCouplingScheme.cpp.
|
protected |
Getter for _receivesInitializedData.
Definition at line 499 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 152 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Reinitializes the coupling scheme, coupling data, and acceleration schemes.
Implements precice::cplscheme::CouplingScheme.
Definition at line 310 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Sets an action required to be performed by the accessor.
Implements precice::cplscheme::CouplingScheme.
Definition at line 567 of file BaseCouplingScheme.cpp.
|
finaloverrideprotectedvirtual |
Returns true if any send data of the scheme requires substeps.
Implements precice::cplscheme::CouplingScheme.
Definition at line 927 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Exchanges the second set of data.
This concludes the step of the coupling scheme
Implements precice::cplscheme::CouplingScheme.
Definition at line 365 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
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 360 of file BaseCouplingScheme.cpp.
|
protected |
sends convergence to other participant via m2n
m2n | used for sending |
Definition at line 897 of file BaseCouplingScheme.cpp.
|
protected |
Sends data sendDataIDs given in mapCouplingData with communication.
m2n | M2N used for communication |
sendData | DataMap associated with sent data |
Definition at line 112 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Getter for _sendsInitializedData.
Implements precice::cplscheme::CouplingScheme.
Definition at line 331 of file BaseCouplingScheme.cpp.
|
protected |
void precice::cplscheme::BaseCouplingScheme::setAcceleration | ( | const acceleration::PtrAcceleration & | acceleration | ) |
Set an acceleration technique.
Definition at line 673 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _doesFirstStep.
Definition at line 488 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _nextTimeWindowSize.
timeWindowSize |
Definition at line 264 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _timeWindows.
Sets the computed time windows of the coupling scheme. Used for testing to allow to advance in time without a coupling partner.
timeWindows | number of time windows |
Definition at line 504 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _timeWindowSize.
timeWindowSize |
Definition at line 259 of file BaseCouplingScheme.cpp.
|
protected |
used for storing all Data at end of doImplicitStep for later reference.
Definition at line 838 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, if data will be exchanged when calling advance().
Also returns true after the last call of advance() at the end of the simulation.
lastSolverTimeStepSize | [IN] The size of the last time step computed by the solver calling willDataBeExchanged(). |
Implements precice::cplscheme::CouplingScheme.
Definition at line 475 of file BaseCouplingScheme.cpp.
|
protected |
Acceleration method to speedup iteration convergence.
Definition at line 237 of file BaseCouplingScheme.hpp.
|
protected |
All send and receive data as a map "data ID -> data".
Definition at line 234 of file BaseCouplingScheme.hpp.
|
private |
All convergence measures of coupling iterations.
Before initialization, only dataID and measure variables are filled. Then, the data is fetched from send and receive data assigned to the cpl scheme.
Definition at line 509 of file BaseCouplingScheme.hpp.
|
private |
Writes out coupling convergence within all time windows.
Definition at line 477 of file BaseCouplingScheme.hpp.
|
private |
Coupling mode used by coupling scheme.
Definition at line 414 of file BaseCouplingScheme.hpp.
|
private |
True, if local participant is the one starting the explicit scheme.
Definition at line 449 of file BaseCouplingScheme.hpp.
Definition at line 468 of file BaseCouplingScheme.hpp.
|
private |
True if implicit scheme converged.
Definition at line 471 of file BaseCouplingScheme.hpp.
|
private |
True, if data has been received from other participant. Flag is used to make sure that coupling scheme is implemented and used correctly.
Definition at line 461 of file BaseCouplingScheme.hpp.
|
private |
True, if coupling has been initialized.
Definition at line 464 of file BaseCouplingScheme.hpp.
|
private |
True, if _time == _timeWindowStartTime + _timeWindowSize and (coupling has converged or _iterations == _maxIterations)
Definition at line 452 of file BaseCouplingScheme.hpp.
|
private |
Number of iterations in current time window. _iterations <= _maxIterations.
Definition at line 443 of file BaseCouplingScheme.hpp.
|
private |
Responsible for monitoring iteration count over time window.
Definition at line 474 of file BaseCouplingScheme.hpp.
|
private |
Local participant name.
Definition at line 480 of file BaseCouplingScheme.hpp.
|
mutableprivate |
Definition at line 416 of file BaseCouplingScheme.hpp.
|
private |
Limit of iterations during one time window. Continue to next time window, if _iterations == _maxIterations.
Definition at line 440 of file BaseCouplingScheme.hpp.
|
private |
Maximum time being computed. End of simulation is reached, if getTime() == _maxTime.
Definition at line 419 of file BaseCouplingScheme.hpp.
|
private |
Number of time windows that have to be computed. End of simulation is reached, if _timeWindows == _maxTimeWindows.
Definition at line 422 of file BaseCouplingScheme.hpp.
|
private |
Lower limit of iterations during one time window. Prevents convergence if _iterations < _minIterations.
Definition at line 437 of file BaseCouplingScheme.hpp.
|
private |
time window size of next window (acts as buffer for time windows size provided by first participant, if using first participant method)
Definition at line 431 of file BaseCouplingScheme.hpp.
|
private |
True, if this participant has to receive initialized data.
Definition at line 458 of file BaseCouplingScheme.hpp.
Definition at line 466 of file BaseCouplingScheme.hpp.
|
private |
True, if this participant has to send initialized data.
Definition at line 455 of file BaseCouplingScheme.hpp.
|
private |
Time handler.
Definition at line 434 of file BaseCouplingScheme.hpp.
|
private |
number of completed time windows; _timeWindows <= _maxTimeWindows
Definition at line 425 of file BaseCouplingScheme.hpp.
|
private |
size of time window; _timeWindowSize <= _maxTime
Definition at line 428 of file BaseCouplingScheme.hpp.
|
private |
Number of total iterations performed.
Definition at line 446 of file BaseCouplingScheme.hpp.