24 double timeWindowSize,
33 :
BaseCouplingScheme(maxTime, maxTimeWindows, timeWindowSize, localParticipant, minIterations, maxIterations, cplMode, dtMethod),
35 _firstParticipant(
std::move(firstParticipant)),
36 _secondParticipant(
std::move(secondParticipant))
39 "First participant and second participant must have different names.");
45 PRECICE_ERROR(
"Name of local participant \"{}\" does not match any participant specified for the coupling scheme.",
53 bool requiresInitialization,
54 bool exchangeSubsteps)
63 PRECICE_ERROR(
"Data \"{0}\" cannot be added twice for sending. Please remove any duplicate <exchange data=\"{0}\" .../> tags", data->getName());
70 bool requiresInitialization,
71 bool exchangeSubsteps)
80 PRECICE_ERROR(
"Data \"{0}\" cannot be added twice for receiving. Please remove any duplicate <exchange data=\"{0}\" ... /> tags", data->getName());
123 return &(*(iter->second));
134 return &(*(iter->second));
#define PRECICE_ERROR(...)
#define PRECICE_TRACE(...)
#define PRECICE_ASSERT(...)
Abstract base class for standard coupling schemes.
void initializeWithZeroInitialData(const DataMap &receiveData)
Initializes storage in receiveData as zero.
void determineInitialReceive(DataMap &receiveData)
Sets _receivesInitializedData, if receiveData requires initialization.
void determineInitialSend(DataMap &sendData)
Sets _sendsInitializedData, if sendData requires initialization.
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 Coupl...
std::string localParticipant() const override final
Returns the name of the local participant.
void setDoesFirstStep(bool doesFirstStep)
Setter for _doesFirstStep.
bool doesFirstStep() const
Getter for _doesFirstStep.
bool hasAnySendData() override final
std::vector< std::string > getCouplingPartners() const override final
returns list of all coupling partners
bool hasSendData(DataID dataID)
std::string _secondParticipant
Second participant name.
DataMap & getSendData()
Returns all data to be sent.
DataMap _sendData
All send data as a map "data ID -> data".
std::string _firstParticipant
First participant name.
DataMap _receiveData
All receive data as a map "data ID -> data".
void initializeReceiveDataStorage() override final
Functions needed for initialize()
m2n::PtrM2N _m2n
Communication to the other coupling participant.
void addDataToReceive(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps)
Adds data to be received on data exchange.
DataMap & getReceiveData()
Returns all data to be received.
BiCouplingScheme(double maxTime, int maxTimeWindows, double timeWindowSize, std::string firstParticipant, std::string secondParticipant, const std::string &localParticipant, m2n::PtrM2N m2n, int minIterations, int maxIterations, CouplingMode cplMode, constants::TimesteppingMethod dtMethod)
void addDataToSend(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps)
Adds data to be sent on data exchange and possibly be modified during coupling iterations.
m2n::PtrM2N getM2N() const
void determineInitialDataExchange() override
Determines which data is initialized and therefore has to be exchanged during initialize.
contains implementations of coupling schemes for coupled simulations.
bool contained(const ELEMENT_T &element, const std::vector< ELEMENT_T > &vec)
Returns true, if given element is in vector, otherwise false.