preCICE v3.1.2
Loading...
Searching...
No Matches
BiCouplingScheme.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5
8#include "logging/Logger.hpp"
13#include "utils/assertion.hpp"
14
15namespace precice {
16namespace cplscheme {
17class CouplingData;
18
28
29public:
31 double maxTime,
32 int maxTimeWindows,
33 double timeWindowSize,
34 std::string firstParticipant,
35 std::string secondParticipant,
37 m2n::PtrM2N m2n,
38 int minIterations,
39 int maxIterations,
40 CouplingMode cplMode,
42
44 void addDataToSend(
45 const mesh::PtrData &data,
46 mesh::PtrMesh mesh,
47 bool requiresInitialization,
48 bool exchangeSubsteps);
49
52 const mesh::PtrData &data,
53 mesh::PtrMesh mesh,
54 bool requiresInitialization,
55 bool exchangeSubsteps);
56
57 void determineInitialDataExchange() override;
58
60 std::vector<std::string> getCouplingPartners() const override final;
61
65 bool hasAnySendData() override final;
66
70 bool hasSendData(DataID dataID);
71
72protected:
75
78
80 const DataMap &getReceiveData() const;
81
84
87
89 m2n::PtrM2N getM2N() const;
90
92 void initializeReceiveDataStorage() override final;
93
94private:
95 mutable logging::Logger _log{"cplscheme::BiCouplingScheme"};
96
99
102
105
108
111};
112
113} // namespace cplscheme
114} // namespace precice
Abstract base class for standard coupling schemes.
std::string localParticipant() const override final
Returns the name of the local participant.
Abstract base class for coupling schemes with two participants.
std::vector< std::string > getCouplingPartners() const override final
returns list of all coupling partners
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.
void determineInitialDataExchange() override
Determines which data is initialized and therefore has to be exchanged during initialize.
This class provides a lightweight logger.
Definition Logger.hpp:16
Main namespace of the precice library.
int DataID
Definition Types.hpp:25