preCICE v3.1.2
|
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 } |
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> |
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 override final |
Getter for _sendsInitializedData. | |
bool | isInitialized () const override final |
getter for _isInitialized | |
bool | addComputedTime (double timeToAdd) override final |
Adds newly computed time. Has to be called before every advance. | |
bool | willDataBeExchanged (double lastSolverTimeStepSize) const override final |
Returns true, if data will be exchanged when calling advance(). | |
bool | hasDataBeenReceived () const override final |
getter for _hasDataBeenReceived | |
double | getTime () const override final |
getter for _time | |
double | getTimeWindowStart () const override final |
int | getTimeWindows () const override final |
getter for _timeWindows | |
bool | hasTimeWindowSize () const override final |
Function to check whether time window size is defined by coupling scheme. | |
double | getTimeWindowSize () const override final |
Returns the time window size, if one is given by the coupling scheme. | |
double | getNextTimeStepMaxSize () const override final |
Returns the maximal size of the next time step to be computed. | |
bool | isCouplingOngoing () const override final |
Returns true, when the coupled simulation is still ongoing. | |
bool | isTimeWindowComplete () const override final |
Returns true, when the accessor can advance to the next time window. | |
bool | isActionRequired (Action action) const override final |
Returns true, if the given action has to be performed by the accessor. | |
bool | isActionFulfilled (Action action) const override final |
Returns true, if the given action has to be performed by the accessor. | |
void | markActionFulfilled (Action action) override final |
Tells the coupling scheme that the accessor has performed the given action. | |
void | requireAction (Action action) override final |
Sets an action required to be performed by the accessor. | |
std::string | printCouplingState () const override |
Returns coupling state information. | |
void | finalize () override final |
Finalizes the coupling scheme. | |
void | initialize (double startTime, int startTimeWindow) override final |
Initializes the coupling scheme. | |
ChangedMeshes | firstSynchronization (const ChangedMeshes &changes) override final |
void | firstExchange () override final |
ChangedMeshes | secondSynchronization () override final |
void | secondExchange () override final |
void | addConvergenceMeasure (int dataID, bool suffices, bool strict, impl::PtrConvergenceMeasure measure, bool doesLogging) |
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. | |
Public Member Functions inherited from precice::cplscheme::CouplingScheme | |
CouplingScheme & | operator= (CouplingScheme &&)=delete |
virtual | ~CouplingScheme () |
virtual std::vector< std::string > | getCouplingPartners () const =0 |
Returns list of all coupling partners. | |
Protected Member Functions | |
void | sendNumberOfTimeSteps (const m2n::PtrM2N &m2n, const int numberOfTimeSteps) |
void | sendTimes (const m2n::PtrM2N &m2n, const Eigen::VectorXd ×) |
void | sendData (const m2n::PtrM2N &m2n, const DataMap &sendData) |
Sends data sendDataIDs given in mapCouplingData with communication. | |
int | receiveNumberOfTimeSteps (const m2n::PtrM2N &m2n) |
Eigen::VectorXd | receiveTimes (const m2n::PtrM2N &m2n, int nTimeSteps) |
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 override final |
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 override final |
Returns the name of the local participant. | |
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 | 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. | |
double | getWindowEndTime () const |
double | getWindowStartTime () const |
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 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). | |
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 423 of file BaseCouplingScheme.cpp.
void precice::cplscheme::BaseCouplingScheme::addConvergenceMeasure | ( | int | dataID, |
bool | suffices, | ||
bool | strict, | ||
impl::PtrConvergenceMeasure | measure, | ||
bool | doesLogging ) |
Adds a measure to determine the convergence of coupling iterations.
Definition at line 635 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 233 of file BaseCouplingScheme.cpp.
|
private |
Advance txt writers for iterations and convergence tracking.
Definition at line 748 of file BaseCouplingScheme.cpp.
|
private |
Checks whether any CouplingData in dataMap requires initialization.
dataMap | map containing CouplingData |
Definition at line 798 of file BaseCouplingScheme.cpp.
|
private |
If any required actions are open, an error message is issued.
Definition at line 591 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 791 of file BaseCouplingScheme.cpp.
|
protected |
Sets _sendsInitializedData, if sendData requires initialization.
sendData | CouplingData being checked |
Definition at line 783 of file BaseCouplingScheme.cpp.
bool precice::cplscheme::BaseCouplingScheme::doesFirstStep | ( | ) | const |
Getter for _doesFirstStep.
Definition at line 621 of file BaseCouplingScheme.cpp.
|
protected |
perform a coupling iteration
This function is called from the child classes
Definition at line 809 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 263 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Exchanges the first set of data.
Implements precice::cplscheme::CouplingScheme.
Definition at line 311 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 305 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 493 of file BaseCouplingScheme.cpp.
|
protected |
Getter for _nextTimeWindowSize.
timeWindowSize |
Definition at line 413 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _time
Implements precice::cplscheme::CouplingScheme.
Definition at line 478 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _timeWindows
Implements precice::cplscheme::CouplingScheme.
Definition at line 488 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 407 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 483 of file BaseCouplingScheme.cpp.
|
private |
Definition at line 866 of file BaseCouplingScheme.cpp.
|
private |
Definition at line 861 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 96 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _hasDataBeenReceived
Implements precice::cplscheme::CouplingScheme.
Definition at line 452 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 402 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 882 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Initializes the coupling scheme.
[in] | startTime | starting time of coupling scheme |
[in] | startTimeWindow | starting counter of time window, from which coupling scheme starts |
Implements precice::cplscheme::CouplingScheme.
Definition at line 270 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 713 of file BaseCouplingScheme.cpp.
|
protected |
Initializes storage in receiveData as zero.
receiveData | DataMap associated with received data |
Definition at line 224 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 523 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 517 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, when the coupled simulation is still ongoing.
Implements precice::cplscheme::CouplingScheme.
Definition at line 506 of file BaseCouplingScheme.cpp.
|
protected |
Function to determine whether coupling scheme is an explicit coupling scheme.
Definition at line 247 of file BaseCouplingScheme.cpp.
|
overridevirtual |
Function to determine whether coupling scheme is an implicit coupling scheme.
Implements precice::cplscheme::CouplingScheme.
Definition at line 90 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
getter for _isInitialized
Implements precice::cplscheme::CouplingScheme.
Definition at line 418 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Returns true, when the accessor can advance to the next time window.
Implements precice::cplscheme::CouplingScheme.
Definition at line 512 of file BaseCouplingScheme.cpp.
|
finaloverrideprotectedvirtual |
Returns the name of the local participant.
Implements precice::cplscheme::CouplingScheme.
Definition at line 898 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Tells the coupling scheme that the accessor has performed the given action.
Implements precice::cplscheme::CouplingScheme.
Definition at line 529 of file BaseCouplingScheme.cpp.
|
private |
Measure whether coupling scheme has converged or not.
Definition at line 652 of file BaseCouplingScheme.cpp.
|
protected |
finalizes this window's data and initializes data for next window.
Definition at line 394 of file BaseCouplingScheme.cpp.
|
private |
Reset all convergence measurements after convergence.
Definition at line 626 of file BaseCouplingScheme.cpp.
|
protected |
Used to set flag after data has been received using receiveData().
Definition at line 462 of file BaseCouplingScheme.cpp.
|
private |
Prints the action state.
Definition at line 582 of file BaseCouplingScheme.cpp.
|
private |
Prints the coupling state.
timeWindows | current number of completed time windows |
time | current time |
Definition at line 556 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 542 of file BaseCouplingScheme.cpp.
|
protected |
Function to check whether end of time window is reached. Does not check for convergence.
Definition at line 766 of file BaseCouplingScheme.cpp.
|
protected |
receives convergence from other participant via m2n
m2n | used for receiving |
Definition at line 854 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 174 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 211 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 155 of file BaseCouplingScheme.cpp.
|
protected |
Getter for _receivesInitializedData.
Definition at line 468 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 164 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Sets an action required to be performed by the accessor.
Implements precice::cplscheme::CouplingScheme.
Definition at line 536 of file BaseCouplingScheme.cpp.
|
finaloverrideprotectedvirtual |
Returns true if any send data of the scheme requires substeps.
Implements precice::cplscheme::CouplingScheme.
Definition at line 871 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 334 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 329 of file BaseCouplingScheme.cpp.
|
protected |
sends convergence to other participant via m2n
m2n | used for sending |
Definition at line 847 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 115 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 101 of file BaseCouplingScheme.cpp.
|
finaloverridevirtual |
Getter for _sendsInitializedData.
Implements precice::cplscheme::CouplingScheme.
Definition at line 300 of file BaseCouplingScheme.cpp.
|
protected |
Definition at line 108 of file BaseCouplingScheme.cpp.
void precice::cplscheme::BaseCouplingScheme::setAcceleration | ( | const acceleration::PtrAcceleration & | acceleration | ) |
Set an acceleration technique.
Definition at line 614 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _doesFirstStep.
Definition at line 457 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _nextTimeWindowSize.
timeWindowSize |
Definition at line 258 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 473 of file BaseCouplingScheme.cpp.
|
protected |
Setter for _timeWindowSize.
timeWindowSize |
Definition at line 253 of file BaseCouplingScheme.cpp.
|
protected |
used for storing all Data at end of doImplicitStep for later reference.
Definition at line 775 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 444 of file BaseCouplingScheme.cpp.
|
protected |
Acceleration method to speedup iteration convergence.
Definition at line 241 of file BaseCouplingScheme.hpp.
|
protected |
All send and receive data as a map "data ID -> data".
Definition at line 238 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 507 of file BaseCouplingScheme.hpp.
|
private |
Writes out coupling convergence within all time windows.
Definition at line 474 of file BaseCouplingScheme.hpp.
|
private |
Coupling mode used by coupling scheme.
Definition at line 411 of file BaseCouplingScheme.hpp.
|
private |
True, if local participant is the one starting the explicit scheme.
Definition at line 446 of file BaseCouplingScheme.hpp.
Definition at line 465 of file BaseCouplingScheme.hpp.
|
private |
True if implicit scheme converged.
Definition at line 468 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 458 of file BaseCouplingScheme.hpp.
|
private |
True, if coupling has been initialized.
Definition at line 461 of file BaseCouplingScheme.hpp.
|
private |
True, if _time == _timeWindowStartTime + _timeWindowSize and (coupling has converged or _iterations == _maxIterations)
Definition at line 449 of file BaseCouplingScheme.hpp.
|
private |
Number of iterations in current time window. _iterations <= _maxIterations.
Definition at line 440 of file BaseCouplingScheme.hpp.
|
private |
Responsible for monitoring iteration count over time window.
Definition at line 471 of file BaseCouplingScheme.hpp.
|
private |
Local participant name.
Definition at line 477 of file BaseCouplingScheme.hpp.
|
mutableprivate |
Definition at line 413 of file BaseCouplingScheme.hpp.
|
private |
Limit of iterations during one time window. Continue to next time window, if _iterations == _maxIterations.
Definition at line 437 of file BaseCouplingScheme.hpp.
|
private |
Maximum time being computed. End of simulation is reached, if getTime() == _maxTime.
Definition at line 416 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 419 of file BaseCouplingScheme.hpp.
|
private |
Lower limit of iterations during one time window. Prevents convergence if _iterations < _minIterations.
Definition at line 434 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 428 of file BaseCouplingScheme.hpp.
|
private |
True, if this participant has to receive initialized data.
Definition at line 455 of file BaseCouplingScheme.hpp.
Definition at line 463 of file BaseCouplingScheme.hpp.
|
private |
True, if this participant has to send initialized data.
Definition at line 452 of file BaseCouplingScheme.hpp.
|
private |
Time handler.
Definition at line 431 of file BaseCouplingScheme.hpp.
|
private |
number of completed time windows; _timeWindows <= _maxTimeWindows
Definition at line 422 of file BaseCouplingScheme.hpp.
|
private |
size of time window; _timeWindowSize <= _maxTime
Definition at line 425 of file BaseCouplingScheme.hpp.
|
private |
Number of total iterations performed.
Definition at line 443 of file BaseCouplingScheme.hpp.