preCICE v3.1.1
Loading...
Searching...
No Matches
SerialCouplingScheme.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
7#include "logging/Logger.hpp"
9
10namespace precice {
11
12namespace testing {
13// Forward declaration to friend the boost test struct
14struct SerialCouplingSchemeFixture;
15} // namespace testing
16
17namespace cplscheme {
25 friend struct testing::SerialCouplingSchemeFixture; // Make the fixture friend of this class
26public:
42 double maxTime,
43 int maxTimeWindows,
44 double timeWindowSize,
45 const std::string & firstParticipant,
46 const std::string & secondParticipant,
47 const std::string & localParticipant,
48 m2n::PtrM2N m2n,
50 CouplingMode cplMode,
51 int minIterations,
52 int maxIterations);
53
55 double maxTime,
56 int maxTimeWindows,
57 double timeWindowSize,
58 const std::string & firstParticipant,
59 const std::string & secondParticipant,
60 const std::string & localParticipant,
61 m2n::PtrM2N m2n,
63 CouplingMode cplMode);
64
65 ImplicitData implicitDataToReceive() const override final;
66
67private:
68 logging::Logger _log{"cplschemes::SerialCouplingSchemes"};
69
72
75
77 void sendTimeWindowSize();
78
81
83 void exchangeInitialData() override final;
84
85 void exchangeFirstData() override final;
86
87 void exchangeSecondData() override final;
88
89 DataMap &getAccelerationData() override final;
90};
91
92} // namespace cplscheme
93} // namespace precice
Abstract base class for coupling schemes with two participants.
Coupling scheme for serial coupling, i.e. staggered execution of two coupled participants.
void exchangeSecondData() override final
Exchanges the second set of data.
void receiveAndSetTimeWindowSize()
Receives and sets the time window size, if this participant is the one to receive.
bool _participantSetsTimeWindowSize
Determines, if the time window size is set by the participant.
void sendTimeWindowSize()
Sends time window size, if this participant is the one to send.
void exchangeInitialData() override final
implements functionality for initialize in base class.
SerialCouplingScheme(double maxTime, int maxTimeWindows, double timeWindowSize, const std::string &firstParticipant, const std::string &secondParticipant, const std::string &localParticipant, m2n::PtrM2N m2n, constants::TimesteppingMethod dtMethod, CouplingMode cplMode, int minIterations, int maxIterations)
Constructor.
void exchangeFirstData() override final
Functions needed for advance()
ImplicitData implicitDataToReceive() const override final
Returns a vector of implicit data to receive in the next advance.
bool _participantReceivesTimeWindowSize
Determines, if the time window size is received by the participant.
DataMap & getAccelerationData() override final
interface to provide accelerated data, depending on coupling scheme being used
Main namespace of the precice library.