preCICE v3.2.0
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::cplscheme {
16class CouplingData;
17
27
28public:
30 double maxTime,
31 int maxTimeWindows,
32 double timeWindowSize,
33 std::string firstParticipant,
34 std::string secondParticipant,
37 int minIterations,
38 int maxIterations,
39 CouplingMode cplMode,
41
43 void addDataToSend(
44 const mesh::PtrData &data,
46 bool requiresInitialization,
47 bool exchangeSubsteps);
48
51 const mesh::PtrData &data,
53 bool requiresInitialization,
54 bool exchangeSubsteps);
55
56 void determineInitialDataExchange() override;
57
59 std::vector<std::string> getCouplingPartners() const final override;
60
64 bool hasAnySendData() final override;
65
69 bool hasSendData(DataID dataID);
70
71protected:
74
77
79 const DataMap &getReceiveData() const;
80
83
86
88 m2n::PtrM2N getM2N() const;
89
91 void initializeReceiveDataStorage() final override;
92
93private:
94 mutable logging::Logger _log{"cplscheme::BiCouplingScheme"};
95
98
101
104
107
110};
111
112} // namespace precice::cplscheme
std::string localParticipant() const final override
Returns the name of the local participant.
BaseCouplingScheme(double maxTime, int maxTimeWindows, double timeWindowSize, std::string localParticipant, int minIterations, int maxIterations, CouplingMode cplMode, constants::TimesteppingMethod dtMethod)
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".
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.
std::vector< std::string > getCouplingPartners() const final override
returns list of all coupling partners
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 initializeReceiveDataStorage() final override
Functions needed for initialize()
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:17
contains implementations of coupling schemes for coupled simulations.
std::map< int, PtrCouplingData > DataMap
contains the logic of the parallel communication between participants.
Definition BoundM2N.cpp:12
std::shared_ptr< M2N > PtrM2N
provides Mesh, Data and primitives.
std::shared_ptr< Data > PtrData
std::shared_ptr< Mesh > PtrMesh
int DataID
Definition Types.hpp:25