preCICE v3.1.2
Loading...
Searching...
No Matches
MultiCouplingScheme.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <map>
4#include <string>
5#include <vector>
8#include "logging/Logger.hpp"
11#include "utils/Helpers.hpp"
12
13namespace precice {
14namespace cplscheme {
15class CouplingData;
16struct ExchangeData;
17
27public:
40 double maxTime,
41 int maxTimeWindows,
42 double timeWindowSize,
46 const std::string & controller,
47 int minIterations,
48 int maxIterations);
49
51 void addDataToSend(
52 const mesh::PtrData &data,
53 mesh::PtrMesh mesh,
54 bool requiresInitialization,
55 bool exchangeSubsteps,
56 const std::string & to);
57
60 const mesh::PtrData &data,
61 mesh::PtrMesh mesh,
62 bool requiresInitialization,
63 bool exchangeSubsteps,
64 const std::string & from);
65
66 void determineInitialDataExchange() override;
67
68 std::vector<std::string> getCouplingPartners() const override final;
69
70 bool hasAnySendData() override final;
71
72private:
77
82
87
88 logging::Logger _log{"cplscheme::MultiCouplingScheme"};
89
90 void exchangeFirstData() override final;
91
92 void exchangeSecondData() override final;
93
94 DataMap &getAccelerationData() override final;
95
97 void initializeReceiveDataStorage() override final;
98
100 void exchangeInitialData() override final;
101
104
107};
108
109} // namespace cplscheme
110} // namespace precice
Abstract base class for standard coupling schemes.
std::string localParticipant() const override final
Returns the name of the local participant.
A coupling scheme with multiple participants.
std::string _controller
name of the controller participant
std::map< std::string, m2n::PtrM2N > _m2ns
A vector of m2ns. A m2n is a communication device to the other coupling participant.
void addDataToSend(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, const std::string &to)
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.
void initializeReceiveDataStorage() override final
Functions needed for initialize()
void exchangeInitialData() override final
implements functionality for initialize in base class.
void exchangeFirstData() override final
Functions needed for advance()
MultiCouplingScheme(double maxTime, int maxTimeWindows, double timeWindowSize, const std::string &localParticipant, std::map< std::string, m2n::PtrM2N > m2ns, constants::TimesteppingMethod dtMethod, const std::string &controller, int minIterations, int maxIterations)
Constructor.
void exchangeSecondData() override final
Exchanges the second set of data.
std::map< std::string, DataMap > _sendDataVector
A vector of all data to be sent.
bool _isController
if this is the controller or not
std::vector< std::string > getCouplingPartners() const override final
Returns list of all coupling partners.
void addDataToReceive(const mesh::PtrData &data, mesh::PtrMesh mesh, bool requiresInitialization, bool exchangeSubsteps, const std::string &from)
Adds data to be received on data exchange.
DataMap & getAccelerationData() override final
interface to provide accelerated data, depending on coupling scheme being used
std::map< std::string, DataMap > _receiveDataVector
A vector of all data to be received.
This class provides a lightweight logger.
Definition Logger.hpp:16
Main namespace of the precice library.
STL namespace.